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

Unified Diff: extensions/browser/extension_web_contents_observer.cc

Issue 1117023002: Keep event page alive when there's some Pepper plugin on it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DCHECK. Created 5 years, 7 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/extension_web_contents_observer.h ('k') | ppapi/tests/extensions/extensions.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 =
+ 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);
« no previous file with comments | « extensions/browser/extension_web_contents_observer.h ('k') | ppapi/tests/extensions/extensions.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698