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

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..9357a2b843c385ba6dd8d477badf024ea623e6e3 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)
lcwu1 2015/01/10 00:36:39 In our case, !OS_ANDROID is equal to OS_LINUX, so
gunsch 2015/01/10 00:42:23 I'd prefer not---RecordCompletedSessionEnd is actu
gfhuang 2015/01/10 00:58:30 Acknowledged.
+ external_metrics_.release()->StopAndSelfDestroy();
gunsch 2015/01/10 00:31:46 Thought: this mechanic is sort of strange. I think
gfhuang 2015/01/10 00:58:30 Done.
gfhuang 2015/01/10 01:17:30 Note that I have to revert back to use PostTask in
+#endif // defined(OS_LINUX)
+ metrics_service_->Stop();
}
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