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

Unified Diff: chrome/common/child_process_logging_mac.mm

Issue 3034004: Adding gpu_info to the breakpad info collection before sending off a crash.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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_linux.cc ('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_mac.mm
===================================================================
--- chrome/common/child_process_logging_mac.mm (revision 52838)
+++ chrome/common/child_process_logging_mac.mm (working copy)
@@ -7,6 +7,7 @@
#import <Foundation/Foundation.h>
#include "base/string_util.h"
+#include "chrome/common/gpu_info.h"
#include "chrome/installer/util/google_update_settings.h"
#include "googleurl/src/gurl.h"
@@ -16,6 +17,11 @@
const int kMaxNumURLChunkValueLength = 255;
const char *kUrlChunkFormatStr = "url-chunk-%d";
const char *kGuidParamName = "guid";
+const char *kGPUVendorIdParamName = "vendid";
+const char *kGPUDeviceIdParamName = "devid";
+const char *kGPUDriverVersionParamName = "driver";
+const char *kGPUPixelShaderVersionParamName = "psver";
+const char *kGPUVertexShaderVersionParamName = "vsver";
static SetCrashKeyValueFuncPtr g_set_key_func;
static ClearCrashKeyValueFuncPtr g_clear_key_func;
@@ -96,4 +102,35 @@
// TODO(port)
}
+void SetGpuKeyValue(const char* param_name, const std::string& value_str,
+ SetCrashKeyValueFuncPtr set_key_func) {
+ NSString *key = [NSString stringWithUTF8String:param_name];
+ NSString *value = [NSString stringWithUTF8String:value_str.c_str()];
+ set_key_func(key, value);
+}
+
+void SetGpuInfoImpl(const GPUInfo& gpu_info,
+ SetCrashKeyValueFuncPtr set_key_func) {
+ SetGpuKeyValue(kGPUVendorIdParamName,
+ UintToString(gpu_info.vendor_id()),
+ set_key_func);
+ SetGpuKeyValue(kGPUDeviceIdParamName,
+ UintToString(gpu_info.device_id()),
+ set_key_func);
+ SetGpuKeyValue(kGPUDriverVersionParamName,
+ WideToASCII(gpu_info.driver_version()),
+ set_key_func);
+ SetGpuKeyValue(kGPUPixelShaderVersionParamName,
+ UintToString(gpu_info.pixel_shader_version()),
+ set_key_func);
+ SetGpuKeyValue(kGPUVertexShaderVersionParamName,
+ UintToString(gpu_info.vertex_shader_version()),
+ set_key_func);
+}
+
+void SetGpuInfo(const GPUInfo& gpu_info) {
+ if (g_set_key_func)
+ SetGpuInfoImpl(gpu_info, g_set_key_func);
+}
+
} // namespace child_process_logging
« no previous file with comments | « chrome/common/child_process_logging_linux.cc ('k') | chrome/common/child_process_logging_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698