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

Unified Diff: chrome/common/child_process_logging_mac.mm

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
Index: chrome/common/child_process_logging_mac.mm
diff --git a/chrome/common/child_process_logging_mac.mm b/chrome/common/child_process_logging_mac.mm
index 0541977bf55d7102349866ba91707d30af2d1845..7996a7d4f1e3e7986459773da570df9380f2c96e 100644
--- a/chrome/common/child_process_logging_mac.mm
+++ b/chrome/common/child_process_logging_mac.mm
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/string_number_conversions.h"
+#include "base/string_split.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/sys_string_conversions.h"
@@ -36,6 +37,7 @@ const char *kGPUGLVersionParamName = "gpu-glver";
const char *kNumberOfViews = "num-views";
NSString* const kNumExtensionsName = @"num-extensions";
NSString* const kExtensionNameFormat = @"extension-%d";
+NSString* const kPrinterInfoNameFormat = @"prn-info-%d";
// Account for the terminating null character.
static const size_t kClientIdSize = 32 + 1;
@@ -163,12 +165,23 @@ void SetGpuInfo(const content::GPUInfo& gpu_info) {
SetGpuInfoImpl(gpu_info, SetCrashKeyValue);
}
+void SetPrinterInfo(const char* printer_info) {
+ std::vector<std::string> info;
+ base::SplitString(printer_info, L';', &info);
+ DCHECK(info.size() <= kMaxReportedPrinterRecords);
Scott Hess - ex-Googler 2012/03/14 04:36:07 DCHECK_LE().
Vitaly Buka (NO REVIEWS) 2012/03/14 20:37:42 Done.
+ for (size_t i = 0; i < std::min(kMaxReportedPrinterRecords, info.size());
Scott Hess - ex-Googler 2012/03/14 04:36:07 Since your vector is local, rather than using std:
Vitaly Buka (NO REVIEWS) 2012/03/14 20:37:42 Done.
+ ++i) {
+ NSString* key = [NSString stringWithFormat:kPrinterInfoNameFormat, i];
+ NSString *value = [NSString stringWithUTF8String:info[i].c_str()];
+ SetCrashKeyValue(key, value);
+ }
+}
void SetNumberOfViewsImpl(int number_of_views,
SetCrashKeyValueFuncPtr set_key_func) {
NSString *key = [NSString stringWithUTF8String:kNumberOfViews];
NSString *value = [NSString stringWithFormat:@"%d", number_of_views];
- set_key_func(key, value);
+ SetCrashKeyValue(key, value);
Scott Hess - ex-Googler 2012/03/14 04:36:07 If you're going to change this line, then pull thi
Vitaly Buka (NO REVIEWS) 2012/03/14 20:37:42 Sorry, it was not intended. Probably changed editi
}
void SetNumberOfViews(int number_of_views) {

Powered by Google App Engine
This is Rietveld 408576698