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

Unified Diff: content/ppapi_plugin/ppapi_thread.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/ppapi_plugin/ppapi_thread.h ('k') | content/public/common/url_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/ppapi_plugin/ppapi_thread.cc
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
index d61e15b9a2dc71e43f48a22ea3b5ed8a44fe08ee..3bd4edd1886d90e99d6f9c483c3c64f4bd3ef6e4 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,
« no previous file with comments | « content/ppapi_plugin/ppapi_thread.h ('k') | content/public/common/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698