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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 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.
4
5 #include "base/debug/dump_without_crashing.h"
6
7 #include "base/logging.h"
8
9 namespace {
10
11 // Pointer to the function that's called by DumpWithoutCrashing() to dump the
12 // process's memory.
13 #if defined(OS_POSIX)
14 void (*dump_without_crashing_function_)() = NULL;
15 #elif defined(OS_WIN)
16 void (__cdecl *dump_without_crashing_function_)() = NULL;
Mark Mentovai 2013/12/17 20:12:09 All of these #ifdefs just for __cdecl. It’d read m
17 #endif
18
19 } // namespace
20
21 namespace base {
22
23 namespace debug {
24
25 void DumpWithoutCrashing() {
26 #if defined(OS_WIN) || defined(OS_POSIX)
27 if (dump_without_crashing_function_)
28 (*dump_without_crashing_function_)();
29 #else
30 NOTIMPLEMENTED();
31 #endif
32 }
33
34 #if defined(OS_POSIX)
35 void SetDumpWithoutCrashingFunction(void (*function)()) {
36 dump_without_crashing_function_ = function;
37 }
38 #elif defined(OS_WIN)
39 void SetDumpWithoutCrashingFunction(void (__cdecl *function)()) {
40 dump_without_crashing_function_ = function;
41 }
42 #endif
43
44 } // namespace debug
45
46 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698