blob: 75280042f5e00aaa26eb6de18ef0d9b9cf006f10 [file] [log] [blame]
sammc5403aa1d2015-02-25 04:59:211// 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
sammca83d9e832015-03-12 03:42:478#include <map>
sammc5403aa1d2015-02-25 04:59:219#include <queue>
10#include <set>
11
Avi Drissman13fc8932015-12-20 04:40:4612#include "base/macros.h"
sammc5403aa1d2015-02-25 04:59:2113#include "base/memory/ref_counted.h"
14#include "base/memory/scoped_ptr.h"
15#include "net/interfaces/proxy_resolver_service.mojom.h"
sammca83d9e832015-03-12 03:42:4716#include "net/proxy/proxy_resolver.h"
sammc5403aa1d2015-02-25 04:59:2117
18namespace net {
sammca3242c92015-07-10 02:38:5119class ProxyResolverV8Tracing;
sammc5403aa1d2015-02-25 04:59:2120
sammc5403aa1d2015-02-25 04:59:2121class MojoProxyResolverImpl : public interfaces::ProxyResolver {
22 public:
sammca3242c92015-07-10 02:38:5123 explicit MojoProxyResolverImpl(scoped_ptr<ProxyResolverV8Tracing> resolver);
sammc5403aa1d2015-02-25 04:59:2124
25 ~MojoProxyResolverImpl() override;
26
27 private:
28 class Job;
29
sammc5403aa1d2015-02-25 04:59:2130 // interfaces::ProxyResolver overrides.
sammc5403aa1d2015-02-25 04:59:2131 void GetProxyForUrl(
32 const mojo::String& url,
33 interfaces::ProxyResolverRequestClientPtr client) override;
34
35 void DeleteJob(Job* job);
36
sammca3242c92015-07-10 02:38:5137 scoped_ptr<ProxyResolverV8Tracing> resolver_;
sammc5403aa1d2015-02-25 04:59:2138 std::set<Job*> resolve_jobs_;
sammc5403aa1d2015-02-25 04:59:2139
sammc5403aa1d2015-02-25 04:59:2140 DISALLOW_COPY_AND_ASSIGN(MojoProxyResolverImpl);
41};
42
43} // namespace net
44
45#endif // NET_PROXY_MOJO_PROXY_RESOLVER_IMPL_H_