1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "build/build_config.h"
7 #include "chrome/common/dump_without_crashing.h"
9 #include "base/logging.h"
10 #include "chrome/common/chrome_constants.h"
19 // Pointer to the function that's called by DumpWithoutCrashing() to dump the
21 void (*dump_without_crashing_function_)() = NULL;
28 void DumpWithoutCrashing() {
30 // Get the breakpad pointer from chrome.exe
31 typedef void (__cdecl *DumpProcessFunction)();
32 DumpProcessFunction DumpProcess = reinterpret_cast<DumpProcessFunction>(
33 ::GetProcAddress(::GetModuleHandle(chrome::kBrowserProcessExecutableName),
34 "DumpProcessWithoutCrash"));
37 #elif defined(OS_POSIX)
38 if (dump_without_crashing_function_)
39 (*dump_without_crashing_function_)();
46 void SetDumpWithoutCrashingFunction(void (*function)()) {
47 dump_without_crashing_function_ = function;
51 } // namespace logging