This adds a hang monitor for Pepper plugins. It monitors sync messages on the I/O thread of the renderer and sends a message to the browser if it's blocked for too long.

The browser will show an infobar allowing you to terminate the plugin.

BUG=122795

Review URL: https://chromiumcodereview.appspot.com/10014013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132245 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 48ffa6c..fa1907c 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -574,6 +574,7 @@
     IPC_MESSAGE_HANDLER(ViewHostMsg_EndColorChooser, OnEndColorChooser)
     IPC_MESSAGE_HANDLER(ViewHostMsg_SetSelectedColorInColorChooser,
                         OnSetSelectedColorInColorChooser)
+    IPC_MESSAGE_HANDLER(ViewHostMsg_PepperPluginHung, OnPepperPluginHung)
     IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP_EX()
 
@@ -1769,6 +1770,13 @@
     color_chooser_->SetSelectedColor(color);
 }
 
+void TabContents::OnPepperPluginHung(int plugin_child_id,
+                                     const FilePath& path,
+                                     bool is_hung) {
+  if (delegate_)
+    delegate_->PluginHungStatusChanged(this, plugin_child_id, path, is_hung);
+}
+
 // Notifies the RenderWidgetHost instance about the fact that the page is
 // loading, or done loading and calls the base implementation.
 void WebContentsImpl::SetIsLoading(bool is_loading,