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

Unified Diff: content/public/common/service_registry.h

Issue 1128453004: Embed a simple Mojo shell in content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/public/common/service_registry.h
diff --git a/content/public/common/service_registry.h b/content/public/common/service_registry.h
index 1ce3b036673b151134781a119657d4f87bab9dc4..8ff9877d15886eb1b913176224181c7fe8cc7e98 100644
--- a/content/public/common/service_registry.h
+++ b/content/public/common/service_registry.h
@@ -51,13 +51,22 @@ class CONTENT_EXPORT ServiceRegistry {
}
virtual void RemoveService(const std::string& service_name) = 0;
- // Connect to an interface provided by the remote service provider.
+ // Connect to an interface provided by the remote service provider. Creates a
+ // new message pipe for this connection.
template <typename Interface>
void ConnectToRemoteService(mojo::InterfacePtr<Interface>* ptr) {
mojo::MessagePipe pipe;
ptr->Bind(pipe.handle0.Pass());
ConnectToRemoteService(Interface::Name_, pipe.handle1.Pass());
}
+
+ // Connect to an interface provided by the remote service provider, using an
+ // existing message pipe.
+ template <typename Interface>
+ void ConnectToRemoteService(mojo::InterfaceRequest<Interface> request) {
+ ConnectToRemoteService(Interface::Name_, request.PassMessagePipe());
+ }
+
virtual void ConnectToRemoteService(const base::StringPiece& name,
mojo::ScopedMessagePipeHandle handle) = 0;

Powered by Google App Engine
This is Rietveld 408576698