Revert of Re-enabling webrtc Telemetry tests. (patchset #1 id:1 of https://codereview...
[chromium-blink-merge.git] / net / proxy / proxy_resolver_factory_mojo.h
blob8d12e5b231120856288bfdf857f3e74b06251793
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.
5 #ifndef NET_PROXY_PROXY_RESOLVER_FACTORY_MOJO_H_
6 #define NET_PROXY_PROXY_RESOLVER_FACTORY_MOJO_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "net/base/completion_callback.h"
11 #include "net/proxy/proxy_resolver_factory.h"
12 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h"
14 namespace net {
15 class HostResolver;
16 class ProxyResolverErrorObserver;
17 class ProxyResolverScriptData;
18 class MojoProxyResolverFactory;
20 // Implementation of ProxyResolverFactory that connects to a Mojo service to
21 // create implementations of a Mojo proxy resolver to back a ProxyResolverMojo.
22 class ProxyResolverFactoryMojo : public ProxyResolverFactory {
23 public:
24 ProxyResolverFactoryMojo(
25 MojoProxyResolverFactory* mojo_proxy_factory,
26 HostResolver* host_resolver,
27 const base::Callback<scoped_ptr<ProxyResolverErrorObserver>()>&
28 error_observer_factory);
29 ~ProxyResolverFactoryMojo() override;
31 // ProxyResolverFactory override.
32 int CreateProxyResolver(
33 const scoped_refptr<ProxyResolverScriptData>& pac_script,
34 scoped_ptr<ProxyResolver>* resolver,
35 const CompletionCallback& callback,
36 scoped_ptr<Request>* request) override;
38 private:
39 class Job;
41 MojoProxyResolverFactory* const mojo_proxy_factory_;
42 HostResolver* const host_resolver_;
43 const base::Callback<scoped_ptr<ProxyResolverErrorObserver>()>
44 error_observer_factory_;
46 DISALLOW_COPY_AND_ASSIGN(ProxyResolverFactoryMojo);
49 } // namespace net
51 #endif // NET_PROXY_PROXY_RESOLVER_FACTORY_MOJO_H_