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

Unified Diff: chrome/common/child_process_logging_linux.cc

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.h ('k') | chrome/common/child_process_logging_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
}
« no previous file with comments | « chrome/common/child_process_logging.h ('k') | chrome/common/child_process_logging_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698