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 |