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

Unified Diff: content/common/mojo/service_registry_impl.cc

Issue 1639233004: Revert of [mojo] Enable ServiceRegistryImpl to override remote services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@usb-testing-3
Patch Set: Created 4 years, 11 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
« no previous file with comments | « content/common/mojo/service_registry_impl.h ('k') | content/renderer/mojo/service_registry_js_wrapper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/mojo/service_registry_impl.cc
diff --git a/content/common/mojo/service_registry_impl.cc b/content/common/mojo/service_registry_impl.cc
index d75f64d5d4163599215cbff86387dff5ce2f4c47..a55864f92ea7066fe908327776bfdb5dd3dadc6a 100644
--- a/content/common/mojo/service_registry_impl.cc
+++ b/content/common/mojo/service_registry_impl.cc
@@ -39,14 +39,9 @@
}
}
-void ServiceRegistryImpl::AddServiceOverrideForTesting(
+void ServiceRegistryImpl::AddService(
const std::string& service_name,
- const ServiceFactory& factory) {
- service_overrides_[service_name] = factory;
-}
-
-void ServiceRegistryImpl::AddService(const std::string& service_name,
- const ServiceFactory service_factory) {
+ const base::Callback<void(mojo::ScopedMessagePipeHandle)> service_factory) {
service_factories_[service_name] = service_factory;
}
@@ -57,12 +52,6 @@
void ServiceRegistryImpl::ConnectToRemoteService(
const base::StringPiece& service_name,
mojo::ScopedMessagePipeHandle handle) {
- auto override_it = service_overrides_.find(service_name.as_string());
- if (override_it != service_overrides_.end()) {
- override_it->second.Run(std::move(handle));
- return;
- }
-
if (!remote_provider_) {
pending_connects_.push(
std::make_pair(service_name.as_string(), handle.release()));
@@ -83,7 +72,9 @@
void ServiceRegistryImpl::ConnectToService(
const mojo::String& name,
mojo::ScopedMessagePipeHandle client_handle) {
- auto it = service_factories_.find(name);
+ std::map<std::string,
+ base::Callback<void(mojo::ScopedMessagePipeHandle)> >::iterator it =
+ service_factories_.find(name);
if (it == service_factories_.end())
return;
« no previous file with comments | « content/common/mojo/service_registry_impl.h ('k') | content/renderer/mojo/service_registry_js_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698