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 MojoProxyResolverFactory
;
18 class ProxyResolverErrorObserver
;
19 class ProxyResolverScriptData
;
21 // Implementation of ProxyResolverFactory that connects to a Mojo service to
22 // create implementations of a Mojo proxy resolver to back a ProxyResolverMojo.
23 class ProxyResolverFactoryMojo
: public ProxyResolverFactory
{
25 ProxyResolverFactoryMojo(
26 MojoProxyResolverFactory
* mojo_proxy_factory
,
27 HostResolver
* host_resolver
,
28 const base::Callback
<scoped_ptr
<ProxyResolverErrorObserver
>()>&
29 error_observer_factory
,
31 ~ProxyResolverFactoryMojo() override
;
33 // ProxyResolverFactory override.
34 int CreateProxyResolver(
35 const scoped_refptr
<ProxyResolverScriptData
>& pac_script
,
36 scoped_ptr
<ProxyResolver
>* resolver
,
37 const CompletionCallback
& callback
,
38 scoped_ptr
<Request
>* request
) override
;
43 MojoProxyResolverFactory
* const mojo_proxy_factory_
;
44 HostResolver
* const host_resolver_
;
45 const base::Callback
<scoped_ptr
<ProxyResolverErrorObserver
>()>
46 error_observer_factory_
;
47 NetLog
* const net_log_
;
49 DISALLOW_COPY_AND_ASSIGN(ProxyResolverFactoryMojo
);
54 #endif // NET_PROXY_PROXY_RESOLVER_FACTORY_MOJO_H_