diff options
author | dtapuska <dtapuska@chromium.org> | 2015-05-01 06:58:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-01 14:26:21 +0000 |
commit | dafcf89b36898f4f4afc010824879290b9e51e3a (patch) | |
tree | 37abdef8dfe04288c9401a0baf04be28f9118ab4 /remoting | |
parent | f75b259d8c304678fe77867b9ca01e9a9e6a202a (diff) | |
download | chromium_src-dafcf89b36898f4f4afc010824879290b9e51e3a.zip chromium_src-dafcf89b36898f4f4afc010824879290b9e51e3a.tar.gz chromium_src-dafcf89b36898f4f4afc010824879290b9e51e3a.tar.bz2 |
Adjust URLFetcher::Create API so that object is returned as scoped_ptr.
Most interfaces were storing the object in a scoped_ptr already. This
adjusts the API so that it is a little clearer of the ownership
transfer.
A number of clients put the URLFetcher in a table and do memory
management on it themselves; this is likely templatable code
for a future CL. The scope of this CL was to change the API but
no control flow changes. Making this change found one memory leak;
(http://crbug.com/482459) has been addressed separately.
BUG=371201
TESTS=net_unittests google_api_unittests
TBR=jochen@chromium.org, thakis@chromium.org, oshima@chromium.org, armansito@chromium.org, reillyg@chromium.org, rogerta@chromium.org, stuartmorgan@chromium.org, wez@chromium.org, pavely@chromium.org, rouslan@chromium.org
Review URL: https://codereview.chromium.org/1117703002
Cr-Commit-Position: refs/heads/master@{#327901}
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/dns_blackhole_checker.cc | 4 | ||||
-rw-r--r-- | remoting/host/setup/service_client.cc | 4 | ||||
-rw-r--r-- | remoting/protocol/chromium_port_allocator.cc | 4 | ||||
-rw-r--r-- | remoting/test/remote_host_info_fetcher.cc | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/remoting/host/dns_blackhole_checker.cc b/remoting/host/dns_blackhole_checker.cc index b92eb12..1f71ad52 100644 --- a/remoting/host/dns_blackhole_checker.cc +++ b/remoting/host/dns_blackhole_checker.cc @@ -58,8 +58,8 @@ void DnsBlackholeChecker::CheckForDnsBlackhole( } talkgadget_url += kTalkGadgetUrl; HOST_LOG << "Verifying connection to " << talkgadget_url; - url_fetcher_.reset(net::URLFetcher::Create(GURL(talkgadget_url), - net::URLFetcher::GET, this)); + url_fetcher_ = net::URLFetcher::Create(GURL(talkgadget_url), + net::URLFetcher::GET, this); url_fetcher_->SetRequestContext(url_request_context_getter_.get()); url_fetcher_->Start(); } else { diff --git a/remoting/host/setup/service_client.cc b/remoting/host/setup/service_client.cc index 9ea1d52..260f762 100644 --- a/remoting/host/setup/service_client.cc +++ b/remoting/host/setup/service_client.cc @@ -111,8 +111,8 @@ void ServiceClient::Core::MakeChromotingRequest( const std::string& oauth_access_token, ServiceClient::Delegate* delegate) { delegate_ = delegate; - request_.reset(net::URLFetcher::Create( - 0, GURL(chromoting_hosts_url_ + url_suffix), request_type, this)); + request_ = net::URLFetcher::Create( + 0, GURL(chromoting_hosts_url_ + url_suffix), request_type, this); request_->SetRequestContext(request_context_getter_.get()); request_->SetUploadData("application/json; charset=UTF-8", request_body); request_->AddExtraRequestHeader("Authorization: OAuth " + oauth_access_token); diff --git a/remoting/protocol/chromium_port_allocator.cc b/remoting/protocol/chromium_port_allocator.cc index fb8a3e0..ffe6756 100644 --- a/remoting/protocol/chromium_port_allocator.cc +++ b/remoting/protocol/chromium_port_allocator.cc @@ -97,8 +97,8 @@ void ChromiumPortAllocatorSession::SendSessionRequest( int port) { GURL url("https://" + host + ":" + base::IntToString(port) + GetSessionRequestUrl() + "&sn=1"); - scoped_ptr<net::URLFetcher> url_fetcher( - net::URLFetcher::Create(url, net::URLFetcher::GET, this)); + scoped_ptr<net::URLFetcher> url_fetcher = + net::URLFetcher::Create(url, net::URLFetcher::GET, this); url_fetcher->SetRequestContext(url_context_.get()); url_fetcher->AddExtraRequestHeader("X-Talk-Google-Relay-Auth: " + relay_token()); diff --git a/remoting/test/remote_host_info_fetcher.cc b/remoting/test/remote_host_info_fetcher.cc index e386bf8..2f9e6a2 100644 --- a/remoting/test/remote_host_info_fetcher.cc +++ b/remoting/test/remote_host_info_fetcher.cc @@ -69,8 +69,8 @@ bool RemoteHostInfoFetcher::RetrieveRemoteHostInfo( base::ThreadTaskRunnerHandle::Get(), // network_runner base::ThreadTaskRunnerHandle::Get()); // file_runner - request_.reset( - net::URLFetcher::Create(GURL(service_url), net::URLFetcher::POST, this)); + request_ = + net::URLFetcher::Create(GURL(service_url), net::URLFetcher::POST, this); request_->SetRequestContext(request_context_getter_.get()); request_->AddExtraRequestHeader("Authorization: OAuth " + access_token); request_->AddExtraRequestHeader(kRequestTestOrigin); |