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

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

Issue 513503002: Remove implicit conversions from scoped_refptr to T* in cloud_print/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | cloud_print/gcp20/prototype/cloud_print_url_request_context_getter.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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return request.Pass(); 57 return request.Pass();
58 } 58 }
59 59
60 void CloudPrintRequest::Run( 60 void CloudPrintRequest::Run(
61 const std::string& access_token, 61 const std::string& access_token,
62 scoped_refptr<net::URLRequestContextGetter> context_getter) { 62 scoped_refptr<net::URLRequestContextGetter> context_getter) {
63 if (!access_token.empty()) 63 if (!access_token.empty())
64 fetcher_->AddExtraRequestHeader(base::StringPrintf( 64 fetcher_->AddExtraRequestHeader(base::StringPrintf(
65 "Authorization: Bearer \"%s\"", access_token.c_str())); 65 "Authorization: Bearer \"%s\"", access_token.c_str()));
66 66
67 fetcher_->SetRequestContext(context_getter); 67 fetcher_->SetRequestContext(context_getter.get());
68 fetcher_->Start(); 68 fetcher_->Start();
69 69
70 MessageLoop::current()->PostDelayedTask( 70 MessageLoop::current()->PostDelayedTask(
71 FROM_HERE, 71 FROM_HERE,
72 base::Bind(&CloudPrintRequest::OnRequestTimeout, AsWeakPtr()), 72 base::Bind(&CloudPrintRequest::OnRequestTimeout, AsWeakPtr()),
73 base::TimeDelta::FromSeconds(kDefaultTimeout)); 73 base::TimeDelta::FromSeconds(kDefaultTimeout));
74 } 74 }
75 75
76 void CloudPrintRequest::AddHeader(const std::string& header) { 76 void CloudPrintRequest::AddHeader(const std::string& header) {
77 fetcher_->AddExtraRequestHeader(header); 77 fetcher_->AddExtraRequestHeader(header);
(...skipping 30 matching lines...) Expand all
108 // TODO(maksymb): Add Privet |server_http_code| and |server_api| support in 108 // TODO(maksymb): Add Privet |server_http_code| and |server_api| support in
109 // case of server errors. 109 // case of server errors.
110 NOTIMPLEMENTED() << "HTTP code: " << http_code; 110 NOTIMPLEMENTED() << "HTTP code: " << http_code;
111 delegate_->OnFetchError("dummy", -1, http_code); // After this object can 111 delegate_->OnFetchError("dummy", -1, http_code); // After this object can
112 // be deleted. 112 // be deleted.
113 // Do *NOT* access members 113 // Do *NOT* access members
114 // after this call. 114 // after this call.
115 } 115 }
116 } 116 }
117 117
OLDNEW
« no previous file with comments | « no previous file | cloud_print/gcp20/prototype/cloud_print_url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698