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

Side by Side Diff: media/blink/cdm_result_promise_helper.cc

Issue 2691673002: media: Add UMA to record time to GenerateRequest and LoadSession (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « media/blink/cdm_result_promise_helper.h ('k') | media/blink/new_session_cdm_result_promise.h » ('j') | 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 "media/blink/cdm_result_promise_helper.h" 5 #include "media/blink/cdm_result_promise_helper.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return; 63 return;
64 64
65 base::LinearHistogram::FactoryGet( 65 base::LinearHistogram::FactoryGet(
66 uma_name, 66 uma_name,
67 1, 67 1,
68 NUM_RESULT_CODES, 68 NUM_RESULT_CODES,
69 NUM_RESULT_CODES + 1, 69 NUM_RESULT_CODES + 1,
70 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(result); 70 base::HistogramBase::kUmaTargetedHistogramFlag)->Add(result);
71 } 71 }
72 72
73 void ReportTimeUMA(const std::string& uma_name, base::TimeDelta time) {
74 // Note: This leaks memory, which is expected behavior.
75 base::HistogramBase* histogram = base::Histogram::FactoryTimeGet(
76 uma_name, base::TimeDelta::FromMilliseconds(1),
77 base::TimeDelta::FromSeconds(10), 50,
78 base::HistogramBase::kUmaTargetedHistogramFlag);
79
80 histogram->AddTime(time);
Ilya Sherman 2017/02/11 00:50:53 Please use "base::UmaHistogramTimes(name, time);"
xhwang 2017/02/11 01:12:45 Great. Didn't know this existed. PTAL again!
81 }
82
73 } // namespace media 83 } // namespace media
OLDNEW
« no previous file with comments | « media/blink/cdm_result_promise_helper.h ('k') | media/blink/new_session_cdm_result_promise.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698