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

Unified Diff: base/debug/dump_without_crashing.cc

Issue 99523009: Move DumpProcessWithoutCrash to base, so we can use it from net and content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years 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') | base/native_library.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/dump_without_crashing.cc
diff --git a/chrome/common/dump_without_crashing.cc b/base/debug/dump_without_crashing.cc
similarity index 33%
rename from chrome/common/dump_without_crashing.cc
rename to base/debug/dump_without_crashing.cc
index 65c6494d43f32726814c41baf0bb26c154403cb0..47fd873c19fd084c51d5e48455db040269ca47b3 100644
--- a/chrome/common/dump_without_crashing.cc
+++ b/base/debug/dump_without_crashing.cc
@@ -1,51 +1,32 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "build/build_config.h"
-
-#include "chrome/common/dump_without_crashing.h"
+#include "base/debug/dump_without_crashing.h"
#include "base/logging.h"
-#include "chrome/common/chrome_constants.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#endif
namespace {
-#if defined(OS_POSIX)
// Pointer to the function that's called by DumpWithoutCrashing() to dump the
// process's memory.
-void (*dump_without_crashing_function_)() = NULL;
-#endif
+void (CDECL *dump_without_crashing_function_)() = NULL;
} // namespace
-namespace logging {
+namespace base {
+
+namespace debug {
void DumpWithoutCrashing() {
-#if defined(OS_WIN)
- // Get the breakpad pointer from chrome.exe
- typedef void (__cdecl *DumpProcessFunction)();
- DumpProcessFunction DumpProcess = reinterpret_cast<DumpProcessFunction>(
- ::GetProcAddress(::GetModuleHandle(chrome::kBrowserProcessExecutableName),
- "DumpProcessWithoutCrash"));
- if (DumpProcess)
- DumpProcess();
-#elif defined(OS_POSIX)
if (dump_without_crashing_function_)
(*dump_without_crashing_function_)();
-#else
- NOTIMPLEMENTED();
-#endif
}
-#if defined(OS_POSIX)
-void SetDumpWithoutCrashingFunction(void (*function)()) {
+void SetDumpWithoutCrashingFunction(void (CDECL *function)()) {
dump_without_crashing_function_ = function;
}
-#endif
-} // namespace logging
+} // namespace debug
+
+} // namespace base
« no previous file with comments | « base/debug/dump_without_crashing.h ('k') | base/native_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698