summaryrefslogtreecommitdiffstats
path: root/chrome/common/child_process_logging_mac.mm
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-16 04:49:14 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-16 04:49:14 +0000
commit6724e59196711af2848b725b9b44d3dd3e632608 (patch)
tree8895f22d1cae9d432ee2f55890d1f853ce7b740a /chrome/common/child_process_logging_mac.mm
parentabc77243c735ff8b44deac96a5fc81fd9788b2c9 (diff)
downloadchromium_src-6724e59196711af2848b725b9b44d3dd3e632608.zip
chromium_src-6724e59196711af2848b725b9b44d3dd3e632608.tar.gz
chromium_src-6724e59196711af2848b725b9b44d3dd3e632608.tar.bz2
Added SetPrinterInfo to include information about printer driver. This information will be added by Chrome (in different CL) just before performing error-prone printer related operations.
BUG=108194 TEST=none Review URL: http://codereview.chromium.org/9600060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/child_process_logging_mac.mm')
-rw-r--r--chrome/common/child_process_logging_mac.mm15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/common/child_process_logging_mac.mm b/chrome/common/child_process_logging_mac.mm
index 0541977..b8c57e1 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,6 +165,19 @@ 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);
+ info.resize(kMaxReportedPrinterRecords);
+ for (size_t i = 0; i < info.size(); ++i) {
+ NSString* key = [NSString stringWithFormat:kPrinterInfoNameFormat, i];
+ ClearCrashKey(key);
+ if (!info[i].empty()) {
+ NSString *value = [NSString stringWithUTF8String:info[i].c_str()];
+ SetCrashKeyValue(key, value);
+ }
+ }
+}
void SetNumberOfViewsImpl(int number_of_views,
SetCrashKeyValueFuncPtr set_key_func) {