Upstream version 9.37.195.0
[platform/framework/web/crosswalk.git] / src / chrome / app / chrome_main.cc
index c1cf145..80cd0fb 100644 (file)
@@ -7,7 +7,9 @@
 #include "content/public/app/content_main.h"
 
 #if defined(OS_WIN)
+#include "base/debug/dump_without_crashing.h"
 #include "base/win/win_util.h"
+#include "chrome/common/chrome_constants.h"
 
 #define DLLEXPORT __declspec(dllexport)
 
@@ -38,6 +40,15 @@ int ChromeMain(int argc, const char** argv) {
   base::win::SetAbortBehaviorForCrashReporting();
   params.instance = instance;
   params.sandbox_info = sandbox_info;
+
+  // SetDumpWithoutCrashingFunction must be passed the DumpProcess function
+  // from the EXE and not from the DLL in order for DumpWithoutCrashing to
+  // function correctly.
+  typedef void (__cdecl *DumpProcessFunction)();
+  DumpProcessFunction DumpProcess = reinterpret_cast<DumpProcessFunction>(
+      ::GetProcAddress(::GetModuleHandle(chrome::kBrowserProcessExecutableName),
+          "DumpProcessWithoutCrash"));
+  base::debug::SetDumpWithoutCrashingFunction(DumpProcess);
 #else
   params.argc = argc;
   params.argv = argv;