| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 return &g_instance.Get(); | 146 return &g_instance.Get(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 // Returns the Custom information to be used for crash reporting. | 149 // Returns the Custom information to be used for crash reporting. |
| 150 google_breakpad::CustomClientInfo* BreakpadWin::GetCustomInfo() { | 150 google_breakpad::CustomClientInfo* BreakpadWin::GetCustomInfo() { |
| 151 HMODULE binary = base::GetModuleFromAddress( | 151 HMODULE binary = base::GetModuleFromAddress( |
| 152 reinterpret_cast<void*>(&remoting::InitializeCrashReporting)); | 152 reinterpret_cast<void*>(&remoting::InitializeCrashReporting)); |
| 153 scoped_ptr<FileVersionInfo> version_info( | 153 scoped_ptr<FileVersionInfo> version_info( |
| 154 FileVersionInfo::CreateFileVersionInfoForModule(binary)); | 154 FileVersionInfo::CreateFileVersionInfoForModule(binary)); |
| 155 | 155 |
| 156 // presubmit: allow wstring |
| 156 std::wstring version; | 157 std::wstring version; |
| 157 if (version_info.get()) | 158 if (version_info.get()) |
| 158 version = UTF16ToWide(version_info->product_version()); | 159 version = UTF16ToWide(version_info->product_version()); |
| 159 if (version.empty()) | 160 if (version.empty()) |
| 160 version = kBreakpadVersionDefault; | 161 version = kBreakpadVersionDefault; |
| 161 | 162 |
| 162 static google_breakpad::CustomInfoEntry ver_entry( | 163 static google_breakpad::CustomInfoEntry ver_entry( |
| 163 kBreakpadVersionEntry, version.c_str()); | 164 kBreakpadVersionEntry, version.c_str()); |
| 164 static google_breakpad::CustomInfoEntry prod_entry( | 165 static google_breakpad::CustomInfoEntry prod_entry( |
| 165 kBreakpadProdEntry, kBreakpadProductName); | 166 kBreakpadProdEntry, kBreakpadProductName); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // Touch the object to make sure it is initialized. | 205 // Touch the object to make sure it is initialized. |
| 205 BreakpadWin::GetInstance(); | 206 BreakpadWin::GetInstance(); |
| 206 } | 207 } |
| 207 | 208 |
| 208 void InitializeCrashReportingForTest(const wchar_t* pipe_name) { | 209 void InitializeCrashReportingForTest(const wchar_t* pipe_name) { |
| 209 BreakpadWin::pipe_name_ = pipe_name; | 210 BreakpadWin::pipe_name_ = pipe_name; |
| 210 InitializeCrashReporting(); | 211 InitializeCrashReporting(); |
| 211 } | 212 } |
| 212 | 213 |
| 213 } // namespace remoting | 214 } // namespace remoting |
| OLD | NEW |