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

Unified Diff: mojo/shell/public/cpp/connection.h

Issue 1681813002: Rename Connection::AddService/ConnectToService to Connection::AddInterface/GetInterface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@interface_binder
Patch Set: . Created 4 years, 10 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/shell/package_manager/content_handler_unittest.cc ('k') | mojo/shell/public/cpp/lib/connection_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/connection.h
diff --git a/mojo/shell/public/cpp/connection.h b/mojo/shell/public/cpp/connection.h
index c67a590d3a8d8f6be0ef447be62ab4a66b14c866..59fc5747e0511cedc13b2382d283473eaffaf20c 100644
--- a/mojo/shell/public/cpp/connection.h
+++ b/mojo/shell/public/cpp/connection.h
@@ -32,8 +32,8 @@ class InterfaceBinder;
// Or, if you have multiple factories implemented by the same type, explicitly
// specify the interface to register the factory for:
//
-// connection->AddService<Foo>(&my_foo_and_bar_factory_);
-// connection->AddService<Bar>(&my_foo_and_bar_factory_);
+// connection->AddInterface<Foo>(&my_foo_and_bar_factory_);
+// connection->AddInterface<Bar>(&my_foo_and_bar_factory_);
//
// The InterfaceFactory must outlive the Connection.
//
@@ -68,7 +68,7 @@ class Connection {
// Returns true if the service was exposed, false if capability filtering
// from the shell prevented the service from being exposed.
template <typename Interface>
- bool AddService(InterfaceFactory<Interface>* factory) {
+ bool AddInterface(InterfaceFactory<Interface>* factory) {
return SetInterfaceBinderForName(
new internal::InterfaceFactoryBinder<Interface>(factory),
Interface::Name_);
@@ -78,8 +78,8 @@ class Connection {
// |ptr| can immediately be used to start sending requests to the remote
// service.
template <typename Interface>
- void ConnectToService(InterfacePtr<Interface>* ptr) {
- if (ServiceProvider* sp = GetServiceProvider()) {
+ void GetInterface(InterfacePtr<Interface>* ptr) {
+ if (ServiceProvider* sp = GetRemoteInterfaces()) {
MessagePipe pipe;
ptr->Bind(InterfacePtrInfo<Interface>(std::move(pipe.handle0), 0u));
sp->ConnectToService(Interface::Name_, std::move(pipe.handle1));
@@ -104,11 +104,11 @@ class Connection {
// Returns the raw proxy to the remote application's ServiceProvider
// interface. Most applications will just use ConnectToService() instead.
// Caller does not take ownership.
- virtual ServiceProvider* GetServiceProvider() = 0;
+ virtual ServiceProvider* GetRemoteInterfaces() = 0;
// Returns the local application's ServiceProvider interface. The return
// value is owned by this connection.
- virtual ServiceProvider* GetLocalServiceProvider() = 0;
+ virtual ServiceProvider* GetLocalInterfaces() = 0;
// Register a handler to receive an error notification on the pipe to the
// remote application's service provider.
« no previous file with comments | « mojo/shell/package_manager/content_handler_unittest.cc ('k') | mojo/shell/public/cpp/lib/connection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698