Chromium Code Reviews| Index: extensions/browser/extension_web_contents_observer.cc |
| diff --git a/extensions/browser/extension_web_contents_observer.cc b/extensions/browser/extension_web_contents_observer.cc |
| index 5ba2ebb5fcf81f9d3306e921877d52012bb3d44c..04335a527b8531cb9c7e3aac456528117b7be9ad 100644 |
| --- a/extensions/browser/extension_web_contents_observer.cc |
| +++ b/extensions/browser/extension_web_contents_observer.cc |
| @@ -18,6 +18,7 @@ |
| #include "extensions/browser/process_manager.h" |
| #include "extensions/browser/view_type_utils.h" |
| #include "extensions/common/constants.h" |
| +#include "extensions/common/extension.h" |
| #include "extensions/common/extension_messages.h" |
| namespace extensions { |
| @@ -156,6 +157,22 @@ void ExtensionWebContentsObserver::NotifyRenderViewType( |
| } |
| } |
| +void ExtensionWebContentsObserver::PepperInstanceCreated() { |
| + ProcessManager* const process_manager = ProcessManager::Get(browser_context_); |
| + const Extension* const extension = |
|
not at google - send to devlin
2015/05/26 21:18:42
Kinda overboard-ing the "const" here IMO, but what
|
| + process_manager->GetExtensionForWebContents(web_contents()); |
| + if (extension) |
| + process_manager->IncrementLazyKeepaliveCount(extension); |
| +} |
| + |
| +void ExtensionWebContentsObserver::PepperInstanceDeleted() { |
| + ProcessManager* const process_manager = ProcessManager::Get(browser_context_); |
| + const Extension* const extension = |
| + process_manager->GetExtensionForWebContents(web_contents()); |
| + if (extension) |
| + process_manager->DecrementLazyKeepaliveCount(extension); |
| +} |
| + |
| const Extension* ExtensionWebContentsObserver::GetExtension( |
| content::RenderViewHost* render_view_host) { |
| std::string extension_id = GetExtensionId(render_view_host); |