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

Unified Diff: services/shell/public/cpp/interface_registry.h

Issue 2075003002: Separate Remote InterfaceProvider again, and add a new client lib type for it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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 | « services/shell/public/cpp/connection.h ('k') | services/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: services/shell/public/cpp/interface_registry.h
diff --git a/services/shell/public/cpp/interface_registry.h b/services/shell/public/cpp/interface_registry.h
index e2c26332bd191bc8a647002dced81cbe8dbbee01..81bd3654b1e4e17646889fc8dddfc44d484351de 100644
--- a/services/shell/public/cpp/interface_registry.h
+++ b/services/shell/public/cpp/interface_registry.h
@@ -51,10 +51,6 @@ class InterfaceRegistry : public mojom::InterfaceProvider {
base::WrapUnique(binder), interface_name);
}
- void RemoveInterfaceBinderForName(const std::string& interface_name) {
- registry_->RemoveInterfaceBinderForName(interface_name);
- }
-
private:
InterfaceRegistry* registry_;
DISALLOW_COPY_AND_ASSIGN(TestApi);
@@ -66,23 +62,9 @@ class InterfaceRegistry : public mojom::InterfaceProvider {
// rules filtering which interfaces are allowed to be exposed to clients are
// imposed on this registry. If null, they are not.
explicit InterfaceRegistry(Connection* connection);
- // Construct with an InterfaceProviderRequest and a Connection (which may be
- // null, see note above about filtering).
- InterfaceRegistry(mojom::InterfaceProviderPtr remote_interfaces,
- mojom::InterfaceProviderRequest local_interfaces_request,
- Connection* connection);
~InterfaceRegistry() override;
- // Takes the client end of the InterfaceProvider pipe created in the
- // constructor.
- mojom::InterfaceProviderPtr TakeClientHandle();
-
- // Returns a raw pointer to the remote InterfaceProvider.
- mojom::InterfaceProvider* GetRemoteInterfaces();
-
- // Sets a closure to be run when the remote InterfaceProvider pipe is closed.
- void SetRemoteInterfacesConnectionLostClosure(
- const base::Closure& connection_lost_closure);
+ void Bind(mojom::InterfaceProviderRequest local_interfaces_request);
// Allows |Interface| to be exposed via this registry. Requests to bind will
// be handled by |factory|. Returns true if the interface was exposed, false
@@ -109,23 +91,11 @@ class InterfaceRegistry : public mojom::InterfaceProvider {
Interface::Name_);
}
- // Binds |ptr| to an implementation of Interface in the remote application.
- // |ptr| can immediately be used to start sending requests to the remote
- // interface.
template <typename Interface>
- void GetInterface(mojo::InterfacePtr<Interface>* ptr) {
- mojo::MessagePipe pipe;
- ptr->Bind(mojo::InterfacePtrInfo<Interface>(std::move(pipe.handle0), 0u));
-
- // Local binders can be registered via TestApi.
- auto it = name_to_binder_.find(Interface::Name_);
- if (it != name_to_binder_.end()) {
- it->second->BindInterface(connection_, Interface::Name_,
- std::move(pipe.handle1));
- return;
- }
- remote_interfaces_->GetInterface(Interface::Name_, std::move(pipe.handle1));
+ void RemoveInterface() {
+ RemoveInterface(Interface::Name_);
}
+ void RemoveInterface(const std::string& name);
private:
using NameToInterfaceBinderMap =
@@ -140,16 +110,11 @@ class InterfaceRegistry : public mojom::InterfaceProvider {
bool SetInterfaceBinderForName(std::unique_ptr<InterfaceBinder> binder,
const std::string& name);
- void RemoveInterfaceBinderForName(const std::string& interface_name);
-
- mojom::InterfaceProviderPtr client_handle_;
mojo::Binding<mojom::InterfaceProvider> binding_;
Connection* connection_;
NameToInterfaceBinderMap name_to_binder_;
- mojom::InterfaceProviderPtr remote_interfaces_;
-
DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry);
};
« no previous file with comments | « services/shell/public/cpp/connection.h ('k') | services/shell/public/cpp/lib/connection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698