Upload upstream chromium 108.0.5359.1
[platform/framework/web/chromium-efl.git] / services / proxy_resolver / proxy_resolver_impl.h
1 // Copyright 2015 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SERVICES_PROXY_RESOLVER_PROXY_RESOLVER_IMPL_H_
6 #define SERVICES_PROXY_RESOLVER_PROXY_RESOLVER_IMPL_H_
7
8 #include <map>
9 #include <memory>
10
11 #include "base/memory/ref_counted.h"
12 #include "net/proxy_resolution/proxy_resolver.h"
13 #include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
14
15 namespace proxy_resolver {
16
17 class ProxyResolverV8Tracing;
18
19 class ProxyResolverImpl : public mojom::ProxyResolver {
20  public:
21   explicit ProxyResolverImpl(std::unique_ptr<ProxyResolverV8Tracing> resolver);
22
23   ProxyResolverImpl(const ProxyResolverImpl&) = delete;
24   ProxyResolverImpl& operator=(const ProxyResolverImpl&) = delete;
25
26   ~ProxyResolverImpl() override;
27
28  private:
29   class Job;
30
31   // mojom::ProxyResolver overrides.
32   void GetProxyForUrl(
33       const GURL& url,
34       const net::NetworkAnonymizationKey& network_anonymization_key,
35       mojo::PendingRemote<mojom::ProxyResolverRequestClient> client) override;
36
37   void DeleteJob(Job* job);
38
39   std::unique_ptr<ProxyResolverV8Tracing> resolver_;
40   std::map<Job*, std::unique_ptr<Job>> resolve_jobs_;
41 };
42
43 }  // namespace proxy_resolver
44
45 #endif  // SERVICES_PROXY_RESOLVER_PROXY_RESOLVER_IMPL_H_