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

Unified Diff: chromecast/browser/metrics/cast_metrics_service_client.cc

Issue 845003002: [chromecast] ExternalMetrics has to destroy itself in file thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
Index: chromecast/browser/metrics/cast_metrics_service_client.cc
diff --git a/chromecast/browser/metrics/cast_metrics_service_client.cc b/chromecast/browser/metrics/cast_metrics_service_client.cc
index 32b4c15130e4bdfcc73da854ac4bc92783b34123..b60bab4727ab748002b6590540faabff98791918 100644
--- a/chromecast/browser/metrics/cast_metrics_service_client.cc
+++ b/chromecast/browser/metrics/cast_metrics_service_client.cc
@@ -250,6 +250,12 @@ void CastMetricsServiceClient::Finalize() {
// Set clean_shutdown bit.
metrics_service_->RecordCompletedSessionEnd();
#endif // !defined(OS_ANDROID)
+
+ // Stop metrics service cleanly before destructing CastMetricsServiceClient.
+#if defined(OS_LINUX)
+ external_metrics_.release()->DestroySelf();
+#endif // defined(OS_LINUX)
+ metrics_service_.reset();
gunsch 2015/01/09 18:56:19 what's the purpose of this call? won't this happen
gfhuang 2015/01/09 19:10:45 Changed to Stop() to be more clear. and edited CL
}
bool CastMetricsServiceClient::IsReportingEnabled() {
« no previous file with comments | « no previous file | chromecast/browser/metrics/external_metrics.h » ('j') | chromecast/browser/metrics/external_metrics.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698