From 157d547807a2b9d0e42f17636ffc39336a9a62f6 Mon Sep 17 00:00:00 2001 From: "kuchhal@chromium.org" Date: Thu, 5 Nov 2009 22:31:03 +0000 Subject: Change id that identifies client in crash reports. Whenever metrics service recording is enabled, it sets the client id for crash reporting. - On Windows this id gets stored in the registry so that we can read it pretty early regardless of the process type. If the id has not been generated (like in the case of first run) we initialize with empty string but the real id gets inserted once metrics service gets initialized. - On Linux we were creating a hash and storing it in 'Consent to Send Stats'. This change replaces that hash with the metrics id. Unlike before calling SetConsentToSendStats doesn't generate a new id, if an id already exists. - On Mac there was no id set. Now we use metrics id as guid for the browser process. For other process types a change is still required to pass that id as command line param to renderers/plugins (like Linux). BUG=23658 TEST=Cause a deliberate crash in Chrome renderer/browser/plugin and make sure the clientID reported to the crash server is the right GUID. Review URL: http://codereview.chromium.org/346007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31143 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/common/child_process_logging_linux.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to '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 59b16f6..9b51303 100644 --- a/chrome/common/child_process_logging_linux.cc +++ b/chrome/common/child_process_logging_linux.cc @@ -7,6 +7,8 @@ #include #include "base/logging.h" +#include "base/string_util.h" +#include "chrome/installer/util/google_update_settings.h" #include "googleurl/src/gurl.h" namespace child_process_logging { @@ -19,4 +21,14 @@ void SetActiveURL(const GURL& url) { active_url = url.possibly_invalid_spec(); } +void SetClientId(const std::string& client_id) { + std::string str(client_id); + ReplaceSubstringsAfterOffset(&str, 0, "-", ""); + + if (str.empty()) + return; + + std::wstring wstr = ASCIIToWide(str); + GoogleUpdateSettings::SetMetricsId(wstr); +} } // namespace child_process_logging -- cgit v1.1