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

Unified Diff: trunk/src/chrome/common/child_process_logging.h

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/common/child_process_logging.h
===================================================================
--- trunk/src/chrome/common/child_process_logging.h (revision 223612)
+++ trunk/src/chrome/common/child_process_logging.h (working copy)
@@ -25,6 +25,9 @@
// limit of google_breakpad::CustomInfoEntry::kValueMaxLength.
static const size_t kMaxVariationChunkSize = 64;
+// The maximum number of prn-info-* records.
+static const size_t kMaxReportedPrinterRecords = 4;
+
// The maximum number of command line switches to include in the crash
// report's metadata. Note that the mini-dump itself will also contain the
// (original) command line arguments within the PEB.
@@ -40,11 +43,15 @@
extern char g_client_id[];
extern char g_num_switches[];
extern char g_num_variations[];
+extern char g_printer_info[];
extern char g_switches[];
extern char g_variation_chunks[];
// Assume command line switches are less than 64 chars.
static const size_t kSwitchLen = 64;
+
+// Assume printer info strings are less than 64 chars.
+static const size_t kPrinterInfoStrLen = 64;
#endif
// Sets the Client ID that is used as GUID if a Chrome process crashes.
@@ -54,6 +61,11 @@
// id in |client_id| if it's known, an empty string otherwise.
std::string GetClientId();
+// Sets the data on the printer to send along with crash reports. Data may be
+// separated by ';' up to kMaxReportedPrinterRecords strings. Each substring
+// would be cut to 63 chars.
+void SetPrinterInfo(const char* printer_info);
+
// Sets the command line arguments to send along with crash reports to the
// values in |command_line|.
void SetCommandLine(const CommandLine* command_line);
@@ -61,6 +73,21 @@
// Initialize the list of experiment info to send along with crash reports.
void SetExperimentList(const std::vector<string16>& state);
+// Set/clear information about currently accessed printer.
+class ScopedPrinterInfoSetter {
+ public:
+ explicit ScopedPrinterInfoSetter(const std::string& printer_info) {
+ SetPrinterInfo(printer_info.c_str());
+ }
+
+ ~ScopedPrinterInfoSetter() {
+ SetPrinterInfo("");
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScopedPrinterInfoSetter);
+};
+
} // namespace child_process_logging
#if defined(OS_WIN)
« no previous file with comments | « trunk/src/chrome/browser/printing/print_system_task_proxy.cc ('k') | trunk/src/chrome/common/child_process_logging_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698