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

Side by Side Diff: net/proxy/proxy_service_mojo.cc

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 | « net/proxy/proxy_service.cc ('k') | net/proxy/proxy_service_mojo_unittest.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 "net/proxy/proxy_service_mojo.h" 5 #include "net/proxy/proxy_service_mojo.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 20 matching lines...) Expand all
31 HostResolver* host_resolver, 31 HostResolver* host_resolver,
32 NetLog* net_log, 32 NetLog* net_log,
33 NetworkDelegate* network_delegate) { 33 NetworkDelegate* network_delegate) {
34 DCHECK(proxy_config_service); 34 DCHECK(proxy_config_service);
35 DCHECK(proxy_script_fetcher); 35 DCHECK(proxy_script_fetcher);
36 DCHECK(dhcp_proxy_script_fetcher); 36 DCHECK(dhcp_proxy_script_fetcher);
37 DCHECK(host_resolver); 37 DCHECK(host_resolver);
38 38
39 std::unique_ptr<ProxyService> proxy_service(new ProxyService( 39 std::unique_ptr<ProxyService> proxy_service(new ProxyService(
40 std::move(proxy_config_service), 40 std::move(proxy_config_service),
41 base::WrapUnique(new ProxyResolverFactoryMojo( 41 base::MakeUnique<ProxyResolverFactoryMojo>(
42 mojo_proxy_factory, host_resolver, 42 mojo_proxy_factory, host_resolver,
43 base::Bind(&NetworkDelegateErrorObserver::Create, network_delegate, 43 base::Bind(&NetworkDelegateErrorObserver::Create, network_delegate,
44 base::ThreadTaskRunnerHandle::Get()), 44 base::ThreadTaskRunnerHandle::Get()),
45 net_log)), 45 net_log),
46 net_log)); 46 net_log));
47 47
48 // Configure fetchers to use for PAC script downloads and auto-detect. 48 // Configure fetchers to use for PAC script downloads and auto-detect.
49 proxy_service->SetProxyScriptFetchers(proxy_script_fetcher, 49 proxy_service->SetProxyScriptFetchers(proxy_script_fetcher,
50 std::move(dhcp_proxy_script_fetcher)); 50 std::move(dhcp_proxy_script_fetcher));
51 51
52 return proxy_service; 52 return proxy_service;
53 } 53 }
54 54
55 std::unique_ptr<ProxyService> CreateProxyServiceUsingMojoInProcess( 55 std::unique_ptr<ProxyService> CreateProxyServiceUsingMojoInProcess(
56 std::unique_ptr<ProxyConfigService> proxy_config_service, 56 std::unique_ptr<ProxyConfigService> proxy_config_service,
57 ProxyScriptFetcher* proxy_script_fetcher, 57 ProxyScriptFetcher* proxy_script_fetcher,
58 std::unique_ptr<DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher, 58 std::unique_ptr<DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher,
59 HostResolver* host_resolver, 59 HostResolver* host_resolver,
60 NetLog* net_log, 60 NetLog* net_log,
61 NetworkDelegate* network_delegate) { 61 NetworkDelegate* network_delegate) {
62 return CreateProxyServiceUsingMojoFactory( 62 return CreateProxyServiceUsingMojoFactory(
63 InProcessMojoProxyResolverFactory::GetInstance(), 63 InProcessMojoProxyResolverFactory::GetInstance(),
64 std::move(proxy_config_service), proxy_script_fetcher, 64 std::move(proxy_config_service), proxy_script_fetcher,
65 std::move(dhcp_proxy_script_fetcher), host_resolver, net_log, 65 std::move(dhcp_proxy_script_fetcher), host_resolver, net_log,
66 network_delegate); 66 network_delegate);
67 } 67 }
68 68
69 } // namespace net 69 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_service.cc ('k') | net/proxy/proxy_service_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698