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

Side by Side Diff: chromecast/net/connectivity_checker_impl.cc

Issue 1875623002: Convert //chromecast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « chromecast/net/connectivity_checker_impl.h ('k') | chromecast/net/net_util_cast.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chromecast/net/connectivity_checker_impl.h" 5 #include "chromecast/net/connectivity_checker_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
10 #include "chromecast/net/net_switches.h" 11 #include "chromecast/net/net_switches.h"
11 #include "net/base/request_priority.h" 12 #include "net/base/request_priority.h"
12 #include "net/http/http_response_headers.h" 13 #include "net/http/http_response_headers.h"
13 #include "net/http/http_response_info.h" 14 #include "net/http/http_response_info.h"
14 #include "net/http/http_status_code.h" 15 #include "net/http/http_status_code.h"
15 #include "net/proxy/proxy_config.h" 16 #include "net/proxy/proxy_config.h"
16 #include "net/proxy/proxy_config_service_fixed.h" 17 #include "net/proxy/proxy_config_service_fixed.h"
17 #include "net/socket/ssl_client_socket.h" 18 #include "net/socket/ssl_client_socket.h"
18 #include "net/url_request/url_request_context.h" 19 #include "net/url_request/url_request_context.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } 58 }
58 59
59 void ConnectivityCheckerImpl::Initialize() { 60 void ConnectivityCheckerImpl::Initialize() {
60 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); 61 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
61 base::CommandLine::StringType check_url_str = 62 base::CommandLine::StringType check_url_str =
62 command_line->GetSwitchValueNative(switches::kConnectivityCheckUrl); 63 command_line->GetSwitchValueNative(switches::kConnectivityCheckUrl);
63 connectivity_check_url_.reset(new GURL( 64 connectivity_check_url_.reset(new GURL(
64 check_url_str.empty() ? kDefaultConnectivityCheckUrl : check_url_str)); 65 check_url_str.empty() ? kDefaultConnectivityCheckUrl : check_url_str));
65 66
66 net::URLRequestContextBuilder builder; 67 net::URLRequestContextBuilder builder;
67 builder.set_proxy_config_service(make_scoped_ptr( 68 builder.set_proxy_config_service(base::WrapUnique(
68 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect()))); 69 new net::ProxyConfigServiceFixed(net::ProxyConfig::CreateDirect())));
69 builder.DisableHttpCache(); 70 builder.DisableHttpCache();
70 url_request_context_ = builder.Build(); 71 url_request_context_ = builder.Build();
71 72
72 net::NetworkChangeNotifier::AddNetworkChangeObserver(this); 73 net::NetworkChangeNotifier::AddNetworkChangeObserver(this);
73 task_runner_->PostTask(FROM_HERE, 74 task_runner_->PostTask(FROM_HERE,
74 base::Bind(&ConnectivityCheckerImpl::Check, this)); 75 base::Bind(&ConnectivityCheckerImpl::Check, this));
75 } 76 }
76 77
77 ConnectivityCheckerImpl::~ConnectivityCheckerImpl() { 78 ConnectivityCheckerImpl::~ConnectivityCheckerImpl() {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 213
213 void ConnectivityCheckerImpl::Cancel() { 214 void ConnectivityCheckerImpl::Cancel() {
214 if (!url_request_.get()) 215 if (!url_request_.get())
215 return; 216 return;
216 VLOG(2) << "Cancel connectivity check in progress"; 217 VLOG(2) << "Cancel connectivity check in progress";
217 url_request_.reset(nullptr); // URLRequest::Cancel() is called in destructor. 218 url_request_.reset(nullptr); // URLRequest::Cancel() is called in destructor.
218 timeout_.Cancel(); 219 timeout_.Cancel();
219 } 220 }
220 221
221 } // namespace chromecast 222 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/net/connectivity_checker_impl.h ('k') | chromecast/net/net_util_cast.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698