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

Unified Diff: chrome/app/chrome_main.cc

Issue 371073003: Set dump_without_crashing_function_ in chrome.dll (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comments Created 6 years, 5 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 | « base/debug/dump_without_crashing.h ('k') | chrome/common/url_constants.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_main.cc
diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc
index c1cf145b014eb62c59ee4c6ac216e32b4e39bec5..80cd0fb2f8944215f40ee84c89adb23b886750cc 100644
--- a/chrome/app/chrome_main.cc
+++ b/chrome/app/chrome_main.cc
@@ -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;
« no previous file with comments | « base/debug/dump_without_crashing.h ('k') | chrome/common/url_constants.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698