OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef CHROME_BROWSER_NET_UTILITY_PROCESS_MOJO_PROXY_RESOLVER_FACTORY_H_ | |
6 #define CHROME_BROWSER_NET_UTILITY_PROCESS_MOJO_PROXY_RESOLVER_FACTORY_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "net/proxy/mojo_proxy_resolver_factory.h" | |
10 | |
11 template <typename Type> | |
12 struct DefaultSingletonTraits; | |
13 | |
14 namespace content { | |
15 class UtilityProcessHost; | |
16 } | |
17 | |
18 namespace chrome_browser_net { | |
Sam McNally
2015/03/09 03:36:15
Remove.
Anand Mistry (off Chromium)
2015/03/10 07:24:23
Done.
| |
19 | |
20 // A factory used to create connections to Mojo proxy resolver services run in a | |
21 // utility process. All Mojo proxy resolver services will be run in the same | |
22 // utility process. Utility process crashes are detected and the utility | |
Sam McNally
2015/03/09 03:36:15
Single space after .
Anand Mistry (off Chromium)
2015/03/10 07:24:23
Done.
| |
23 // process is automatically restarted. | |
24 class UtilityProcessMojoProxyResolverFactory | |
25 : public net::MojoProxyResolverFactory, | |
26 public mojo::ErrorHandler { | |
27 public: | |
28 static UtilityProcessMojoProxyResolverFactory* GetInstance(); | |
29 | |
30 // Overridden from net::MojoProxyResolverFactory: | |
31 void Create(mojo::InterfaceRequest<net::interfaces::ProxyResolver> req, | |
32 net::interfaces::HostResolverPtr host_resolver) override; | |
33 | |
34 private: | |
35 friend struct DefaultSingletonTraits<UtilityProcessMojoProxyResolverFactory>; | |
36 UtilityProcessMojoProxyResolverFactory(); | |
37 ~UtilityProcessMojoProxyResolverFactory() override; | |
38 | |
39 // Overridden from mojo::ErrorHandler: | |
40 void OnConnectionError() override; | |
41 | |
42 // Creates a new utility process and connects to its Mojo proxy resolver | |
43 // factory. | |
44 void CreateProcessAndConnect(); | |
45 | |
46 net::interfaces::ProxyResolverFactoryPtr resolver_factory_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(UtilityProcessMojoProxyResolverFactory); | |
49 }; | |
50 | |
51 } // namespace chrome_browser_net | |
52 | |
53 #endif // CHROME_BROWSER_NET_UTILITY_PROCESS_MOJO_PROXY_RESOLVER_FACTORY_H_ | |
OLD | NEW |