summaryrefslogtreecommitdiffstats
path: root/components/metrics
diff options
context:
space:
mode:
authorMark Mentovai <mark@chromium.org>2015-03-24 10:00:06 -0400
committerMark Mentovai <mark@chromium.org>2015-03-24 14:01:48 +0000
commitc67fa64ff088022c1149f50ca69a1b173167afe5 (patch)
treefe9a2cb4d3952f31629a9d6ea4d211fe918ff5cd /components/metrics
parentf81f2b896fedfdb1099738dec13adafe4c4bf998 (diff)
downloadchromium_src-c67fa64ff088022c1149f50ca69a1b173167afe5.zip
chromium_src-c67fa64ff088022c1149f50ca69a1b173167afe5.tar.gz
chromium_src-c67fa64ff088022c1149f50ca69a1b173167afe5.tar.bz2
Set a "metrics_client_id" crash key instead of "guid" on Mac OS X.
Crashpad maintains the client ID on its own and is responsible for sending this form parameter to the Breakpad server during report upload. When using Crashpad as its crash-reporting implementation, Chrome does not need to set this crash key. When Chrome does attempt to set this crash key on its own, crashpad_handler produces these harmless log messages: [mmdd/hhmmss:WARNING:crash_report_upload_thread.cc(44)] duplicate key guid, discarding value 0123456789ABCDEF0123456789ABCDEF There are valid reasons to provide the metrics client ID along with the crash report, so this is placed in a distinct crash key, "metrics_client_id". BUG=466964 R=cpu@chromium.org, isherman@chromium.org, rsesek@chromium.org Review URL: https://codereview.chromium.org/1000203007 Cr-Commit-Position: refs/heads/master@{#321996}
Diffstat (limited to 'components/metrics')
-rw-r--r--components/metrics/metrics_service.cc2
-rw-r--r--components/metrics/metrics_service_client.h4
-rw-r--r--components/metrics/test_metrics_service_client.cc3
-rw-r--r--components/metrics/test_metrics_service_client.h1
4 files changed, 10 insertions, 0 deletions
diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc
index f86f33a..358d423 100644
--- a/components/metrics/metrics_service.cc
+++ b/components/metrics/metrics_service.cc
@@ -388,6 +388,8 @@ void MetricsService::DisableRecording() {
return;
recording_active_ = false;
+ client_->OnRecordingDisabled();
+
base::RemoveActionCallback(action_callback_);
for (size_t i = 0; i < metrics_providers_.size(); ++i)
diff --git a/components/metrics/metrics_service_client.h b/components/metrics/metrics_service_client.h
index 1b481f9..489080a 100644
--- a/components/metrics/metrics_service_client.h
+++ b/components/metrics/metrics_service_client.h
@@ -29,6 +29,10 @@ class MetricsServiceClient {
// when metrics recording gets enabled.
virtual void SetMetricsClientId(const std::string& client_id) = 0;
+ // Notifies the client that recording is disabled, so that other services
+ // (such as crash reporting) can clear any association with metrics.
+ virtual void OnRecordingDisabled() = 0;
+
// Whether there's an "off the record" (aka "Incognito") session active.
virtual bool IsOffTheRecordSessionActive() = 0;
diff --git a/components/metrics/test_metrics_service_client.cc b/components/metrics/test_metrics_service_client.cc
index 9dcb370..b016672 100644
--- a/components/metrics/test_metrics_service_client.cc
+++ b/components/metrics/test_metrics_service_client.cc
@@ -26,6 +26,9 @@ void TestMetricsServiceClient::SetMetricsClientId(
client_id_ = client_id;
}
+void TestMetricsServiceClient::OnRecordingDisabled() {
+}
+
bool TestMetricsServiceClient::IsOffTheRecordSessionActive() {
return false;
}
diff --git a/components/metrics/test_metrics_service_client.h b/components/metrics/test_metrics_service_client.h
index 973d6e3..52f1889 100644
--- a/components/metrics/test_metrics_service_client.h
+++ b/components/metrics/test_metrics_service_client.h
@@ -22,6 +22,7 @@ class TestMetricsServiceClient : public MetricsServiceClient {
// MetricsServiceClient:
void SetMetricsClientId(const std::string& client_id) override;
+ void OnRecordingDisabled() override;
bool IsOffTheRecordSessionActive() override;
int32_t GetProduct() override;
std::string GetApplicationLocale() override;