Keep event page alive when there's some Pepper plugin on it.
BUG=472532
Review URL: https://codereview.chromium.org/1117023002
Cr-Commit-Position: refs/heads/master@{#331945}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index a1ad421e..b9d8592 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -547,6 +547,10 @@
IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed)
IPC_MESSAGE_HANDLER(ViewHostMsg_WebUISend, OnWebUISend)
#if defined(ENABLE_PLUGINS)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceCreated,
+ OnPepperInstanceCreated)
+ IPC_MESSAGE_HANDLER(FrameHostMsg_PepperInstanceDeleted,
+ OnPepperInstanceDeleted)
IPC_MESSAGE_HANDLER(FrameHostMsg_PepperPluginHung, OnPepperPluginHung)
IPC_MESSAGE_HANDLER(FrameHostMsg_PluginCrashed, OnPluginCrashed)
IPC_MESSAGE_HANDLER(ViewHostMsg_RequestPpapiBrokerPermission,
@@ -3020,6 +3024,14 @@
}
#if defined(ENABLE_PLUGINS)
+void WebContentsImpl::OnPepperInstanceCreated() {
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_, PepperInstanceCreated());
+}
+
+void WebContentsImpl::OnPepperInstanceDeleted() {
+ FOR_EACH_OBSERVER(WebContentsObserver, observers_, PepperInstanceDeleted());
+}
+
void WebContentsImpl::OnPepperPluginHung(int plugin_child_id,
const base::FilePath& path,
bool is_hung) {