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

Side by Side 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 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromecast/base/metrics/cast_metrics_helper.h" 5 #include "chromecast/base/metrics/cast_metrics_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 sdk_version_.clear(); 121 sdk_version_.clear();
122 } 122 }
123 123
124 void CastMetricsHelper::UpdateSDKInfo(const std::string& sdk_version) { 124 void CastMetricsHelper::UpdateSDKInfo(const std::string& sdk_version) {
125 MAKE_SURE_THREAD(UpdateSDKInfo, sdk_version); 125 MAKE_SURE_THREAD(UpdateSDKInfo, sdk_version);
126 sdk_version_ = sdk_version; 126 sdk_version_ = sdk_version;
127 } 127 }
128 128
129 void CastMetricsHelper::LogMediaPlay() { 129 void CastMetricsHelper::LogMediaPlay() {
130 MAKE_SURE_THREAD(LogMediaPlay); 130 MAKE_SURE_THREAD(LogMediaPlay);
131 if (app_id_.empty())
slan 2015/11/25 01:22:25 Did you consider setting a testing value for app_i
132 return;
131 RecordSimpleAction(EncodeAppInfoIntoMetricsName( 133 RecordSimpleAction(EncodeAppInfoIntoMetricsName(
132 "MediaPlay", 134 "MediaPlay",
133 app_id_, 135 app_id_,
134 session_id_, 136 session_id_,
135 sdk_version_)); 137 sdk_version_));
136 } 138 }
137 139
138 void CastMetricsHelper::LogMediaPause() { 140 void CastMetricsHelper::LogMediaPause() {
139 MAKE_SURE_THREAD(LogMediaPause); 141 MAKE_SURE_THREAD(LogMediaPause);
142 if (app_id_.empty())
143 return;
140 RecordSimpleAction(EncodeAppInfoIntoMetricsName( 144 RecordSimpleAction(EncodeAppInfoIntoMetricsName(
141 "MediaPause", 145 "MediaPause",
142 app_id_, 146 app_id_,
143 session_id_, 147 session_id_,
144 sdk_version_)); 148 sdk_version_));
145 } 149 }
146 150
147 void CastMetricsHelper::LogTimeToFirstPaint() { 151 void CastMetricsHelper::LogTimeToFirstPaint() {
148 MAKE_SURE_THREAD(LogTimeToFirstPaint); 152 MAKE_SURE_THREAD(LogTimeToFirstPaint);
149 if (app_id_.empty()) 153 if (app_id_.empty())
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 const base::TimeDelta& value) { 270 const base::TimeDelta& value) {
267 // Follow UMA_HISTOGRAM_MEDIUM_TIMES definition. 271 // Follow UMA_HISTOGRAM_MEDIUM_TIMES definition.
268 LogTimeHistogramEvent(name, value, 272 LogTimeHistogramEvent(name, value,
269 base::TimeDelta::FromMilliseconds(10), 273 base::TimeDelta::FromMilliseconds(10),
270 base::TimeDelta::FromMinutes(3), 274 base::TimeDelta::FromMinutes(3),
271 50); 275 50);
272 } 276 }
273 277
274 } // namespace metrics 278 } // namespace metrics
275 } // namespace chromecast 279 } // namespace chromecast
OLDNEW
« 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