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

Unified Diff: chrome/common/child_process_logging.h

Issue 9600060: SetPrinterInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
« no previous file with comments | « chrome/app/breakpad_win.cc ('k') | chrome/common/child_process_logging_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/child_process_logging.h
diff --git a/chrome/common/child_process_logging.h b/chrome/common/child_process_logging.h
index 6b68d8ce95a44b866a783fb0e1793207500270ed..ab3750d535c33b056ba5f63236a234909fad4d9b 100644
--- a/chrome/common/child_process_logging.h
+++ b/chrome/common/child_process_logging.h
@@ -24,6 +24,9 @@ struct GPUInfo;
// dependency.
static const int kMaxReportedActiveExtensions = 10;
+// 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.
@@ -48,6 +51,7 @@ extern char g_gpu_vs_ver[];
extern char g_num_extensions[];
extern char g_num_switches[];
extern char g_num_views[];
+extern char g_printer_info[];
extern char g_switches[];
// Assume IDs are 32 bytes long.
@@ -55,6 +59,9 @@ static const size_t kExtensionLen = 32;
// 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 URL that is logged if the child process crashes. Use GURL() to clear
@@ -82,6 +89,11 @@ void SetNumberOfViews(int number_of_views);
// Sets the data on the gpu to send along with crash reports.
void SetGpuInfo(const content::GPUInfo& gpu_info);
+// 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);
@@ -107,6 +119,21 @@ class ScopedActiveURLSetter {
DISALLOW_COPY_AND_ASSIGN(ScopedActiveURLSetter);
};
+// 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_MACOSX)
« no previous file with comments | « chrome/app/breakpad_win.cc ('k') | chrome/common/child_process_logging_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698