win: Delegate to previous UEF on exception

Change-Id: I02f6d048d8a51797f93794ecc761f4fc8ba139a7
Reviewed-on: https://chromium-review.googlesource.com/420849
Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
Sigurdur Asgeirsson 2016-12-15 14:50:58 -05:00 committed by Mark Mentovai
parent cdbb90ec69
commit 2e80cb7cb4

View File

@ -129,9 +129,15 @@ void HandleSIGTERM(int sig, siginfo_t* siginfo, void* context) {
#endif // OS_MACOSX #endif // OS_MACOSX
#if defined(OS_WIN) #if defined(OS_WIN)
LONG(WINAPI* g_original_exception_filter)(EXCEPTION_POINTERS*) = nullptr;
LONG WINAPI UnhandledExceptionHandler(EXCEPTION_POINTERS* exception_pointers) { LONG WINAPI UnhandledExceptionHandler(EXCEPTION_POINTERS* exception_pointers) {
Metrics::HandlerCrashed(exception_pointers->ExceptionRecord->ExceptionCode); Metrics::HandlerCrashed(exception_pointers->ExceptionRecord->ExceptionCode);
return EXCEPTION_CONTINUE_SEARCH;
if (g_original_exception_filter)
return g_original_exception_filter(exception_pointers);
else
return EXCEPTION_CONTINUE_SEARCH;
} }
#endif // OS_WIN #endif // OS_WIN
@ -139,7 +145,8 @@ LONG WINAPI UnhandledExceptionHandler(EXCEPTION_POINTERS* exception_pointers) {
int HandlerMain(int argc, char* argv[]) { int HandlerMain(int argc, char* argv[]) {
#if defined(OS_WIN) #if defined(OS_WIN)
SetUnhandledExceptionFilter(&UnhandledExceptionHandler); g_original_exception_filter =
SetUnhandledExceptionFilter(&UnhandledExceptionHandler);
#endif #endif
const base::FilePath argv0( const base::FilePath argv0(