1 // Copyright (c) 2012 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_V8_H_
6 #define NET_PROXY_PROXY_SERVICE_V8_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "net/base/net_export.h"
11 #include "net/proxy/dhcp_proxy_script_fetcher.h"
17 class NetworkDelegate
;
18 class ProxyConfigService
;
19 class ProxyScriptFetcher
;
22 // Creates a proxy service that polls |proxy_config_service| to notice when
23 // the proxy settings change. We take ownership of |proxy_config_service|.
25 // |proxy_script_fetcher| specifies the dependency to use for downloading
26 // any PAC scripts. The resulting ProxyService will take ownership of it.
28 // |dhcp_proxy_script_fetcher| specifies the dependency to use for attempting
29 // to retrieve the most appropriate PAC script configured in DHCP.
31 // |host_resolver| points to the host resolving dependency the PAC script
32 // should use for any DNS queries. It must remain valid throughout the
33 // lifetime of the ProxyService.
35 // ##########################################################################
36 // # See the warnings in net/proxy/proxy_resolver_v8.h describing the
37 // # multi-threading model. In order for this to be safe to use, *ALL* the
38 // # other V8's running in the process must use v8::Locker.
39 // ##########################################################################
40 NET_EXPORT ProxyService
* CreateProxyServiceUsingV8ProxyResolver(
41 ProxyConfigService
* proxy_config_service
,
42 ProxyScriptFetcher
* proxy_script_fetcher
,
43 scoped_ptr
<DhcpProxyScriptFetcher
> dhcp_proxy_script_fetcher
,
44 HostResolver
* host_resolver
,
46 NetworkDelegate
* network_delegate
);
50 #endif // NET_PROXY_PROXY_SERVICE_V8_H_