Index: chrome/common/child_process_logging_linux.cc |
diff --git a/chrome/common/child_process_logging_linux.cc b/chrome/common/child_process_logging_linux.cc |
index 40ad90c0d8dee3b8e87c6d149f21112ec9ce9c02..d8f216e36840c692297202af4fb00da51fdf6c5b 100644 |
--- a/chrome/common/child_process_logging_linux.cc |
+++ b/chrome/common/child_process_logging_linux.cc |
@@ -13,12 +13,20 @@ |
namespace child_process_logging { |
-// We use a static string to hold the most recent active url. If we crash, the |
-// crash handler code will send the contents of this string to the browser. |
-std::string active_url; |
+// Account for the terminating null character. |
+static const size_t kMaxActiveURLSize = 1024 + 1; |
+static const size_t kClientIdSize = 32 + 1; |
+ |
+// We use static strings to hold the most recent active url and the client |
+// identifier. If we crash, the crash handler code will send the contents of |
+// these strings to the browser. |
+char g_active_url[kMaxActiveURLSize]; |
+char g_client_id[kClientIdSize]; |
void SetActiveURL(const GURL& url) { |
- active_url = url.possibly_invalid_spec(); |
+ base::strlcpy(g_active_url, |
+ url.possibly_invalid_spec().c_str(), |
+ kMaxActiveURLSize); |
} |
void SetClientId(const std::string& client_id) { |
@@ -28,10 +36,15 @@ void SetClientId(const std::string& client_id) { |
if (str.empty()) |
return; |
+ base::strlcpy(g_client_id, str.c_str(), kClientIdSize); |
std::wstring wstr = ASCIIToWide(str); |
GoogleUpdateSettings::SetMetricsId(wstr); |
} |
+std::string GetClientId() { |
+ return std::string(g_client_id); |
+} |
+ |
void SetActiveExtensions(const std::set<std::string>& extension_ids) { |
// TODO(port) |
} |