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

Unified Diff: trunk/src/chrome/app/breakpad_win.cc

Issue 23503070: Revert 223610 "Set the printer info in crash reports using the c..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/app/breakpad_win.cc
===================================================================
--- trunk/src/chrome/app/breakpad_win.cc (revision 223612)
+++ trunk/src/chrome/app/breakpad_win.cc (working copy)
@@ -105,6 +105,7 @@
char* g_real_terminate_process_stub = NULL;
static size_t g_client_id_offset = 0;
+static size_t g_printer_info_offset = 0;
static size_t g_num_switches_offset = 0;
static size_t g_switches_offset = 0;
static size_t g_dynamic_keys_offset = 0;
@@ -457,6 +458,16 @@
g_custom_entries->push_back(google_breakpad::CustomInfoEntry(
L"special", UTF16ToWide(special_build).c_str()));
+ // Add empty values for the prn_info-*. We'll put the actual values when we
+ // collect them at this location.
+ g_printer_info_offset = g_custom_entries->size();
+ // one-based index for the name suffix.
+ for (size_t i = 1; i <= kMaxReportedPrinterRecords; ++i) {
+ g_custom_entries->push_back(
+ google_breakpad::CustomInfoEntry(
+ base::StringPrintf(L"prn-info-%d", i).c_str(), L""));
+ }
+
// Read the id from registry. If reporting has never been enabled
// the result will be empty string. Its OK since when user enables reporting
// we will insert the new value at this location.
@@ -642,6 +653,21 @@
google_breakpad::CustomInfoEntry::kValueMaxLength);
}
+extern "C" void __declspec(dllexport) __cdecl SetPrinterInfo(
+ const wchar_t* printer_info) {
+ if (!g_custom_entries)
+ return;
+ std::vector<string16> info;
+ base::SplitString(printer_info, L';', &info);
+ DCHECK_LE(info.size(), kMaxReportedPrinterRecords);
+ info.resize(kMaxReportedPrinterRecords);
+ for (size_t i = 0; i < info.size(); ++i) {
+ base::wcslcpy((*g_custom_entries)[g_printer_info_offset + i].value,
+ info[i].c_str(),
+ google_breakpad::CustomInfoEntry::kValueMaxLength);
+ }
+}
+
// NOTE: This function is used by SyzyASAN to annotate crash reports. If you
// change the name or signature of this function you will break SyzyASAN
// instrumented releases of Chrome. Please contact syzygy-team@chromium.org
« no previous file with comments | « trunk/src/chrome/app/breakpad_linux.cc ('k') | trunk/src/chrome/browser/printing/print_system_task_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698