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

Unified Diff: extensions/browser/mojo/keep_alive_impl.cc

Issue 2326913003: Privatize StrongBinding lifetime management (Closed)
Patch Set: rebase Created 4 years, 3 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 | « extensions/browser/mojo/keep_alive_impl.h ('k') | extensions/browser/mojo/stash_backend.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/mojo/keep_alive_impl.cc
diff --git a/extensions/browser/mojo/keep_alive_impl.cc b/extensions/browser/mojo/keep_alive_impl.cc
index 8f175822132f96cf29c581c85e7c8677ae7f0a17..3d40c14d2637686c5f5535dc6a71c66083908540 100644
--- a/extensions/browser/mojo/keep_alive_impl.cc
+++ b/extensions/browser/mojo/keep_alive_impl.cc
@@ -15,13 +15,14 @@ namespace extensions {
// static
void KeepAliveImpl::Create(content::BrowserContext* context,
const Extension* extension,
- mojo::InterfaceRequest<KeepAlive> request) {
+ KeepAliveRequest request) {
+ // Owns itself.
new KeepAliveImpl(context, extension, std::move(request));
}
KeepAliveImpl::KeepAliveImpl(content::BrowserContext* context,
const Extension* extension,
- mojo::InterfaceRequest<KeepAlive> request)
+ KeepAliveRequest request)
: context_(context),
extension_(extension),
extension_registry_observer_(this),
@@ -48,6 +49,7 @@ void KeepAliveImpl::OnShutdown(ExtensionRegistry* registry) {
void KeepAliveImpl::OnDisconnected() {
ProcessManager::Get(context_)->DecrementLazyKeepaliveCount(extension_);
+ delete this;
}
} // namespace extensions
« no previous file with comments | « extensions/browser/mojo/keep_alive_impl.h ('k') | extensions/browser/mojo/stash_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698