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

Unified Diff: chromecast/metrics/cast_metrics_service_client.cc

Issue 608093002: Chromecast: adds callback for CastService to control metrics state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cast-network-delegate
Patch Set: rebase Created 6 years, 3 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 | « chromecast/metrics/cast_metrics_service_client.h ('k') | chromecast/service/cast_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/metrics/cast_metrics_service_client.cc
diff --git a/chromecast/metrics/cast_metrics_service_client.cc b/chromecast/metrics/cast_metrics_service_client.cc
index 637cd400b864e484b3300b51d33eb69ce8076ce2..50bbf4789dc9dae6cb49c7c6824515df816c321c 100644
--- a/chromecast/metrics/cast_metrics_service_client.cc
+++ b/chromecast/metrics/cast_metrics_service_client.cc
@@ -105,6 +105,15 @@ CastMetricsServiceClient::CreateUploader(
}
void CastMetricsServiceClient::EnableMetricsService(bool enabled) {
+ if (!metrics_service_loop_->BelongsToCurrentThread()) {
+ metrics_service_loop_->PostTask(
+ FROM_HERE,
+ base::Bind(&CastMetricsServiceClient::EnableMetricsService,
+ base::Unretained(this),
+ enabled));
+ return;
+ }
+
if (enabled) {
metrics_service_->Start();
} else {
@@ -126,6 +135,7 @@ CastMetricsServiceClient::CastMetricsServiceClient(
metrics_state_manager_.get(),
this,
pref_service)),
+ metrics_service_loop_(base::MessageLoopProxy::current()),
request_context_(request_context) {
// Always create a client id as it may also be used by crash reporting,
// (indirectly) included in feedback, and can be queried during setup.
« no previous file with comments | « chromecast/metrics/cast_metrics_service_client.h ('k') | chromecast/service/cast_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698