Windows: Add missing crashpad initialization (issue #1995)

This commit is contained in:
Marshall Greenblatt 2016-12-05 14:29:54 +01:00
parent 5c07d06435
commit 0da94acdf2
1 changed files with 22 additions and 4 deletions

View File

@ -56,7 +56,8 @@ class CefForceShutdown {
} }
} g_force_shutdown; } g_force_shutdown;
#if defined(OS_WIN) && defined(ARCH_CPU_X86_64) #if defined(OS_WIN)
#if defined(ARCH_CPU_X86_64)
// VS2013 only checks the existence of FMA3 instructions, not the enabled-ness // VS2013 only checks the existence of FMA3 instructions, not the enabled-ness
// of them at the OS level (this is fixed in VS2015). We force off usage of // of them at the OS level (this is fixed in VS2015). We force off usage of
// FMA3 instructions in the CRT to avoid using that path and hitting illegal // FMA3 instructions in the CRT to avoid using that path and hitting illegal
@ -68,16 +69,30 @@ void DisableFMA3() {
disabled = true; disabled = true;
_set_FMA3_enable(0); _set_FMA3_enable(0);
} }
#endif // WIN && ARCH_CPU_X86_64 #endif // defined(ARCH_CPU_X86_64)
// Signal chrome_elf to initialize crash reporting, rather than doing it in
// DllMain. See https://crbug.com/656800 for details.
void InitializeCrashReporting() {
static bool initialized = false;
if (initialized)
return;
initialized = true;
SignalInitializeCrashReporting();
}
#endif // defined(OS_WIN)
} // namespace } // namespace
int CefExecuteProcess(const CefMainArgs& args, int CefExecuteProcess(const CefMainArgs& args,
CefRefPtr<CefApp> application, CefRefPtr<CefApp> application,
void* windows_sandbox_info) { void* windows_sandbox_info) {
#if defined(OS_WIN) && defined(ARCH_CPU_X86_64) #if defined(OS_WIN)
#if defined(ARCH_CPU_X86_64)
DisableFMA3(); DisableFMA3();
#endif #endif
InitializeCrashReporting();
#endif
base::CommandLine command_line(base::CommandLine::NO_PROGRAM); base::CommandLine command_line(base::CommandLine::NO_PROGRAM);
#if defined(OS_WIN) #if defined(OS_WIN)
@ -131,9 +146,12 @@ bool CefInitialize(const CefMainArgs& args,
const CefSettings& settings, const CefSettings& settings,
CefRefPtr<CefApp> application, CefRefPtr<CefApp> application,
void* windows_sandbox_info) { void* windows_sandbox_info) {
#if defined(OS_WIN) && defined(ARCH_CPU_X86_64) #if defined(OS_WIN)
#if defined(ARCH_CPU_X86_64)
DisableFMA3(); DisableFMA3();
#endif #endif
InitializeCrashReporting();
#endif
// Return true if the global context already exists. // Return true if the global context already exists.
if (g_context) if (g_context)