OLD | NEW |
1 | 1 |
2 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 2 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 // crash_report.cc : Implementation crash reporting. | 6 // crash_report.cc : Implementation crash reporting. |
7 #include "chrome_frame/crash_reporting/crash_report.h" | 7 #include "chrome_frame/crash_reporting/crash_report.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/lock.h" | 10 #include "base/lock.h" |
11 #include "breakpad/src/client/windows/handler/exception_handler.h" | 11 #include "breakpad/src/client/windows/handler/exception_handler.h" |
12 | 12 |
13 // TODO(joshia): factor out common code with chrome used for crash reporting | 13 // TODO(joshia): factor out common code with chrome used for crash reporting |
14 const wchar_t kGoogleUpdatePipeName[] = L"\\\\.\\pipe\\GoogleCrashServices\\"; | 14 const wchar_t kGoogleUpdatePipeName[] = L"\\\\.\\pipe\\GoogleCrashServices\\"; |
15 static google_breakpad::ExceptionHandler * g_breakpad = NULL; | 15 |
| 16 // This lock protects against concurrent access to g_breakpad. |
16 static Lock g_breakpad_lock; | 17 static Lock g_breakpad_lock; |
| 18 static google_breakpad::ExceptionHandler* g_breakpad = NULL; |
17 | 19 |
18 // These minidump flag combinations have been tested safe agains the | 20 // These minidump flag combinations have been tested safe against the |
19 // DbgHelp.dll version that ships with Windows XP SP2. | 21 // DbgHelp.dll version that ships with Windows XP SP2. |
20 const MINIDUMP_TYPE kSmallDumpType = static_cast<MINIDUMP_TYPE>( | 22 const MINIDUMP_TYPE kSmallDumpType = static_cast<MINIDUMP_TYPE>( |
21 MiniDumpWithProcessThreadData | // Get PEB and TEB. | 23 MiniDumpWithProcessThreadData | // Get PEB and TEB. |
22 MiniDumpWithUnloadedModules); // Get unloaded modules when available. | 24 MiniDumpWithUnloadedModules); // Get unloaded modules when available. |
23 | 25 |
24 const MINIDUMP_TYPE kLargerDumpType = static_cast<MINIDUMP_TYPE>( | 26 const MINIDUMP_TYPE kLargerDumpType = static_cast<MINIDUMP_TYPE>( |
25 MiniDumpWithProcessThreadData | // Get PEB and TEB. | 27 MiniDumpWithProcessThreadData | // Get PEB and TEB. |
26 MiniDumpWithUnloadedModules | // Get unloaded modules when available. | 28 MiniDumpWithUnloadedModules | // Get unloaded modules when available. |
27 MiniDumpWithIndirectlyReferencedMemory); // Get memory referenced by stack. | 29 MiniDumpWithIndirectlyReferencedMemory); // Get memory referenced by stack. |
28 | 30 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 198 } |
197 | 199 |
198 bool WriteMinidumpForException(EXCEPTION_POINTERS* p) { | 200 bool WriteMinidumpForException(EXCEPTION_POINTERS* p) { |
199 AutoLock lock(g_breakpad_lock); | 201 AutoLock lock(g_breakpad_lock); |
200 bool success = false; | 202 bool success = false; |
201 if (g_breakpad) { | 203 if (g_breakpad) { |
202 success = g_breakpad->WriteMinidumpForException(p); | 204 success = g_breakpad->WriteMinidumpForException(p); |
203 } | 205 } |
204 return success; | 206 return success; |
205 } | 207 } |
OLD | NEW |