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

Unified Diff: content/common/mojo/service_registry_impl.cc

Issue 302573002: Add a Javascript wrapper around ServiceRegistry and expose it to WebUI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@render-view-shell
Patch Set: address comment Created 6 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: content/common/mojo/service_registry_impl.cc
diff --git a/content/common/mojo/service_registry_impl.cc b/content/common/mojo/service_registry_impl.cc
index d19b96f3da081d0bb1fbdcba216f1bdaa7e1836e..ec17054d34abd8129b0993555b0378565bdd9df4 100644
--- a/content/common/mojo/service_registry_impl.cc
+++ b/content/common/mojo/service_registry_impl.cc
@@ -8,11 +8,12 @@
namespace content {
-ServiceRegistryImpl::ServiceRegistryImpl() : bound_(false) {
+ServiceRegistryImpl::ServiceRegistryImpl()
+ : bound_(false), weak_factory_(this) {
}
ServiceRegistryImpl::ServiceRegistryImpl(mojo::ScopedMessagePipeHandle handle)
- : bound_(false) {
+ : bound_(false), weak_factory_(this) {
BindRemoteServiceProvider(handle.Pass());
}
@@ -63,6 +64,10 @@ void ServiceRegistryImpl::GetRemoteInterface(
client()->GetInterface(mojo::String::From(service_name), handle.Pass());
}
+base::WeakPtr<ServiceRegistry> ServiceRegistryImpl::GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
void ServiceRegistryImpl::GetInterface(
const mojo::String& name,
mojo::ScopedMessagePipeHandle client_handle) {

Powered by Google App Engine
This is Rietveld 408576698