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

Unified Diff: mojo/service_manager/service_manager.cc

Issue 225203002: Mojo Spy core first cut (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gcc fix Created 6 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
« no previous file with comments | « mojo/service_manager/service_manager.h ('k') | mojo/shell/context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/service_manager/service_manager.cc
diff --git a/mojo/service_manager/service_manager.cc b/mojo/service_manager/service_manager.cc
index ab72bdffd65549cbe4f221a2508502ceae53d53d..f12249ea66bc24cf59f8472ff4f1ca1abf5dcbc5 100644
--- a/mojo/service_manager/service_manager.cc
+++ b/mojo/service_manager/service_manager.cc
@@ -70,7 +70,9 @@ bool ServiceManager::TestAPI::HasFactoryForURL(const GURL& url) const {
manager_->url_to_service_factory_.end();
}
-ServiceManager::ServiceManager() : default_loader_(NULL) {
+ServiceManager::ServiceManager()
+ : default_loader_(NULL),
+ interceptor_(NULL) {
}
ServiceManager::~ServiceManager() {
@@ -100,7 +102,12 @@ void ServiceManager::Connect(const GURL& url,
service_factory = new ServiceFactory(this, url);
url_to_service_factory_[url] = service_factory;
}
- service_factory->ConnectToClient(client_handle.Pass());
+ if (interceptor_) {
+ service_factory->ConnectToClient(
+ interceptor_->OnConnectToClient(url, client_handle.Pass()));
+ } else {
+ service_factory->ConnectToClient(client_handle.Pass());
+ }
}
void ServiceManager::SetLoaderForURL(ServiceLoader* loader, const GURL& url) {
@@ -114,6 +121,10 @@ void ServiceManager::SetLoaderForScheme(ServiceLoader* loader,
scheme_to_loader_[scheme] = loader;
}
+void ServiceManager::SetInterceptor(Interceptor* interceptor) {
+ interceptor_ = interceptor;
+}
+
ServiceLoader* ServiceManager::GetLoaderForURL(const GURL& url) {
URLToLoaderMap::const_iterator url_it = url_to_loader_.find(url);
if (url_it != url_to_loader_.end())
« no previous file with comments | « mojo/service_manager/service_manager.h ('k') | mojo/shell/context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698