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

Side by Side Diff: remoting/host/setup/service_client.cc

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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 | « remoting/host/dns_blackhole_checker.cc ('k') | remoting/protocol/chromium_port_allocator.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 "remoting/host/setup/service_client.h" 5 #include "remoting/host/setup/service_client.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 delegate); 104 delegate);
105 } 105 }
106 106
107 void ServiceClient::Core::MakeChromotingRequest( 107 void ServiceClient::Core::MakeChromotingRequest(
108 net::URLFetcher::RequestType request_type, 108 net::URLFetcher::RequestType request_type,
109 const std::string& url_suffix, 109 const std::string& url_suffix,
110 const std::string& request_body, 110 const std::string& request_body,
111 const std::string& oauth_access_token, 111 const std::string& oauth_access_token,
112 ServiceClient::Delegate* delegate) { 112 ServiceClient::Delegate* delegate) {
113 delegate_ = delegate; 113 delegate_ = delegate;
114 request_.reset(net::URLFetcher::Create( 114 request_ = net::URLFetcher::Create(
115 0, GURL(chromoting_hosts_url_ + url_suffix), request_type, this)); 115 0, GURL(chromoting_hosts_url_ + url_suffix), request_type, this);
116 request_->SetRequestContext(request_context_getter_.get()); 116 request_->SetRequestContext(request_context_getter_.get());
117 request_->SetUploadData("application/json; charset=UTF-8", request_body); 117 request_->SetUploadData("application/json; charset=UTF-8", request_body);
118 request_->AddExtraRequestHeader("Authorization: OAuth " + oauth_access_token); 118 request_->AddExtraRequestHeader("Authorization: OAuth " + oauth_access_token);
119 request_->Start(); 119 request_->Start();
120 } 120 }
121 121
122 // URLFetcher::Delegate implementation. 122 // URLFetcher::Delegate implementation.
123 void ServiceClient::Core::OnURLFetchComplete( 123 void ServiceClient::Core::OnURLFetchComplete(
124 const net::URLFetcher* source) { 124 const net::URLFetcher* source) {
125 HandleResponse(source); 125 HandleResponse(source);
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 187 }
188 188
189 void ServiceClient::UnregisterHost( 189 void ServiceClient::UnregisterHost(
190 const std::string& host_id, 190 const std::string& host_id,
191 const std::string& oauth_access_token, 191 const std::string& oauth_access_token,
192 Delegate* delegate) { 192 Delegate* delegate) {
193 return core_->UnregisterHost(host_id, oauth_access_token, delegate); 193 return core_->UnregisterHost(host_id, oauth_access_token, delegate);
194 } 194 }
195 195
196 } // namespace gaia 196 } // namespace gaia
OLDNEW
« no previous file with comments | « remoting/host/dns_blackhole_checker.cc ('k') | remoting/protocol/chromium_port_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698