OLD | NEW |
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 "ios/chrome/browser/net/proxy_service_factory.h" | 5 #include "ios/chrome/browser/net/proxy_service_factory.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "components/proxy_config/pref_proxy_config_tracker_impl.h" | 9 #include "components/proxy_config/pref_proxy_config_tracker_impl.h" |
8 #include "ios/web/public/web_thread.h" | 10 #include "ios/web/public/web_thread.h" |
9 #include "net/proxy/proxy_config_service.h" | 11 #include "net/proxy/proxy_config_service.h" |
10 #include "net/proxy/proxy_service.h" | 12 #include "net/proxy/proxy_service.h" |
11 | 13 |
12 namespace ios { | 14 namespace ios { |
13 | 15 |
14 // static | 16 // static |
15 scoped_ptr<net::ProxyConfigService> | 17 scoped_ptr<net::ProxyConfigService> |
16 ProxyServiceFactory::CreateProxyConfigService(PrefProxyConfigTracker* tracker) { | 18 ProxyServiceFactory::CreateProxyConfigService(PrefProxyConfigTracker* tracker) { |
17 scoped_ptr<net::ProxyConfigService> base_service( | 19 scoped_ptr<net::ProxyConfigService> base_service( |
18 net::ProxyService::CreateSystemProxyConfigService( | 20 net::ProxyService::CreateSystemProxyConfigService( |
19 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO), | 21 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO), |
20 web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE))); | 22 web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE))); |
21 return tracker->CreateTrackingProxyConfigService(base_service.Pass()).Pass(); | 23 return tracker->CreateTrackingProxyConfigService(std::move(base_service)); |
22 } | 24 } |
23 | 25 |
24 // static | 26 // static |
25 scoped_ptr<PrefProxyConfigTracker> | 27 scoped_ptr<PrefProxyConfigTracker> |
26 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 28 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
27 PrefService* browser_state_prefs, | 29 PrefService* browser_state_prefs, |
28 PrefService* local_state_prefs) { | 30 PrefService* local_state_prefs) { |
29 return make_scoped_ptr(new PrefProxyConfigTrackerImpl( | 31 return make_scoped_ptr(new PrefProxyConfigTrackerImpl( |
30 browser_state_prefs, | 32 browser_state_prefs, |
31 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO))); | 33 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO))); |
(...skipping 11 matching lines...) Expand all Loading... |
43 // static | 45 // static |
44 scoped_ptr<net::ProxyService> ProxyServiceFactory::CreateProxyService( | 46 scoped_ptr<net::ProxyService> ProxyServiceFactory::CreateProxyService( |
45 net::NetLog* net_log, | 47 net::NetLog* net_log, |
46 net::URLRequestContext* context, | 48 net::URLRequestContext* context, |
47 net::NetworkDelegate* network_delegate, | 49 net::NetworkDelegate* network_delegate, |
48 scoped_ptr<net::ProxyConfigService> proxy_config_service, | 50 scoped_ptr<net::ProxyConfigService> proxy_config_service, |
49 bool quick_check_enabled) { | 51 bool quick_check_enabled) { |
50 DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); | 52 DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); |
51 scoped_ptr<net::ProxyService> proxy_service( | 53 scoped_ptr<net::ProxyService> proxy_service( |
52 net::ProxyService::CreateUsingSystemProxyResolver( | 54 net::ProxyService::CreateUsingSystemProxyResolver( |
53 proxy_config_service.Pass(), 0, net_log)); | 55 std::move(proxy_config_service), 0, net_log)); |
54 proxy_service->set_quick_check_enabled(quick_check_enabled); | 56 proxy_service->set_quick_check_enabled(quick_check_enabled); |
55 return proxy_service.Pass(); | 57 return proxy_service; |
56 } | 58 } |
57 | 59 |
58 } // namespace ios | 60 } // namespace ios |
OLD | NEW |