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

Unified Diff: chromecast/base/metrics/cast_metrics_helper.cc

Issue 1477483003: [Chromecast] Allow media metrics events with no app running (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromecast/base/metrics/cast_metrics_helper.cc
diff --git a/chromecast/base/metrics/cast_metrics_helper.cc b/chromecast/base/metrics/cast_metrics_helper.cc
index 30f2810048cacb501b5a8968cdee10763e0ea1bf..30e24537cc290330262ada5081885ea232c897f0 100644
--- a/chromecast/base/metrics/cast_metrics_helper.cc
+++ b/chromecast/base/metrics/cast_metrics_helper.cc
@@ -128,6 +128,8 @@ void CastMetricsHelper::UpdateSDKInfo(const std::string& sdk_version) {
void CastMetricsHelper::LogMediaPlay() {
MAKE_SURE_THREAD(LogMediaPlay);
+ if (app_id_.empty())
slan 2015/11/25 01:22:25 Did you consider setting a testing value for app_i
+ return;
RecordSimpleAction(EncodeAppInfoIntoMetricsName(
"MediaPlay",
app_id_,
@@ -137,6 +139,8 @@ void CastMetricsHelper::LogMediaPlay() {
void CastMetricsHelper::LogMediaPause() {
MAKE_SURE_THREAD(LogMediaPause);
+ if (app_id_.empty())
+ return;
RecordSimpleAction(EncodeAppInfoIntoMetricsName(
"MediaPause",
app_id_,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698