| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This module contains the necessary code to register the Breakpad exception | 5 // This module contains the necessary code to register the Breakpad exception |
| 6 // handler. This implementation is based on Chrome/Chrome Frame crash reporting | 6 // handler. This implementation is based on Chrome/Chrome Frame crash reporting |
| 7 // code. See: | 7 // code. See: |
| 8 // - src/chrome/app/breakpad_win.cc | 8 // - src/chrome/app/breakpad_win.cc |
| 9 // - src/chrome_frame/crash_server_init.cc | 9 // - src/chrome_frame/crash_server_init.cc |
| 10 // - src/chrome/installer/setup/setup_main.cc | 10 // - src/chrome/installer/setup/setup_main.cc |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 public: | 58 public: |
| 59 BreakpadWin(); | 59 BreakpadWin(); |
| 60 ~BreakpadWin(); | 60 ~BreakpadWin(); |
| 61 | 61 |
| 62 static BreakpadWin* GetInstance(); | 62 static BreakpadWin* GetInstance(); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 // Returns the Custom information to be used for crash reporting. | 65 // Returns the Custom information to be used for crash reporting. |
| 66 google_breakpad::CustomClientInfo* GetCustomInfo(); | 66 google_breakpad::CustomClientInfo* GetCustomInfo(); |
| 67 | 67 |
| 68 // Checks whether crash dump collection is allowed by the user. | |
| 69 bool IsCrashReportingEnabled(); | |
| 70 | |
| 71 // This callback is executed when the process has crashed and *before* | 68 // This callback is executed when the process has crashed and *before* |
| 72 // the crash dump is created. To prevent duplicate crash reports we | 69 // the crash dump is created. To prevent duplicate crash reports we |
| 73 // make every thread calling this method, except the very first one, | 70 // make every thread calling this method, except the very first one, |
| 74 // go to sleep. | 71 // go to sleep. |
| 75 static bool OnExceptionCallback(void* context, | 72 static bool OnExceptionCallback(void* context, |
| 76 EXCEPTION_POINTERS* exinfo, | 73 EXCEPTION_POINTERS* exinfo, |
| 77 MDRawAssertionInfo* assertion); | 74 MDRawAssertionInfo* assertion); |
| 78 | 75 |
| 79 // Crashes the process after generating a dump for the provided exception. | 76 // Crashes the process after generating a dump for the provided exception. |
| 80 // Note that the crash reporter should be initialized before calling this | 77 // Note that the crash reporter should be initialized before calling this |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // Touch the object to make sure it is initialized. | 204 // Touch the object to make sure it is initialized. |
| 208 BreakpadWin::GetInstance(); | 205 BreakpadWin::GetInstance(); |
| 209 } | 206 } |
| 210 | 207 |
| 211 void InitializeCrashReportingForTest(const wchar_t* pipe_name) { | 208 void InitializeCrashReportingForTest(const wchar_t* pipe_name) { |
| 212 BreakpadWin::pipe_name_ = pipe_name; | 209 BreakpadWin::pipe_name_ = pipe_name; |
| 213 InitializeCrashReporting(); | 210 InitializeCrashReporting(); |
| 214 } | 211 } |
| 215 | 212 |
| 216 } // namespace remoting | 213 } // namespace remoting |
| OLD | NEW |