sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 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 | |
| 5 | #ifndef NET_PROXY_MOJO_PROXY_RESOLVER_IMPL_H_ |
| 6 | #define NET_PROXY_MOJO_PROXY_RESOLVER_IMPL_H_ |
| 7 | |
sammc | a83d9e83 | 2015-03-12 03:42:47 | [diff] [blame] | 8 | #include <map> |
sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 9 | #include <queue> |
| 10 | #include <set> |
| 11 | |
Avi Drissman | 13fc893 | 2015-12-20 04:40:46 | [diff] [blame] | 12 | #include "base/macros.h" |
sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 13 | #include "base/memory/ref_counted.h" |
| 14 | #include "base/memory/scoped_ptr.h" |
| 15 | #include "net/interfaces/proxy_resolver_service.mojom.h" |
sammc | a83d9e83 | 2015-03-12 03:42:47 | [diff] [blame] | 16 | #include "net/proxy/proxy_resolver.h" |
sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 17 | |
| 18 | namespace net { |
sammc | a3242c9 | 2015-07-10 02:38:51 | [diff] [blame] | 19 | class ProxyResolverV8Tracing; |
sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 20 | |
sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 21 | class MojoProxyResolverImpl : public interfaces::ProxyResolver { |
| 22 | public: |
sammc | a3242c9 | 2015-07-10 02:38:51 | [diff] [blame] | 23 | explicit MojoProxyResolverImpl(scoped_ptr<ProxyResolverV8Tracing> resolver); |
sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 24 | |
| 25 | ~MojoProxyResolverImpl() override; |
| 26 | |
| 27 | private: |
| 28 | class Job; |
| 29 | |
sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 30 | // interfaces::ProxyResolver overrides. |
sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 31 | void GetProxyForUrl( |
| 32 | const mojo::String& url, |
| 33 | interfaces::ProxyResolverRequestClientPtr client) override; |
| 34 | |
| 35 | void DeleteJob(Job* job); |
| 36 | |
sammc | a3242c9 | 2015-07-10 02:38:51 | [diff] [blame] | 37 | scoped_ptr<ProxyResolverV8Tracing> resolver_; |
sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 38 | std::set<Job*> resolve_jobs_; |
sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 39 | |
sammc | 5403aa1d | 2015-02-25 04:59:21 | [diff] [blame] | 40 | DISALLOW_COPY_AND_ASSIGN(MojoProxyResolverImpl); |
| 41 | }; |
| 42 | |
| 43 | } // namespace net |
| 44 | |
| 45 | #endif // NET_PROXY_MOJO_PROXY_RESOLVER_IMPL_H_ |