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

Unified Diff: content/browser/web_contents/debug_urls.cc

Issue 11883026: Add two new debug URLs for Pepper Flash: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 11 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 | « content/browser/ppapi_plugin_process_host.cc ('k') | content/ppapi_plugin/ppapi_thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « content/browser/ppapi_plugin_process_host.cc ('k') | content/ppapi_plugin/ppapi_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698