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

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 comments Created 6 years, 5 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 | « content/common/mojo/service_registry_impl.h ('k') | content/content_renderer.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d4109afe50e154b6c026c0e309e530daca7c1973..c42a9c97fb8d6dd603139c0f3f1974805c9607b9 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::ConnectToRemoteService(
client()->ConnectToService(mojo::String::From(service_name), handle.Pass());
}
+base::WeakPtr<ServiceRegistry> ServiceRegistryImpl::GetWeakPtr() {
+ return weak_factory_.GetWeakPtr();
+}
+
void ServiceRegistryImpl::ConnectToService(
const mojo::String& name,
mojo::ScopedMessagePipeHandle client_handle) {
« no previous file with comments | « content/common/mojo/service_registry_impl.h ('k') | content/content_renderer.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698