| 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 111ac99c49b6405840988b078b17fbc79d933e3f..f7d35213724fffd19484769d633d49f645b7d745 100644
|
| --- a/chrome/utility/chrome_content_utility_client.cc
|
| +++ b/chrome/utility/chrome_content_utility_client.cc
|
| @@ -14,6 +14,7 @@
|
| #include "chrome/common/safe_browsing/zip_analyzer_results.h"
|
| #include "chrome/utility/chrome_content_utility_ipc_whitelist.h"
|
| #include "chrome/utility/utility_message_handler.h"
|
| +#include "components/image_decoder/image_decoder_impl.h"
|
| #include "content/public/child/image_decoder_utils.h"
|
| #include "content/public/common/content_switches.h"
|
| #include "content/public/common/service_registry.h"
|
| @@ -78,16 +79,13 @@ void FinishParseMediaMetadata(
|
| }
|
| #endif
|
|
|
| -#if !defined(OS_ANDROID)
|
| -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());
|
| +template <class Interface, class Impl>
|
| +void CreateMojoService(mojo::InterfaceRequest<Interface> request) {
|
| + // The Mojo service implementation is assumed to use a StrongBinding<>, which
|
| + // causes the implementation to be deleted automatically when the Mojo
|
| + // connection is closed.
|
| + new Impl(request.Pass());
|
| }
|
| -#endif // OS_ANDROID
|
|
|
| } // namespace
|
|
|
| @@ -186,8 +184,12 @@ void ChromeContentUtilityClient::RegisterMojoServices(
|
| content::ServiceRegistry* registry) {
|
| #if !defined(OS_ANDROID)
|
| registry->AddService<net::interfaces::ProxyResolverFactory>(
|
| - base::Bind(CreateProxyResolverFactory));
|
| + base::Bind(CreateMojoService<net::interfaces::ProxyResolverFactory,
|
| + net::MojoProxyResolverFactoryImpl>));
|
| #endif
|
| + registry->AddService<image_decoder::ImageDecoder>(base::Bind(
|
| + CreateMojoService<image_decoder::ImageDecoder,
|
| + image_decoder::ImageDecoderImpl>));
|
| }
|
|
|
| // static
|
|
|