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"
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
{
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
;
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
);
51 #endif // NET_PROXY_PROXY_RESOLVER_FACTORY_MOJO_H_