proxy_host_resolver.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright 2019 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_PROXY_RESOLVER_PROXY_HOST_RESOLVER_H_
  5. #define SERVICES_PROXY_RESOLVER_PROXY_HOST_RESOLVER_H_
  6. #include <memory>
  7. #include <string>
  8. #include <vector>
  9. #include "net/base/completion_once_callback.h"
  10. #include "net/base/ip_address.h"
  11. #include "net/proxy_resolution/proxy_resolve_dns_operation.h"
  12. namespace net {
  13. class NetworkIsolationKey;
  14. } // namespace net
  15. namespace proxy_resolver {
  16. // Interface for a limited (compared to the standard HostResolver) host resolver
  17. // used just for proxy resolution.
  18. class ProxyHostResolver {
  19. public:
  20. virtual ~ProxyHostResolver() {}
  21. class Request {
  22. public:
  23. virtual ~Request() {}
  24. virtual int Start(net::CompletionOnceCallback callback) = 0;
  25. virtual const std::vector<net::IPAddress>& GetResults() const = 0;
  26. };
  27. virtual std::unique_ptr<Request> CreateRequest(
  28. const std::string& hostname,
  29. net::ProxyResolveDnsOperation operation,
  30. const net::NetworkIsolationKey& network_isolation_key) = 0;
  31. };
  32. } // namespace proxy_resolver
  33. #endif // SERVICES_PROXY_RESOLVER_PROXY_HOST_RESOLVER_H_