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
3 // found in the LICENSE file.
5 #ifndef NET_PROXY_PROXY_SERVICE_MOJO_H_
6 #define NET_PROXY_PROXY_SERVICE_MOJO_H_
8 #include "base/basictypes.h"
12 class DhcpProxyScriptFetcher
;
14 class MojoProxyResolverFactory
;
16 class NetworkDelegate
;
17 class ProxyConfigService
;
18 class ProxyScriptFetcher
;
21 // Creates a proxy service that uses |mojo_proxy_factory| to create and connect
22 // to a Mojo proxy resolver service. This proxy service polls
23 // |proxy_config_service| to notice when the proxy settings change. We take
24 // ownership of |proxy_config_service|.
26 // |proxy_script_fetcher| specifies the dependency to use for downloading
27 // any PAC scripts. The resulting ProxyService will take ownership of it.
29 // |dhcp_proxy_script_fetcher| specifies the dependency to use for attempting
30 // to retrieve the most appropriate PAC script configured in DHCP. The
31 // resulting ProxyService will take ownership of it.
33 // |host_resolver| points to the host resolving dependency the PAC script
34 // should use for any DNS queries. It must remain valid throughout the
35 // lifetime of the ProxyService.
36 ProxyService
* CreateProxyServiceUsingMojoFactory(
37 MojoProxyResolverFactory
* mojo_proxy_factory
,
38 ProxyConfigService
* proxy_config_service
,
39 ProxyScriptFetcher
* proxy_script_fetcher
,
40 DhcpProxyScriptFetcher
* dhcp_proxy_script_fetcher
,
41 HostResolver
* host_resolver
,
43 NetworkDelegate
* network_delegate
);
45 // Creates a proxy service that connects to an in-process Mojo proxy resolver
46 // service. See above for information about other arguments.
48 // ##########################################################################
49 // # See the warnings in net/proxy/proxy_resolver_v8.h describing the
50 // # multi-threading model. In order for this to be safe to use, *ALL* the
51 // # other V8's running in the process must use v8::Locker.
52 // ##########################################################################
53 ProxyService
* CreateProxyServiceUsingMojoInProcess(
54 ProxyConfigService
* proxy_config_service
,
55 ProxyScriptFetcher
* proxy_script_fetcher
,
56 DhcpProxyScriptFetcher
* dhcp_proxy_script_fetcher
,
57 HostResolver
* host_resolver
,
59 NetworkDelegate
* network_delegate
);
63 #endif // NET_PROXY_PROXY_SERVICE_MOJO_H_