Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Side by Side Diff: remoting/base/breakpad_win.cc

Issue 10824166: Cleaned up usage of std::wstring in src/remoting. Added presubmit warning supressions for the reman… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « PRESUBMIT.py ('k') | remoting/host/host_event_logger_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 std::wstring version; 156 static wchar_t version[64];
157 if (version_info.get()) 157 if (version_info.get()) {
158 version = UTF16ToWide(version_info->product_version()); 158 wcscpy_s(version, UTF16ToWide(version_info->product_version()).c_str());
159 if (version.empty()) 159 } else {
160 version = kBreakpadVersionDefault; 160 wcscpy_s(version, kBreakpadVersionDefault);
161 }
161 162
162 static google_breakpad::CustomInfoEntry ver_entry( 163 static google_breakpad::CustomInfoEntry ver_entry(
163 kBreakpadVersionEntry, version.c_str()); 164 kBreakpadVersionEntry, version);
164 static google_breakpad::CustomInfoEntry prod_entry( 165 static google_breakpad::CustomInfoEntry prod_entry(
165 kBreakpadProdEntry, kBreakpadProductName); 166 kBreakpadProdEntry, kBreakpadProductName);
166 static google_breakpad::CustomInfoEntry plat_entry( 167 static google_breakpad::CustomInfoEntry plat_entry(
167 kBreakpadPlatformEntry, kBreakpadPlatformWin32); 168 kBreakpadPlatformEntry, kBreakpadPlatformWin32);
168 static google_breakpad::CustomInfoEntry entries[] = { 169 static google_breakpad::CustomInfoEntry entries[] = {
169 ver_entry, prod_entry, plat_entry }; 170 ver_entry, prod_entry, plat_entry };
170 static google_breakpad::CustomClientInfo custom_info = { 171 static google_breakpad::CustomClientInfo custom_info = {
171 entries, arraysize(entries) }; 172 entries, arraysize(entries) };
172 return &custom_info; 173 return &custom_info;
173 } 174 }
(...skipping 30 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « PRESUBMIT.py ('k') | remoting/host/host_event_logger_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698