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

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: first version Created 6 years, 9 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: mojo/service_manager/service_manager.cc
diff --git a/mojo/service_manager/service_manager.cc b/mojo/service_manager/service_manager.cc
index ab72bdffd65549cbe4f221a2508502ceae53d53d..5bb8cbbd383c0672a047d2e4276ffc1376d22c31 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,11 @@ 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_)
DaveMoore 2014/04/04 21:06:46 Please include braces even if it's one statement o
cpu_(ooo_6.6-7.5) 2014/04/04 23:42:45 Done.
+ 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 +120,10 @@ void ServiceManager::SetLoaderForScheme(ServiceLoader* loader,
scheme_to_loader_[scheme] = loader;
}
+void ServiceManager::SetInterceptor(ServiceInterceptor* 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())

Powered by Google App Engine
This is Rietveld 408576698