proxy_resolver_impl.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_PROXY_RESOLVER_PROXY_RESOLVER_IMPL_H_
  5. #define SERVICES_PROXY_RESOLVER_PROXY_RESOLVER_IMPL_H_
  6. #include <map>
  7. #include <memory>
  8. #include "base/memory/ref_counted.h"
  9. #include "net/proxy_resolution/proxy_resolver.h"
  10. #include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
  11. namespace proxy_resolver {
  12. class ProxyResolverV8Tracing;
  13. class ProxyResolverImpl : public mojom::ProxyResolver {
  14. public:
  15. explicit ProxyResolverImpl(std::unique_ptr<ProxyResolverV8Tracing> resolver);
  16. ProxyResolverImpl(const ProxyResolverImpl&) = delete;
  17. ProxyResolverImpl& operator=(const ProxyResolverImpl&) = delete;
  18. ~ProxyResolverImpl() override;
  19. private:
  20. class Job;
  21. // mojom::ProxyResolver overrides.
  22. void GetProxyForUrl(
  23. const GURL& url,
  24. const net::NetworkIsolationKey& network_isolation_key,
  25. mojo::PendingRemote<mojom::ProxyResolverRequestClient> client) override;
  26. void DeleteJob(Job* job);
  27. std::unique_ptr<ProxyResolverV8Tracing> resolver_;
  28. std::map<Job*, std::unique_ptr<Job>> resolve_jobs_;
  29. };
  30. } // namespace proxy_resolver
  31. #endif // SERVICES_PROXY_RESOLVER_PROXY_RESOLVER_IMPL_H_