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

Side by Side Diff: ios/chrome/browser/net/proxy_service_factory.cc

Issue 2256193002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 "ios/chrome/browser/net/proxy_service_factory.h" 5 #include "ios/chrome/browser/net/proxy_service_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "components/proxy_config/pref_proxy_config_tracker_impl.h" 10 #include "components/proxy_config/pref_proxy_config_tracker_impl.h"
(...skipping 11 matching lines...) Expand all
22 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO), 22 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO),
23 web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE))); 23 web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE)));
24 return tracker->CreateTrackingProxyConfigService(std::move(base_service)); 24 return tracker->CreateTrackingProxyConfigService(std::move(base_service));
25 } 25 }
26 26
27 // static 27 // static
28 std::unique_ptr<PrefProxyConfigTracker> 28 std::unique_ptr<PrefProxyConfigTracker>
29 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 29 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
30 PrefService* browser_state_prefs, 30 PrefService* browser_state_prefs,
31 PrefService* local_state_prefs) { 31 PrefService* local_state_prefs) {
32 return base::WrapUnique(new PrefProxyConfigTrackerImpl( 32 return base::MakeUnique<PrefProxyConfigTrackerImpl>(
33 browser_state_prefs, 33 browser_state_prefs,
34 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO))); 34 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO));
35 } 35 }
36 36
37 // static 37 // static
38 std::unique_ptr<PrefProxyConfigTracker> 38 std::unique_ptr<PrefProxyConfigTracker>
39 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 39 ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
40 PrefService* local_state_prefs) { 40 PrefService* local_state_prefs) {
41 return base::WrapUnique(new PrefProxyConfigTrackerImpl( 41 return base::MakeUnique<PrefProxyConfigTrackerImpl>(
42 local_state_prefs, 42 local_state_prefs,
43 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO))); 43 web::WebThread::GetTaskRunnerForThread(web::WebThread::IO));
44 } 44 }
45 45
46 // static 46 // static
47 std::unique_ptr<net::ProxyService> ProxyServiceFactory::CreateProxyService( 47 std::unique_ptr<net::ProxyService> ProxyServiceFactory::CreateProxyService(
48 net::NetLog* net_log, 48 net::NetLog* net_log,
49 net::URLRequestContext* context, 49 net::URLRequestContext* context,
50 net::NetworkDelegate* network_delegate, 50 net::NetworkDelegate* network_delegate,
51 std::unique_ptr<net::ProxyConfigService> proxy_config_service, 51 std::unique_ptr<net::ProxyConfigService> proxy_config_service,
52 bool quick_check_enabled) { 52 bool quick_check_enabled) {
53 DCHECK_CURRENTLY_ON(web::WebThread::IO); 53 DCHECK_CURRENTLY_ON(web::WebThread::IO);
54 std::unique_ptr<net::ProxyService> proxy_service( 54 std::unique_ptr<net::ProxyService> proxy_service(
55 net::ProxyService::CreateUsingSystemProxyResolver( 55 net::ProxyService::CreateUsingSystemProxyResolver(
56 std::move(proxy_config_service), 0, net_log)); 56 std::move(proxy_config_service), 0, net_log));
57 proxy_service->set_quick_check_enabled(quick_check_enabled); 57 proxy_service->set_quick_check_enabled(quick_check_enabled);
58 return proxy_service; 58 return proxy_service;
59 } 59 }
60 60
61 } // namespace ios 61 } // namespace ios
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698