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

Unified Diff: chrome/common/child_process_logging_mac.mm

Issue 3186028: Make crash reporting client_id accessible through child_process_logging. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: address mark's feedback Created 10 years, 4 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
diff --git a/chrome/common/child_process_logging_mac.mm b/chrome/common/child_process_logging_mac.mm
index a53b4ed032370f87f8638c182f78b1c80c119619..04f4ca4e288c0706a80c5a31c08714e3d15a1766 100644
--- a/chrome/common/child_process_logging_mac.mm
+++ b/chrome/common/child_process_logging_mac.mm
@@ -28,6 +28,10 @@ const char *kGPUVertexShaderVersionParamName = "vsver";
static SetCrashKeyValueFuncPtr g_set_key_func;
static ClearCrashKeyValueFuncPtr g_clear_key_func;
+// Account for the terminating null character.
+static const size_t kClientIdSize = 32 + 1;
+static char g_client_id[kClientIdSize];
+
void SetCrashKeyFunctions(SetCrashKeyValueFuncPtr set_key_func,
ClearCrashKeyValueFuncPtr clear_key_func) {
g_set_key_func = set_key_func;
@@ -93,6 +97,7 @@ void SetClientId(const std::string& client_id) {
std::string str(client_id);
ReplaceSubstringsAfterOffset(&str, 0, "-", "");
+ base::strlcpy(g_client_id, str.c_str(), kClientIdSize);
if (g_set_key_func)
SetClientIdImpl(str, g_set_key_func);
@@ -100,6 +105,10 @@ void SetClientId(const std::string& client_id) {
GoogleUpdateSettings::SetMetricsId(wstr);
}
+std::string GetClientId() {
+ return std::string(g_client_id);
+}
+
void SetActiveExtensions(const std::set<std::string>& extension_ids) {
// TODO(port)
}
« 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