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, |