Chromium Code Reviews| Index: chrome/utility/chrome_content_utility_client.cc |
| diff --git a/chrome/utility/chrome_content_utility_client.cc b/chrome/utility/chrome_content_utility_client.cc |
| index 843b1f37ea88030b14df9df1bb7689375d07486c..cfe35d0010390dd12e3476509830b39c0bc7abc8 100644 |
| --- a/chrome/utility/chrome_content_utility_client.cc |
| +++ b/chrome/utility/chrome_content_utility_client.cc |
| @@ -15,6 +15,7 @@ |
| #include "chrome/utility/utility_message_handler.h" |
| #include "content/public/child/image_decoder_utils.h" |
| #include "content/public/common/content_switches.h" |
| +#include "content/public/common/service_registry.h" |
| #include "content/public/utility/utility_thread.h" |
| #include "courgette/courgette.h" |
| #include "courgette/third_party/bsdiff.h" |
| @@ -27,6 +28,7 @@ |
| #if !defined(OS_ANDROID) |
| #include "chrome/utility/profile_import_handler.h" |
| +#include "net/proxy/mojo_proxy_resolver_factory_impl.h" |
| #endif |
| #if defined(OS_WIN) |
| @@ -160,6 +162,29 @@ bool ChromeContentUtilityClient::OnMessageReceived( |
| return handled; |
| } |
| +#if !defined(OS_ANDROID) |
| +namespace { |
|
Lei Zhang
2015/03/05 23:42:49
There's already an anonymous namespace at line 55.
Anand Mistry (off Chromium)
2015/03/10 07:24:23
Done.
|
| + |
| +void CreateProxyResolverFactory( |
| + mojo::InterfaceRequest<net::interfaces::ProxyResolverFactory> request) { |
| + // MojoProxyResolverFactoryImpl is strongly bound to the Mojo message pipe it |
| + // is connected to. When that message pipe is closed, either explicitly on the |
| + // other end (in the browser process), or by a connection error, this object |
| + // will be destroyed. |
| + new net::MojoProxyResolverFactoryImpl(request.Pass()); |
|
eroman
2015/03/06 05:48:21
perhaps I am dense but I find this pattern confusi
Anand Mistry (off Chromium)
2015/03/10 07:24:23
I agree, but it's what we want. We want the object
|
| +} |
| + |
| +} // namespace |
| +#endif // OS_ANDROID |
| + |
| +void ChromeContentUtilityClient::RegisterMojoServices( |
| + content::ServiceRegistry* registry) { |
| +#if !defined(OS_ANDROID) |
| + registry->AddService<net::interfaces::ProxyResolverFactory>( |
| + base::Bind(CreateProxyResolverFactory)); |
| +#endif |
| +} |
| + |
| // static |
| void ChromeContentUtilityClient::PreSandboxStartup() { |
| #if defined(ENABLE_EXTENSIONS) |