Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(753)

Unified Diff: content/browser/service_worker/embedded_worker_test_helper.cc

Issue 2766263009: Convert content ConnectionFilter to OnBindInterface (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/embedded_worker_test_helper.cc
diff --git a/content/browser/service_worker/embedded_worker_test_helper.cc b/content/browser/service_worker/embedded_worker_test_helper.cc
index 9d92c5b3186cb06be380f0f47588c017b7d64bd2..fe012ea2c05ca974f49aceb4e894dfb1d3c5b913 100644
--- a/content/browser/service_worker/embedded_worker_test_helper.cc
+++ b/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -115,7 +115,10 @@ void EmbeddedWorkerTestHelper::MockEmbeddedWorkerInstanceClient::
// static
void EmbeddedWorkerTestHelper::MockEmbeddedWorkerInstanceClient::Bind(
const base::WeakPtr<EmbeddedWorkerTestHelper>& helper,
- mojom::EmbeddedWorkerInstanceClientRequest request) {
+ mojo::ScopedMessagePipeHandle request_handle) {
+ mojom::EmbeddedWorkerInstanceClientRequest request =
+ mojo::MakeRequest<mojom::EmbeddedWorkerInstanceClient>(
+ std::move(request_handle));
std::vector<std::unique_ptr<MockEmbeddedWorkerInstanceClient>>* clients =
helper->mock_instance_clients();
size_t next_client_index = helper->mock_instance_clients_next_index_;
@@ -290,11 +293,12 @@ EmbeddedWorkerTestHelper::EmbeddedWorkerTestHelper(
dispatcher_host.get());
dispatcher_hosts_[mock_render_process_id_] = std::move(dispatcher_host);
- // Setup process level interface registry.
- render_process_interface_registry_ =
- CreateInterfaceRegistry(render_process_host_.get());
- new_render_process_interface_registry_ =
- CreateInterfaceRegistry(new_render_process_host_.get());
+ render_process_host_->OverrideBinderForTesting(
+ mojom::EmbeddedWorkerInstanceClient::Name_,
+ base::Bind(&MockEmbeddedWorkerInstanceClient::Bind, AsWeakPtr()));
+ new_render_process_host_->OverrideBinderForTesting(
+ mojom::EmbeddedWorkerInstanceClient::Name_,
+ base::Bind(&MockEmbeddedWorkerInstanceClient::Bind, AsWeakPtr()));
}
EmbeddedWorkerTestHelper::~EmbeddedWorkerTestHelper() {
@@ -761,24 +765,4 @@ EmbeddedWorkerRegistry* EmbeddedWorkerTestHelper::registry() {
return context()->embedded_worker_registry();
}
-std::unique_ptr<service_manager::InterfaceRegistry>
-EmbeddedWorkerTestHelper::CreateInterfaceRegistry(MockRenderProcessHost* rph) {
- auto registry =
- base::MakeUnique<service_manager::InterfaceRegistry>(std::string());
- registry->AddInterface(
- base::Bind(&MockEmbeddedWorkerInstanceClient::Bind, AsWeakPtr()));
-
- service_manager::mojom::InterfaceProviderPtr interfaces;
- registry->Bind(mojo::MakeRequest(&interfaces), service_manager::Identity(),
- service_manager::InterfaceProviderSpec(),
- service_manager::Identity(),
- service_manager::InterfaceProviderSpec());
-
- std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces(
- new service_manager::InterfaceProvider);
- remote_interfaces->Bind(std::move(interfaces));
- rph->SetRemoteInterfaces(std::move(remote_interfaces));
- return registry;
-}
-
} // namespace content
« no previous file with comments | « content/browser/service_worker/embedded_worker_test_helper.h ('k') | content/browser/utility_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698