summaryrefslogtreecommitdiffstats
path: root/content/ppapi_plugin
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-22 08:30:33 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-22 08:30:33 +0000
commit029bd94e73652b6327fd77a65ec619ffdb1f325b (patch)
treee1baa98d23524dcae39257bc47abae20b2952e3e /content/ppapi_plugin
parent1a843b8f84f781c1079e36de77fb986fb7a2c569 (diff)
downloadchromium_src-029bd94e73652b6327fd77a65ec619ffdb1f325b.zip
chromium_src-029bd94e73652b6327fd77a65ec619ffdb1f325b.tar.gz
chromium_src-029bd94e73652b6327fd77a65ec619ffdb1f325b.tar.bz2
Add two new debug URLs for Pepper Flash:
- chrome://ppapiflashcrash - chrome://ppapiflashhang TEST=none BUG=169915 Review URL: https://chromiumcodereview.appspot.com/11883026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/ppapi_plugin')
-rw-r--r--content/ppapi_plugin/ppapi_thread.cc16
-rw-r--r--content/ppapi_plugin/ppapi_thread.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
index d61e15b..3bd4edd 100644
--- a/content/ppapi_plugin/ppapi_thread.cc
+++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -11,6 +11,8 @@
#include "base/process_util.h"
#include "base/rand_util.h"
#include "base/stringprintf.h"
+#include "base/threading/platform_thread.h"
+#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "content/common/child_process.h"
#include "content/common/child_process_messages.h"
@@ -138,6 +140,8 @@ bool PpapiThread::OnControlMessageReceived(const IPC::Message& msg) {
IPC_MESSAGE_HANDLER(PpapiMsg_LoadPlugin, OnLoadPlugin)
IPC_MESSAGE_HANDLER(PpapiMsg_CreateChannel, OnCreateChannel)
IPC_MESSAGE_HANDLER(PpapiMsg_SetNetworkState, OnSetNetworkState)
+ IPC_MESSAGE_HANDLER(PpapiMsg_Crash, OnCrash)
+ IPC_MESSAGE_HANDLER(PpapiMsg_Hang, OnHang)
IPC_MESSAGE_HANDLER(PpapiPluginMsg_ResourceReply, OnResourceReply)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -382,6 +386,18 @@ void PpapiThread::OnSetNetworkState(bool online) {
ns->SetOnLine(PP_FromBool(online));
}
+void PpapiThread::OnCrash() {
+ // Intentionally crash upon the request of the browser.
+ volatile int* null_pointer = NULL;
+ *null_pointer = 0;
+}
+
+void PpapiThread::OnHang() {
+ // Intentionally hang upon the request of the browser.
+ for (;;)
+ base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
+}
+
bool PpapiThread::SetupRendererChannel(base::ProcessId renderer_pid,
int renderer_child_id,
bool incognito,
diff --git a/content/ppapi_plugin/ppapi_thread.h b/content/ppapi_plugin/ppapi_thread.h
index 8f7c901..d7fd039 100644
--- a/content/ppapi_plugin/ppapi_thread.h
+++ b/content/ppapi_plugin/ppapi_thread.h
@@ -97,6 +97,8 @@ class PpapiThread : public ChildThread,
const ppapi::proxy::ResourceMessageReplyParams& reply_params,
const IPC::Message& nested_msg);
void OnSetNetworkState(bool online);
+ void OnCrash();
+ void OnHang();
// Sets up the channel to the given renderer. On success, returns true and
// fills the given ChannelHandle with the information from the new channel.