15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef NET_PROXY_PROXY_SERVICE_V8_H_
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define NET_PROXY_PROXY_SERVICE_V8_H_
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h"
95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "net/base/net_export.h"
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace net {
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class DhcpProxyScriptFetcher;
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class HostResolver;
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class NetLog;
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class NetworkDelegate;
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ProxyConfigService;
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ProxyScriptFetcher;
195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ProxyService;
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Creates a proxy service that polls |proxy_config_service| to notice when
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// the proxy settings change. We take ownership of |proxy_config_service|.
235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// |proxy_script_fetcher| specifies the dependency to use for downloading
255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// any PAC scripts. The resulting ProxyService will take ownership of it.
265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// |dhcp_proxy_script_fetcher| specifies the dependency to use for attempting
285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// to retrieve the most appropriate PAC script configured in DHCP. The
295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// resulting ProxyService will take ownership of it.
305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// |host_resolver| points to the host resolving dependency the PAC script
325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// should use for any DNS queries. It must remain valid throughout the
335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// lifetime of the ProxyService.
345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//
355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// ##########################################################################
365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// # See the warnings in net/proxy/proxy_resolver_v8.h describing the
375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// # multi-threading model. In order for this to be safe to use, *ALL* the
385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// # other V8's running in the process must use v8::Locker.
395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// ##########################################################################
405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)NET_EXPORT ProxyService* CreateProxyServiceUsingV8ProxyResolver(
415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    ProxyConfigService* proxy_config_service,
425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    ProxyScriptFetcher* proxy_script_fetcher,
435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher,
445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    HostResolver* host_resolver,
455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    NetLog* net_log,
465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    NetworkDelegate* network_delegate);
475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}  // namespace net
495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif  // NET_PROXY_PROXY_SERVICE_V8_H_
51