proxy_service_mojo.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.
  4. #ifndef SERVICES_NETWORK_PROXY_SERVICE_MOJO_H_
  5. #define SERVICES_NETWORK_PROXY_SERVICE_MOJO_H_
  6. #include <memory>
  7. #include "base/component_export.h"
  8. #include "mojo/public/cpp/bindings/pending_remote.h"
  9. #include "net/proxy_resolution/dhcp_pac_file_fetcher.h"
  10. #include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
  11. namespace net {
  12. class ConfiguredProxyResolutionService;
  13. class HostResolver;
  14. class NetLog;
  15. class NetworkDelegate;
  16. class ProxyConfigService;
  17. class PacFileFetcher;
  18. } // namespace net
  19. namespace network {
  20. // Creates a proxy resolution service that uses |mojo_proxy_factory| to create
  21. // and connect to a Mojo service for evaluating PAC files
  22. // (ProxyResolverFactory). The proxy service observes |proxy_config_service| to
  23. // notice when the proxy settings change.
  24. //
  25. // |pac_file_fetcher| specifies the dependency to use for downloading
  26. // any PAC scripts.
  27. //
  28. // |dhcp_pac_file_fetcher| specifies the dependency to use for attempting
  29. // to retrieve the most appropriate PAC script configured in DHCP.
  30. //
  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 ConfiguredProxyResolutionService.
  34. COMPONENT_EXPORT(NETWORK_SERVICE)
  35. std::unique_ptr<net::ConfiguredProxyResolutionService>
  36. CreateConfiguredProxyResolutionServiceUsingMojoFactory(
  37. mojo::PendingRemote<proxy_resolver::mojom::ProxyResolverFactory>
  38. mojo_proxy_factory,
  39. std::unique_ptr<net::ProxyConfigService> proxy_config_service,
  40. std::unique_ptr<net::PacFileFetcher> pac_file_fetcher,
  41. std::unique_ptr<net::DhcpPacFileFetcher> dhcp_pac_file_fetcher,
  42. net::HostResolver* host_resolver,
  43. net::NetLog* net_log,
  44. bool pac_quick_check_enabled,
  45. net::NetworkDelegate* network_delegate);
  46. } // namespace network
  47. #endif // SERVICES_NETWORK_PROXY_SERVICE_MOJO_H_