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 #include "chrome_frame/crash_metrics.h" | 12 #include "chrome_frame/crash_reporting/crash_metrics.h" |
13 | 13 |
14 // TODO(joshia): factor out common code with chrome used for crash reporting | 14 // TODO(joshia): factor out common code with chrome used for crash reporting |
15 const wchar_t kGoogleUpdatePipeName[] = L"\\\\.\\pipe\\GoogleCrashServices\\"; | 15 const wchar_t kGoogleUpdatePipeName[] = L"\\\\.\\pipe\\GoogleCrashServices\\"; |
16 | 16 |
17 // This lock protects against concurrent access to g_breakpad. | 17 // This lock protects against concurrent access to g_breakpad. |
18 static Lock g_breakpad_lock; | 18 static Lock g_breakpad_lock; |
19 static google_breakpad::ExceptionHandler* g_breakpad = NULL; | 19 static google_breakpad::ExceptionHandler* g_breakpad = NULL; |
20 | 20 |
21 // These minidump flag combinations have been tested safe against the | 21 // These minidump flag combinations have been tested safe against the |
22 // DbgHelp.dll version that ships with Windows XP SP2. | 22 // DbgHelp.dll version that ships with Windows XP SP2. |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 bool WriteMinidumpForException(EXCEPTION_POINTERS* p) { | 174 bool WriteMinidumpForException(EXCEPTION_POINTERS* p) { |
175 AutoLock lock(g_breakpad_lock); | 175 AutoLock lock(g_breakpad_lock); |
176 CrashMetricsReporter::GetInstance()->IncrementMetric( | 176 CrashMetricsReporter::GetInstance()->IncrementMetric( |
177 CrashMetricsReporter::CRASH_COUNT); | 177 CrashMetricsReporter::CRASH_COUNT); |
178 bool success = false; | 178 bool success = false; |
179 if (g_breakpad) { | 179 if (g_breakpad) { |
180 success = g_breakpad->WriteMinidumpForException(p); | 180 success = g_breakpad->WriteMinidumpForException(p); |
181 } | 181 } |
182 return success; | 182 return success; |
183 } | 183 } |
OLD | NEW |