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

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

Issue 2079943002: Change RenderFrame to use InterfaceRegistry et al. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a2
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/interface_provider.h ('k') | services/shell/public/cpp/lib/callback_binder.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 81bd3654b1e4e17646889fc8dddfc44d484351de..f5d10dcbb7201dff05a285aa0a84f047dc077e6b 100644
--- a/services/shell/public/cpp/interface_registry.h
+++ b/services/shell/public/cpp/interface_registry.h
@@ -66,6 +66,8 @@ class InterfaceRegistry : public mojom::InterfaceProvider {
void Bind(mojom::InterfaceProviderRequest local_interfaces_request);
+ base::WeakPtr<InterfaceRegistry> GetWeakPtr();
+
// Allows |Interface| to be exposed via this registry. Requests to bind will
// be handled by |factory|. Returns true if the interface was exposed, false
// if Connection policy prevented exposure.
@@ -90,6 +92,11 @@ class InterfaceRegistry : public mojom::InterfaceProvider {
new internal::CallbackBinder<Interface>(callback, task_runner)),
Interface::Name_);
}
+ bool AddInterface(
+ const std::string& name,
+ const base::Callback<void(mojo::ScopedMessagePipeHandle)>& callback,
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner =
+ nullptr);
template <typename Interface>
void RemoveInterface() {
@@ -115,6 +122,8 @@ class InterfaceRegistry : public mojom::InterfaceProvider {
NameToInterfaceBinderMap name_to_binder_;
+ base::WeakPtrFactory<InterfaceRegistry> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(InterfaceRegistry);
};
« no previous file with comments | « services/shell/public/cpp/interface_provider.h ('k') | services/shell/public/cpp/lib/callback_binder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698