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

Unified Diff: components/crash/app/breakpad_win.cc

Issue 619543002: Hook up custom Win 64 SEH to v8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updates Created 6 years, 3 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 | « chrome/common/v8_breakpad_support_win.cc ('k') | content/content_shell.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/crash/app/breakpad_win.cc
diff --git a/components/crash/app/breakpad_win.cc b/components/crash/app/breakpad_win.cc
index b0dba9899e593ca3967444c2b5bf713293dc96d0..1dc5fbcdee3f54b7fd1b269a403c4525c4bce966 100644
--- a/components/crash/app/breakpad_win.cc
+++ b/components/crash/app/breakpad_win.cc
@@ -611,4 +611,35 @@ extern "C" void __declspec(dllexport) __cdecl
env->UnSetVar(kPipeNameVar);
}
+#ifdef _WIN64
+PRUNTIME_FUNCTION GetRuntimeFunctionCallback(DWORD64 ControlPC, PVOID Context) {
+ if (g_breakpad) {
+ g_breakpad->WriteMinidump();
+ // Patched stub exists based on conditions (See InitCrashReporter).
+ // As a side note this function also gets called from
+ // WindowProcExceptionFilter.
+ if (g_real_terminate_process_stub == NULL) {
+ ::TerminateProcess(::GetCurrentProcess(), content::RESULT_CODE_KILLED);
+ } else {
+ NtTerminateProcessPtr real_terminate_proc =
+ reinterpret_cast<NtTerminateProcessPtr>(
+ static_cast<char*>(g_real_terminate_process_stub));
+ real_terminate_proc(::GetCurrentProcess(), content::RESULT_CODE_KILLED);
+ }
+ }
+ return NULL;
+}
+
+extern "C" void __declspec(dllexport) __cdecl
+RegisterNonABICompliantCodeRange(void* start, size_t size_in_bytes) {
+ RtlInstallFunctionTableCallback(
+ reinterpret_cast<DWORD64>(start) | 0x3, // Required by API.
+ reinterpret_cast<DWORD64>(start),
+ static_cast<DWORD>(size_in_bytes),
Will Harris 2014/09/30 20:39:59 check limits here during size_t -> DWORD conversio
+ GetRuntimeFunctionCallback,
+ NULL,
+ NULL);
+}
+#endif
+
} // namespace breakpad
« no previous file with comments | « chrome/common/v8_breakpad_support_win.cc ('k') | content/content_shell.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698