Index: content/browser/web_contents/debug_urls.cc |
diff --git a/content/browser/web_contents/debug_urls.cc b/content/browser/web_contents/debug_urls.cc |
index c7da753e06958a4ba55a9f3414e67825089dcb52..98222749013128acb9c913d0d71585651ad54e37 100644 |
--- a/content/browser/web_contents/debug_urls.cc |
+++ b/content/browser/web_contents/debug_urls.cc |
@@ -4,12 +4,39 @@ |
#include "content/browser/web_contents/debug_urls.h" |
+#include <vector> |
+ |
+#include "base/utf_string_conversions.h" |
#include "content/browser/gpu/gpu_process_host_ui_shim.h" |
+#include "content/browser/ppapi_plugin_process_host.h" |
+#include "content/public/browser/browser_thread.h" |
#include "content/public/common/url_constants.h" |
#include "googleurl/src/gurl.h" |
+#include "ppapi/proxy/ppapi_messages.h" |
+#include "webkit/plugins/plugin_constants.h" |
namespace content { |
+namespace { |
+ |
+void HandlePpapiFlashDebugURL(const GURL& url) { |
+#if defined(ENABLE_PLUGINS) |
+ bool crash = url == GURL(chrome::kChromeUIPpapiFlashCrashURL); |
+ |
+ std::vector<PpapiPluginProcessHost*> hosts; |
+ PpapiPluginProcessHost::FindByName(UTF8ToUTF16(kFlashPluginName), &hosts); |
+ for (std::vector<PpapiPluginProcessHost*>::iterator iter = hosts.begin(); |
+ iter != hosts.end(); ++iter) { |
+ if (crash) |
+ (*iter)->Send(new PpapiMsg_Crash()); |
+ else |
+ (*iter)->Send(new PpapiMsg_Hang()); |
+ } |
+#endif |
+} |
+ |
+} // namespace |
+ |
bool HandleDebugURL(const GURL& url, PageTransition transition) { |
// Ensure that the user explicitly navigated to this URL. |
if (!(transition & PAGE_TRANSITION_FROM_ADDRESS_BAR)) |
@@ -42,6 +69,13 @@ bool HandleDebugURL(const GURL& url, PageTransition transition) { |
return true; |
} |
+ if (url == GURL(chrome::kChromeUIPpapiFlashCrashURL) || |
+ url == GURL(chrome::kChromeUIPpapiFlashHangURL)) { |
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
+ base::Bind(&HandlePpapiFlashDebugURL, url)); |
+ return true; |
+ } |
+ |
return false; |
} |