OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_PROXY_IN_PROCESS_MOJO_PROXY_RESOLVER_FACTORY_H_ | 5 #ifndef NET_PROXY_IN_PROCESS_MOJO_PROXY_RESOLVER_FACTORY_H_ |
6 #define NET_PROXY_IN_PROCESS_MOJO_PROXY_RESOLVER_FACTORY_H_ | 6 #define NET_PROXY_IN_PROCESS_MOJO_PROXY_RESOLVER_FACTORY_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "net/proxy/mojo_proxy_resolver_factory.h" | 9 #include "net/proxy/mojo_proxy_resolver_factory.h" |
10 | 10 |
| 11 namespace base { |
11 template <typename T> | 12 template <typename T> |
12 struct DefaultSingletonTraits; | 13 struct DefaultSingletonTraits; |
| 14 } |
13 | 15 |
14 namespace net { | 16 namespace net { |
15 | 17 |
16 // Factory to connect to an in-process Mojo proxy resolver service. | 18 // Factory to connect to an in-process Mojo proxy resolver service. |
17 // NOTE: This is intended to be temporary for debugging purposes and will be | 19 // NOTE: This is intended to be temporary for debugging purposes and will be |
18 // removed when we're confident with the out-of-process implementation. | 20 // removed when we're confident with the out-of-process implementation. |
19 class InProcessMojoProxyResolverFactory : public MojoProxyResolverFactory { | 21 class InProcessMojoProxyResolverFactory : public MojoProxyResolverFactory { |
20 public: | 22 public: |
21 static InProcessMojoProxyResolverFactory* GetInstance(); | 23 static InProcessMojoProxyResolverFactory* GetInstance(); |
22 | 24 |
23 // Overridden from MojoProxyResolverFactory: | 25 // Overridden from MojoProxyResolverFactory: |
24 scoped_ptr<base::ScopedClosureRunner> CreateResolver( | 26 scoped_ptr<base::ScopedClosureRunner> CreateResolver( |
25 const mojo::String& pac_script, | 27 const mojo::String& pac_script, |
26 mojo::InterfaceRequest<interfaces::ProxyResolver> req, | 28 mojo::InterfaceRequest<interfaces::ProxyResolver> req, |
27 interfaces::ProxyResolverFactoryRequestClientPtr client) override; | 29 interfaces::ProxyResolverFactoryRequestClientPtr client) override; |
28 | 30 |
29 private: | 31 private: |
30 InProcessMojoProxyResolverFactory(); | 32 InProcessMojoProxyResolverFactory(); |
31 ~InProcessMojoProxyResolverFactory() override; | 33 ~InProcessMojoProxyResolverFactory() override; |
32 friend struct DefaultSingletonTraits<InProcessMojoProxyResolverFactory>; | 34 friend struct base::DefaultSingletonTraits<InProcessMojoProxyResolverFactory>; |
33 | 35 |
34 interfaces::ProxyResolverFactoryPtr factory_; | 36 interfaces::ProxyResolverFactoryPtr factory_; |
35 | 37 |
36 DISALLOW_COPY_AND_ASSIGN(InProcessMojoProxyResolverFactory); | 38 DISALLOW_COPY_AND_ASSIGN(InProcessMojoProxyResolverFactory); |
37 }; | 39 }; |
38 | 40 |
39 } // namespace net | 41 } // namespace net |
40 | 42 |
41 #endif // NET_PROXY_IN_PROCESS_MOJO_PROXY_RESOLVER_FACTORY_H_ | 43 #endif // NET_PROXY_IN_PROCESS_MOJO_PROXY_RESOLVER_FACTORY_H_ |
OLD | NEW |