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

Unified Diff: chrome/common/child_process_logging_posix.cc

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/common/child_process_logging_mac.mm ('k') | chrome/common/child_process_logging_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/child_process_logging_posix.cc
diff --git a/chrome/common/child_process_logging_posix.cc b/chrome/common/child_process_logging_posix.cc
index 2015256fb7529aecd6dbf917e36d46f683499a32..916d2e9726985f95a63b749127b02dfb380f1204 100644
--- a/chrome/common/child_process_logging_posix.cc
+++ b/chrome/common/child_process_logging_posix.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/format_macros.h"
#include "base/string_number_conversions.h"
+#include "base/string_split.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/installer/util/google_update_settings.h"
@@ -29,13 +30,14 @@ char g_client_id[kClientIdSize];
char g_channel[kChannelSize] = "";
static const size_t kGpuStringSize = 32;
-
char g_gpu_vendor_id[kGpuStringSize] = "";
char g_gpu_device_id[kGpuStringSize] = "";
char g_gpu_driver_ver[kGpuStringSize] = "";
char g_gpu_ps_ver[kGpuStringSize] = "";
char g_gpu_vs_ver[kGpuStringSize] = "";
+char g_printer_info[kPrinterInfoStrLen * kMaxReportedPrinterRecords + 1] = "";
+
static const size_t kNumSize = 32;
char g_num_extensions[kNumSize] = "";
char g_num_switches[kNumSize] = "";
@@ -103,6 +105,22 @@ void SetGpuInfo(const content::GPUInfo& gpu_info) {
g_gpu_vs_ver[kGpuStringSize - 1] = '\0';
}
+void SetPrinterInfo(const char* printer_info) {
+ std::string printer_info_str;
+ std::vector<std::string> info;
+ base::SplitString(printer_info, L';', &info);
+ DCHECK_LE(info.size(), kMaxReportedPrinterRecords);
+ info.resize(kMaxReportedPrinterRecords);
+ for (size_t i = 0; i < info.size(); ++i) {
+ printer_info_str += info[i];
+ // Truncate long switches, align short ones with spaces to be trimmed later.
+ printer_info_str.resize((i + 1) * kPrinterInfoStrLen, ' ');
+ }
+ strncpy(g_printer_info, printer_info_str.c_str(),
+ arraysize(g_printer_info) - 1);
+ g_printer_info[arraysize(g_printer_info) - 1] = '\0';
+}
+
void SetNumberOfViews(int number_of_views) {
snprintf(g_num_views, kNumSize - 1, "%d", number_of_views);
g_num_views[kNumSize - 1] = '\0';
« no previous file with comments | « chrome/common/child_process_logging_mac.mm ('k') | chrome/common/child_process_logging_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698