OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "extensions/browser/mojo/keep_alive_impl.h" | 5 #include "extensions/browser/mojo/keep_alive_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "extensions/browser/extension_registry.h" | 10 #include "extensions/browser/extension_registry.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 binding_.set_connection_error_handler( | 31 binding_.set_connection_error_handler( |
32 base::Bind(&KeepAliveImpl::OnDisconnected, base::Unretained(this))); | 32 base::Bind(&KeepAliveImpl::OnDisconnected, base::Unretained(this))); |
33 extension_registry_observer_.Add(ExtensionRegistry::Get(context_)); | 33 extension_registry_observer_.Add(ExtensionRegistry::Get(context_)); |
34 } | 34 } |
35 | 35 |
36 KeepAliveImpl::~KeepAliveImpl() = default; | 36 KeepAliveImpl::~KeepAliveImpl() = default; |
37 | 37 |
38 void KeepAliveImpl::OnExtensionUnloaded( | 38 void KeepAliveImpl::OnExtensionUnloaded( |
39 content::BrowserContext* browser_context, | 39 content::BrowserContext* browser_context, |
40 const Extension* extension, | 40 const Extension* extension, |
41 UnloadedExtensionInfo::Reason reason) { | 41 UnloadedExtensionReason reason) { |
42 if (browser_context == context_ && extension == extension_) | 42 if (browser_context == context_ && extension == extension_) |
43 delete this; | 43 delete this; |
44 } | 44 } |
45 | 45 |
46 void KeepAliveImpl::OnShutdown(ExtensionRegistry* registry) { | 46 void KeepAliveImpl::OnShutdown(ExtensionRegistry* registry) { |
47 delete this; | 47 delete this; |
48 } | 48 } |
49 | 49 |
50 void KeepAliveImpl::OnDisconnected() { | 50 void KeepAliveImpl::OnDisconnected() { |
51 ProcessManager::Get(context_)->DecrementLazyKeepaliveCount(extension_); | 51 ProcessManager::Get(context_)->DecrementLazyKeepaliveCount(extension_); |
52 delete this; | 52 delete this; |
53 } | 53 } |
54 | 54 |
55 } // namespace extensions | 55 } // namespace extensions |
OLD | NEW |