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

Unified Diff: chrome/common/logging_chrome.cc

Issue 12090096: Split DumpWithoutCrashing() into a separate file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes Created 7 years, 11 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/logging_chrome.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/logging_chrome.cc
diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc
index f738c3fe66758cf20dcf5d7d8939fdada4a32c3e..3b2e579fe6c955441335e6af0d41992f3e69388a 100644
--- a/chrome/common/logging_chrome.cc
+++ b/chrome/common/logging_chrome.cc
@@ -47,6 +47,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/dump_without_crashing.h"
#include "chrome/common/env_vars.h"
#include "ipc/ipc_logging.h"
@@ -78,12 +79,6 @@ const GUID kChromeTraceProviderName = {
{ 0x80, 0xc1, 0x52, 0x7f, 0xea, 0x23, 0xe3, 0xa7 } };
#endif
-#if defined(USE_LINUX_BREAKPAD) || defined(OS_MACOSX)
-// Pointer to the function that's called by DumpWithoutCrashing() to dump the
-// process's memory.
-void (*dump_without_crashing_function_)() = NULL;
-#endif
-
// Assertion handler for logging errors that occur when dialogs are
// silenced. To record a new error, pass the log string associated
// with that error in the str parameter.
@@ -97,13 +92,7 @@ void SilentRuntimeReportHandler(const std::string& str) {
// Handler to silently dump the current process when there is an assert in
// chrome.
void DumpProcessAssertHandler(const std::string& str) {
- // Get the breakpad pointer from chrome.exe
- typedef void (__cdecl *DumpProcessFunction)();
- DumpProcessFunction DumpProcess = reinterpret_cast<DumpProcessFunction>(
- ::GetProcAddress(::GetModuleHandle(chrome::kBrowserProcessExecutableName),
- "DumpProcess"));
- if (DumpProcess)
- DumpProcess();
+ logging::DumpWithoutCrashing();
}
#endif // OS_WIN
MSVC_ENABLE_OPTIMIZE();
@@ -443,24 +432,6 @@ size_t GetFatalAssertions(AssertionList* assertions) {
return assertion_count;
}
-void DumpWithoutCrashing() {
-#if defined(OS_WIN)
- std::string str;
- DumpProcessAssertHandler(str);
-#elif defined(USE_LINUX_BREAKPAD) || defined(OS_MACOSX)
- if (dump_without_crashing_function_)
- (*dump_without_crashing_function_)();
-#else
- NOTIMPLEMENTED();
-#endif
-}
-
-#if defined(USE_LINUX_BREAKPAD) || defined(OS_MACOSX)
-void SetDumpWithoutCrashingFunction(void (*function)()) {
- dump_without_crashing_function_ = function;
-}
-#endif
-
FilePath GenerateTimestampedName(const FilePath& base_path,
base::Time timestamp) {
base::Time::Exploded time_deets;
« no previous file with comments | « chrome/common/logging_chrome.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698