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

Unified Diff: mojo/service_manager/service_manager.h

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.h
diff --git a/mojo/service_manager/service_manager.h b/mojo/service_manager/service_manager.h
index f2ee988960fec903c0be4634222373d19b49c3cb..d94caeaa746ad0a9fdd858613a89c2b45115be29 100644
--- a/mojo/service_manager/service_manager.h
+++ b/mojo/service_manager/service_manager.h
@@ -22,6 +22,15 @@ namespace mojo {
class ServiceLoader;
+// Interface class for testing/debugging only.
DaveMoore 2014/04/04 21:06:46 This should either be a nested class within Servic
cpu_(ooo_6.6-7.5) 2014/04/04 23:42:45 Done.
+class ServiceInterceptor {
+ public:
+ virtual ~ServiceInterceptor() {}
+ // Called when ServiceManager::Connect is called.
+ virtual ScopedMessagePipeHandle OnConnectToClient(
+ const GURL& url, ScopedMessagePipeHandle handle) = 0;
+};
+
class MOJO_SERVICE_MANAGER_EXPORT ServiceManager {
public:
// API for testing.
@@ -58,6 +67,8 @@ class MOJO_SERVICE_MANAGER_EXPORT ServiceManager {
// Sets a Loader to be used for a specific url scheme.
// Does not take ownership of |loader|.
void SetLoaderForScheme(ServiceLoader* loader, const std::string& scheme);
+ // Allows to interpose a debugger to service connections.
+ void SetInterceptor(ServiceInterceptor* interceptor);
private:
class ServiceFactory;
@@ -77,6 +88,7 @@ class MOJO_SERVICE_MANAGER_EXPORT ServiceManager {
URLToLoaderMap url_to_loader_;
SchemeToLoaderMap scheme_to_loader_;
ServiceLoader* default_loader_;
+ ServiceInterceptor* interceptor_;
URLToServiceFactoryMap url_to_service_factory_;
DISALLOW_COPY_AND_ASSIGN(ServiceManager);

Powered by Google App Engine
This is Rietveld 408576698