Index: content/shell/renderer/shell_content_renderer_client.cc |
diff --git a/content/shell/renderer/shell_content_renderer_client.cc b/content/shell/renderer/shell_content_renderer_client.cc |
index a8a3d62e4cf1e87fa64aac8b5b369ad897ba5877..a021d199fa951793036657b71884876c7c6c39ce 100644 |
--- a/content/shell/renderer/shell_content_renderer_client.cc |
+++ b/content/shell/renderer/shell_content_renderer_client.cc |
@@ -12,13 +12,16 @@ |
#include "base/macros.h" |
#include "components/cdm/renderer/external_clear_key_key_system_properties.h" |
#include "components/web_cache/renderer/web_cache_impl.h" |
+#include "content/public/child/child_thread.h" |
+#include "content/public/common/connection_filter_impl.h" |
+#include "content/public/common/service_manager_connection.h" |
#include "content/public/test/test_service.mojom.h" |
#include "content/shell/common/shell_switches.h" |
#include "content/shell/renderer/shell_render_view_observer.h" |
#include "mojo/public/cpp/bindings/binding.h" |
#include "mojo/public/cpp/system/message_pipe.h" |
#include "ppapi/features/features.h" |
-#include "services/service_manager/public/cpp/interface_registry.h" |
+#include "services/service_manager/public/cpp/binder_registry.h" |
#include "third_party/WebKit/public/web/WebTestingSupport.h" |
#include "third_party/WebKit/public/web/WebView.h" |
#include "v8/include/v8.h" |
@@ -102,6 +105,14 @@ ShellContentRendererClient::~ShellContentRendererClient() { |
void ShellContentRendererClient::RenderThreadStarted() { |
web_cache_impl_.reset(new web_cache::WebCacheImpl()); |
+ |
+ auto registry = base::MakeUnique<service_manager::BinderRegistry>(); |
+ registry->AddInterface<mojom::TestService>( |
+ base::Bind(&CreateTestService), base::ThreadTaskRunnerHandle::Get()); |
+ content::ChildThread::Get() |
+ ->GetServiceManagerConnection() |
+ ->AddConnectionFilter( |
+ base::MakeUnique<ConnectionFilterImpl>(std::move(registry))); |
} |
void ShellContentRendererClient::RenderViewCreated(RenderView* render_view) { |
@@ -135,12 +146,6 @@ void ShellContentRendererClient::DidInitializeWorkerContextOnWorkerThread( |
} |
} |
-void ShellContentRendererClient::ExposeInterfacesToBrowser( |
- service_manager::InterfaceRegistry* interface_registry) { |
- interface_registry->AddInterface<mojom::TestService>( |
- base::Bind(&CreateTestService)); |
-} |
- |
#if defined(ENABLE_MOJO_CDM) |
void ShellContentRendererClient::AddSupportedKeySystems( |
std::vector<std::unique_ptr<media::KeySystemProperties>>* key_systems) { |