Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(387)

Side by Side Diff: cloud_print/gcp20/prototype/cloud_print_request.cc

Issue 1553493002: Global conversion of Pass()→std::move() on OS=linux chromecast=1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix fragile include order Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/feature_list_unittest.cc ('k') | cloud_print/gcp20/prototype/cloud_print_requester.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cloud_print/gcp20/prototype/cloud_print_request.h" 5 #include "cloud_print/gcp20/prototype/cloud_print_request.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility>
8 9
9 #include "base/bind.h" 10 #include "base/bind.h"
10 #include "base/command_line.h" 11 #include "base/command_line.h"
11 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
12 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
13 #include "base/time/time.h" 14 #include "base/time/time.h"
14 #include "net/base/load_flags.h" 15 #include "net/base/load_flags.h"
15 #include "net/http/http_status_code.h" 16 #include "net/http/http_status_code.h"
16 #include "net/url_request/url_request_context.h" 17 #include "net/url_request/url_request_context.h"
17 #include "net/url_request/url_request_context_getter.h" 18 #include "net/url_request/url_request_context_getter.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 50 }
50 51
51 scoped_ptr<CloudPrintRequest> CloudPrintRequest::CreatePost( 52 scoped_ptr<CloudPrintRequest> CloudPrintRequest::CreatePost(
52 const GURL& url, 53 const GURL& url,
53 const std::string& content, 54 const std::string& content,
54 const std::string& mimetype, 55 const std::string& mimetype,
55 Delegate* delegate) { 56 Delegate* delegate) {
56 scoped_ptr<CloudPrintRequest> request( 57 scoped_ptr<CloudPrintRequest> request(
57 new CloudPrintRequest(url, URLFetcher::POST, delegate)); 58 new CloudPrintRequest(url, URLFetcher::POST, delegate));
58 request->fetcher_->SetUploadData(mimetype, content); 59 request->fetcher_->SetUploadData(mimetype, content);
59 return request.Pass(); 60 return std::move(request);
60 } 61 }
61 62
62 void CloudPrintRequest::Run( 63 void CloudPrintRequest::Run(
63 const std::string& access_token, 64 const std::string& access_token,
64 scoped_refptr<net::URLRequestContextGetter> context_getter) { 65 scoped_refptr<net::URLRequestContextGetter> context_getter) {
65 if (!access_token.empty()) 66 if (!access_token.empty())
66 fetcher_->AddExtraRequestHeader(base::StringPrintf( 67 fetcher_->AddExtraRequestHeader(base::StringPrintf(
67 "Authorization: Bearer \"%s\"", access_token.c_str())); 68 "Authorization: Bearer \"%s\"", access_token.c_str()));
68 69
69 fetcher_->SetRequestContext(context_getter.get()); 70 fetcher_->SetRequestContext(context_getter.get());
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // TODO(maksymb): Add Privet |server_http_code| and |server_api| support in 111 // TODO(maksymb): Add Privet |server_http_code| and |server_api| support in
111 // case of server errors. 112 // case of server errors.
112 NOTIMPLEMENTED() << "HTTP code: " << http_code; 113 NOTIMPLEMENTED() << "HTTP code: " << http_code;
113 delegate_->OnFetchError("dummy", -1, http_code); // After this object can 114 delegate_->OnFetchError("dummy", -1, http_code); // After this object can
114 // be deleted. 115 // be deleted.
115 // Do *NOT* access members 116 // Do *NOT* access members
116 // after this call. 117 // after this call.
117 } 118 }
118 } 119 }
119 120
OLDNEW
« no previous file with comments | « base/feature_list_unittest.cc ('k') | cloud_print/gcp20/prototype/cloud_print_requester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698