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 crash reporting code. See: | 6 // handler. This implementation is based on Chrome crash reporting code. See: |
7 // - src/components/breakpad/app/breakpad_win.cc | 7 // - src/components/breakpad/app/breakpad_win.cc |
8 // - src/chrome/installer/setup/setup_main.cc | 8 // - src/chrome/installer/setup/setup_main.cc |
9 | 9 |
10 #include "remoting/base/breakpad.h" | 10 #include "remoting/base/breakpad.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 // Returns the Custom information to be used for crash reporting. | 144 // Returns the Custom information to be used for crash reporting. |
145 google_breakpad::CustomClientInfo* BreakpadWin::GetCustomInfo() { | 145 google_breakpad::CustomClientInfo* BreakpadWin::GetCustomInfo() { |
146 HMODULE binary = base::GetModuleFromAddress( | 146 HMODULE binary = base::GetModuleFromAddress( |
147 reinterpret_cast<void*>(&remoting::InitializeCrashReporting)); | 147 reinterpret_cast<void*>(&remoting::InitializeCrashReporting)); |
148 scoped_ptr<FileVersionInfo> version_info( | 148 scoped_ptr<FileVersionInfo> version_info( |
149 FileVersionInfo::CreateFileVersionInfoForModule(binary)); | 149 FileVersionInfo::CreateFileVersionInfoForModule(binary)); |
150 | 150 |
151 static wchar_t version[64]; | 151 static wchar_t version[64]; |
152 if (version_info.get()) { | 152 if (version_info.get()) { |
153 wcscpy_s(version, | 153 wcscpy_s(version, version_info->product_version().c_str()); |
154 base::UTF16ToWide(version_info->product_version()).c_str()); | |
155 } else { | 154 } else { |
156 wcscpy_s(version, kBreakpadVersionDefault); | 155 wcscpy_s(version, kBreakpadVersionDefault); |
157 } | 156 } |
158 | 157 |
159 static google_breakpad::CustomInfoEntry ver_entry( | 158 static google_breakpad::CustomInfoEntry ver_entry( |
160 kBreakpadVersionEntry, version); | 159 kBreakpadVersionEntry, version); |
161 static google_breakpad::CustomInfoEntry prod_entry( | 160 static google_breakpad::CustomInfoEntry prod_entry( |
162 kBreakpadProdEntry, kBreakpadProductName); | 161 kBreakpadProdEntry, kBreakpadProductName); |
163 static google_breakpad::CustomInfoEntry plat_entry( | 162 static google_breakpad::CustomInfoEntry plat_entry( |
164 kBreakpadPlatformEntry, kBreakpadPlatformWin32); | 163 kBreakpadPlatformEntry, kBreakpadPlatformWin32); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // Touch the object to make sure it is initialized. | 200 // Touch the object to make sure it is initialized. |
202 BreakpadWin::GetInstance(); | 201 BreakpadWin::GetInstance(); |
203 } | 202 } |
204 | 203 |
205 void InitializeCrashReportingForTest(const wchar_t* pipe_name) { | 204 void InitializeCrashReportingForTest(const wchar_t* pipe_name) { |
206 BreakpadWin::pipe_name_ = pipe_name; | 205 BreakpadWin::pipe_name_ = pipe_name; |
207 InitializeCrashReporting(); | 206 InitializeCrashReporting(); |
208 } | 207 } |
209 | 208 |
210 } // namespace remoting | 209 } // namespace remoting |
OLD | NEW |