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

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

Issue 1301333002: make ProxyService::CreateSystemProxyConfigService return scoped_ptrs NOT FOR REVIEW (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: try merging again... Created 5 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
« no previous file with comments | « net/proxy/proxy_service_mojo.h ('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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/thread_task_runner_handle.h" 9 #include "base/thread_task_runner_handle.h"
10 #include "net/dns/mojo_host_resolver_impl.h" 10 #include "net/dns/mojo_host_resolver_impl.h"
11 #include "net/interfaces/proxy_resolver_service.mojom.h" 11 #include "net/interfaces/proxy_resolver_service.mojom.h"
12 #include "net/proxy/in_process_mojo_proxy_resolver_factory.h" 12 #include "net/proxy/in_process_mojo_proxy_resolver_factory.h"
13 #include "net/proxy/mojo_proxy_resolver_factory.h" 13 #include "net/proxy/mojo_proxy_resolver_factory.h"
14 #include "net/proxy/mojo_proxy_resolver_impl.h" 14 #include "net/proxy/mojo_proxy_resolver_impl.h"
15 #include "net/proxy/network_delegate_error_observer.h" 15 #include "net/proxy/network_delegate_error_observer.h"
16 #include "net/proxy/proxy_resolver_factory.h" 16 #include "net/proxy/proxy_resolver_factory.h"
17 #include "net/proxy/proxy_resolver_factory_mojo.h" 17 #include "net/proxy/proxy_resolver_factory_mojo.h"
18 #include "net/proxy/proxy_resolver_v8_tracing.h" 18 #include "net/proxy/proxy_resolver_v8_tracing.h"
19 #include "net/proxy/proxy_service.h" 19 #include "net/proxy/proxy_service.h"
20 20
21 namespace net { 21 namespace net {
22 22
23 scoped_ptr<ProxyService> CreateProxyServiceUsingMojoFactory( 23 scoped_ptr<ProxyService> CreateProxyServiceUsingMojoFactory(
24 MojoProxyResolverFactory* mojo_proxy_factory, 24 MojoProxyResolverFactory* mojo_proxy_factory,
25 ProxyConfigService* proxy_config_service, 25 scoped_ptr<ProxyConfigService> proxy_config_service,
26 ProxyScriptFetcher* proxy_script_fetcher, 26 ProxyScriptFetcher* proxy_script_fetcher,
27 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher, 27 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher,
28 HostResolver* host_resolver, 28 HostResolver* host_resolver,
29 NetLog* net_log, 29 NetLog* net_log,
30 NetworkDelegate* network_delegate) { 30 NetworkDelegate* network_delegate) {
31 DCHECK(proxy_config_service); 31 DCHECK(proxy_config_service);
32 DCHECK(proxy_script_fetcher); 32 DCHECK(proxy_script_fetcher);
33 DCHECK(dhcp_proxy_script_fetcher); 33 DCHECK(dhcp_proxy_script_fetcher);
34 DCHECK(host_resolver); 34 DCHECK(host_resolver);
35 35
36 scoped_ptr<ProxyService> proxy_service(new ProxyService( 36 scoped_ptr<ProxyService> proxy_service(new ProxyService(
37 proxy_config_service, 37 proxy_config_service.Pass(),
38 make_scoped_ptr(new ProxyResolverFactoryMojo( 38 make_scoped_ptr(new ProxyResolverFactoryMojo(
39 mojo_proxy_factory, host_resolver, 39 mojo_proxy_factory, host_resolver,
40 base::Bind(&NetworkDelegateErrorObserver::Create, network_delegate, 40 base::Bind(&NetworkDelegateErrorObserver::Create, network_delegate,
41 base::ThreadTaskRunnerHandle::Get()), 41 base::ThreadTaskRunnerHandle::Get()),
42 net_log)), 42 net_log)),
43 net_log)); 43 net_log));
44 44
45 // Configure fetchers to use for PAC script downloads and auto-detect. 45 // Configure fetchers to use for PAC script downloads and auto-detect.
46 proxy_service->SetProxyScriptFetchers(proxy_script_fetcher, 46 proxy_service->SetProxyScriptFetchers(proxy_script_fetcher,
47 dhcp_proxy_script_fetcher); 47 dhcp_proxy_script_fetcher);
48 48
49 return proxy_service; 49 return proxy_service;
50 } 50 }
51 51
52 scoped_ptr<ProxyService> CreateProxyServiceUsingMojoInProcess( 52 scoped_ptr<ProxyService> CreateProxyServiceUsingMojoInProcess(
53 ProxyConfigService* proxy_config_service, 53 scoped_ptr<ProxyConfigService> proxy_config_service,
54 ProxyScriptFetcher* proxy_script_fetcher, 54 ProxyScriptFetcher* proxy_script_fetcher,
55 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher, 55 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher,
56 HostResolver* host_resolver, 56 HostResolver* host_resolver,
57 NetLog* net_log, 57 NetLog* net_log,
58 NetworkDelegate* network_delegate) { 58 NetworkDelegate* network_delegate) {
59 return CreateProxyServiceUsingMojoFactory( 59 return CreateProxyServiceUsingMojoFactory(
60 InProcessMojoProxyResolverFactory::GetInstance(), proxy_config_service, 60 InProcessMojoProxyResolverFactory::GetInstance(),
61 proxy_script_fetcher, dhcp_proxy_script_fetcher, host_resolver, net_log, 61 proxy_config_service.Pass(), proxy_script_fetcher,
62 network_delegate); 62 dhcp_proxy_script_fetcher, host_resolver, net_log, network_delegate);
63 } 63 }
64 64
65 } // namespace net 65 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_service_mojo.h ('k') | net/proxy/proxy_service_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698