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

Unified Diff: content/ppapi_plugin/ppapi_thread.cc

Issue 11565026: Crash ppapi processes on Windows when calling exit(), _exit(), abort() and ExitProcess() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « base/win/win_util.cc ('k') | content/renderer/renderer_main_platform_delegate_win.cc » ('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 2e6e255b1500f636505949357e5bc53a92135e0a..5af89ac0b973bf0342b3eed4f08e8c8104b0a04e 100644
--- a/content/ppapi_plugin/ppapi_thread.cc
+++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -35,6 +35,7 @@
#include "webkit/plugins/plugin_switches.h"
#if defined(OS_WIN)
+#include "base/win/win_util.h"
#include "sandbox/win/src/sandbox.h"
#elif defined(OS_MACOSX)
#include "content/common/sandbox_init_mac.h"
@@ -78,6 +79,11 @@ PpapiThread::~PpapiThread() {
if (plugin_entry_points_.shutdown_module)
plugin_entry_points_.shutdown_module();
WebKit::shutdown();
+
+#if defined(OS_WIN)
+ if (permissions_.HasPermission(ppapi::PERMISSION_FLASH))
+ base::win::SetShouldCrashOnProcessDetach(false);
+#endif
}
bool PpapiThread::Send(IPC::Message* msg) {
@@ -271,6 +277,14 @@ void PpapiThread::OnMsgLoadPlugin(const FilePath& path,
}
#if defined(OS_WIN)
+ if (permissions.HasPermission(ppapi::PERMISSION_FLASH)) {
+ // If code subsequently tries to exit using exit(), _exit(), abort(), or
+ // ExitProcess(), force a crash (since otherwise these would be silent
+ // terminations and fly under the radar).
+ base::win::SetShouldCrashOnProcessDetach(true);
+ base::win::SetAbortBehaviorForCrashReporting();
eroman 2012/12/14 02:03:57 I suggest enabling this line for all ppapi, not ju
brettw 2012/12/14 05:10:06 Yeah, we should be OK to enable this for all nativ
yzshen1 2012/12/14 18:19:31 Done.
+ }
+
// Once we lower the token the sandbox is locked down and no new modules
// can be loaded. TODO(cpu): consider changing to the loading style of
// regular plugins.
« no previous file with comments | « base/win/win_util.cc ('k') | content/renderer/renderer_main_platform_delegate_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698