Commit c95337d6 authored by Nico Weber's avatar Nico Weber

Remove needless move() calls in cloud_print/gcp20

After https://codereview.chromium.org/1553493002/, the compiler can
inform us that these are not needed and in fact harmful:

..\..\cloud_print\gcp20\prototype\privet_http_server.cc(418,10) :  error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
  return std::move(response);
         ^
..\..\cloud_print\gcp20\prototype\privet_http_server.cc(418,10) :  note: remove std::move call here
  return std::move(response);
         ^~~~~~~~~~

..\..\cloud_print\gcp20\prototype\cloud_print_url_request_context_getter.cc(30,16) :  error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move]
    context_ = std::move(builder.Build());
               ^
..\..\cloud_print\gcp20\prototype\cloud_print_url_request_context_getter.cc(30,16) :  note: remove std::move call here
    context_ = std::move(builder.Build());
               ^~~~~~~~~~               ~

BUG=82385
TBR=vitalybuka

Review URL: https://codereview.chromium.org/1552613003 .

Cr-Commit-Position: refs/heads/master@{#367067}
parent 3b761ba5
...@@ -57,7 +57,7 @@ scoped_ptr<CloudPrintRequest> CloudPrintRequest::CreatePost( ...@@ -57,7 +57,7 @@ scoped_ptr<CloudPrintRequest> CloudPrintRequest::CreatePost(
scoped_ptr<CloudPrintRequest> request( scoped_ptr<CloudPrintRequest> request(
new CloudPrintRequest(url, URLFetcher::POST, delegate)); new CloudPrintRequest(url, URLFetcher::POST, delegate));
request->fetcher_->SetUploadData(mimetype, content); request->fetcher_->SetUploadData(mimetype, content);
return std::move(request); return request;
} }
void CloudPrintRequest::Run( void CloudPrintRequest::Run(
......
...@@ -27,7 +27,7 @@ CloudPrintURLRequestContextGetter::GetURLRequestContext() { ...@@ -27,7 +27,7 @@ CloudPrintURLRequestContextGetter::GetURLRequestContext() {
builder.set_proxy_config_service( builder.set_proxy_config_service(
make_scoped_ptr(new net::ProxyConfigServiceFixed(net::ProxyConfig()))); make_scoped_ptr(new net::ProxyConfigServiceFixed(net::ProxyConfig())));
#endif // defined(OS_LINUX) || defined(OS_ANDROID) #endif // defined(OS_LINUX) || defined(OS_ANDROID)
context_ = std::move(builder.Build()); context_ = builder.Build();
} }
return context_.get(); return context_.get();
} }
......
...@@ -35,7 +35,7 @@ scoped_ptr<base::DictionaryValue> CreateError(const std::string& error_type) { ...@@ -35,7 +35,7 @@ scoped_ptr<base::DictionaryValue> CreateError(const std::string& error_type) {
scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue); scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue);
error->SetString("error", error_type); error->SetString("error", error_type);
return std::move(error); return error;
} }
// {"error":|error_type|, "description":|description|} // {"error":|error_type|, "description":|description|}
...@@ -44,7 +44,7 @@ scoped_ptr<base::DictionaryValue> CreateErrorWithDescription( ...@@ -44,7 +44,7 @@ scoped_ptr<base::DictionaryValue> CreateErrorWithDescription(
const std::string& description) { const std::string& description) {
scoped_ptr<base::DictionaryValue> error(CreateError(error_type)); scoped_ptr<base::DictionaryValue> error(CreateError(error_type));
error->SetString("description", description); error->SetString("description", description);
return std::move(error); return error;
} }
// {"error":|error_type|, "timeout":|timeout|} // {"error":|error_type|, "timeout":|timeout|}
...@@ -53,7 +53,7 @@ scoped_ptr<base::DictionaryValue> CreateErrorWithTimeout( ...@@ -53,7 +53,7 @@ scoped_ptr<base::DictionaryValue> CreateErrorWithTimeout(
int timeout) { int timeout) {
scoped_ptr<base::DictionaryValue> error(CreateError(error_type)); scoped_ptr<base::DictionaryValue> error(CreateError(error_type));
error->SetInteger("timeout", timeout); error->SetInteger("timeout", timeout);
return std::move(error); return error;
} }
// Converts state to string. // Converts state to string.
...@@ -278,7 +278,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessInfo( ...@@ -278,7 +278,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessInfo(
response->Set("type", type.DeepCopy()); response->Set("type", type.DeepCopy());
*status_code = net::HTTP_OK; *status_code = net::HTTP_OK;
return std::move(response); return response;
} }
scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessCapabilities( scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessCapabilities(
...@@ -377,7 +377,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessSubmitDoc( ...@@ -377,7 +377,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessSubmitDoc(
base::StringPrintf("%u", static_cast<uint32_t>(job.content.size()))); base::StringPrintf("%u", static_cast<uint32_t>(job.content.size())));
if (job_name_present) if (job_name_present)
response->SetString("job_name", job.job_name); response->SetString("job_name", job.job_name);
return std::move(response); return response;
case LocalPrintJob::SAVE_INVALID_PRINT_JOB: case LocalPrintJob::SAVE_INVALID_PRINT_JOB:
return CreateErrorWithTimeout("invalid_print_job", timeout); return CreateErrorWithTimeout("invalid_print_job", timeout);
...@@ -415,7 +415,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessJobState( ...@@ -415,7 +415,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessJobState(
response->SetString("job_id", job_id); response->SetString("job_id", job_id);
response->SetString("state", LocalPrintJobStateToString(info.state)); response->SetString("state", LocalPrintJobStateToString(info.state));
response->SetInteger("expires_in", info.expires_in); response->SetInteger("expires_in", info.expires_in);
return std::move(response); return response;
} }
scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessRegister( scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessRegister(
...@@ -466,7 +466,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessRegister( ...@@ -466,7 +466,7 @@ scoped_ptr<base::DictionaryValue> PrivetHttpServer::ProcessRegister(
ProcessRegistrationStatus(status, &response); ProcessRegistrationStatus(status, &response);
*status_code = net::HTTP_OK; *status_code = net::HTTP_OK;
return std::move(response); return response;
} }
void PrivetHttpServer::ProcessRegistrationStatus( void PrivetHttpServer::ProcessRegistrationStatus(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment