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

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

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/browser/webui/web_ui_mojo_browsertest.cc ('k') | content/common/mojo/service_registry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/mojo/service_registry_impl.h
diff --git a/content/common/mojo/service_registry_impl.h b/content/common/mojo/service_registry_impl.h
index c0dce522e368e912bd9f9ef5d40d040bf86ad415..d3ca173738df63071ee4048a47c656b3148b04c9 100644
--- a/content/common/mojo/service_registry_impl.h
+++ b/content/common/mojo/service_registry_impl.h
@@ -11,6 +11,7 @@
#include <utility>
#include "base/callback.h"
+#include "base/memory/weak_ptr.h"
#include "content/public/common/service_registry.h"
#include "mojo/public/cpp/bindings/interface_impl.h"
#include "mojo/public/cpp/system/core.h"
@@ -41,6 +42,8 @@ class ServiceRegistryImpl : public ServiceRegistry,
const base::StringPiece& service_name,
mojo::ScopedMessagePipeHandle handle) OVERRIDE;
+ base::WeakPtr<ServiceRegistry> GetWeakPtr();
+
private:
// mojo::InterfaceImpl<mojo::ServiceProvider> overrides.
virtual void ConnectToService(
@@ -53,6 +56,8 @@ class ServiceRegistryImpl : public ServiceRegistry,
std::queue<std::pair<std::string, mojo::MessagePipeHandle> >
pending_connects_;
bool bound_;
+
+ base::WeakPtrFactory<ServiceRegistry> weak_factory_;
};
} // namespace content
« no previous file with comments | « content/browser/webui/web_ui_mojo_browsertest.cc ('k') | content/common/mojo/service_registry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698