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) |
} |