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

Unified Diff: services/shell/public/cpp/lib/interface_registry.cc

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
Index: services/shell/public/cpp/lib/interface_registry.cc
diff --git a/services/shell/public/cpp/lib/interface_registry.cc b/services/shell/public/cpp/lib/interface_registry.cc
index a4657b24e8304fc825e1892fffb2367a7e224ec8..03e135dece389b3ac5c151e274c0ce54d142f66f 100644
--- a/services/shell/public/cpp/lib/interface_registry.cc
+++ b/services/shell/public/cpp/lib/interface_registry.cc
@@ -9,7 +9,7 @@
namespace shell {
InterfaceRegistry::InterfaceRegistry(Connection* connection)
- : binding_(this), connection_(connection) {}
+ : binding_(this), connection_(connection), weak_factory_(this) {}
InterfaceRegistry::~InterfaceRegistry() {}
void InterfaceRegistry::Bind(
@@ -18,6 +18,20 @@ void InterfaceRegistry::Bind(
binding_.Bind(std::move(local_interfaces_request));
}
+base::WeakPtr<InterfaceRegistry> InterfaceRegistry::GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
+bool InterfaceRegistry::AddInterface(
+ const std::string& name,
+ const base::Callback<void(mojo::ScopedMessagePipeHandle)>& callback,
+ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
+ return SetInterfaceBinderForName(
+ base::WrapUnique(
+ new internal::GenericCallbackBinder(callback, task_runner)),
+ name);
+}
+
void InterfaceRegistry::RemoveInterface(const std::string& name) {
auto it = name_to_binder_.find(name);
if (it != name_to_binder_.end())
« no previous file with comments | « services/shell/public/cpp/lib/interface_provider.cc ('k') | services/shell/public/cpp/lib/remote_interface_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698