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

Side by Side Diff: ui/file_manager/file_manager/common/js/metrics_base.js

Issue 2346683004: Update chrome.metricsPrivate externs and make closure fixes (Closed)
Patch Set: fix file manager test Created 4 years, 3 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 /** 5 /**
6 * @fileoverview Utility methods for accessing chrome.metricsPrivate API. 6 * @fileoverview Utility methods for accessing chrome.metricsPrivate API.
7 * 7 *
8 * To be included as a first script in main.html 8 * To be included as a first script in main.html
9 */ 9 */
10 10
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 // Collect invalid values in the overflow bucket at the end. 154 // Collect invalid values in the overflow bucket at the end.
155 if (index < 0 || index >= boundaryValue) 155 if (index < 0 || index >= boundaryValue)
156 index = boundaryValue - 1; 156 index = boundaryValue - 1;
157 157
158 // Setting min to 1 looks strange but this is exactly the recommended way 158 // Setting min to 1 looks strange but this is exactly the recommended way
159 // of using histograms for enum-like types. Bucket #0 works as a regular 159 // of using histograms for enum-like types. Bucket #0 works as a regular
160 // bucket AND the underflow bucket. 160 // bucket AND the underflow bucket.
161 // (Source: UMA_HISTOGRAM_ENUMERATION definition in base/metrics/histogram.h) 161 // (Source: UMA_HISTOGRAM_ENUMERATION definition in base/metrics/histogram.h)
162 var metricDescr = { 162 var metricDescr = {
163 'metricName': metrics.convertName_(name), 163 'metricName': metrics.convertName_(name),
164 'type': 'histogram-linear', 164 'type': chrome.metricsPrivate.MetricTypeType.HISTOGRAM_LINEAR,
165 'min': 1, 165 'min': 1,
166 'max': boundaryValue, 166 'max': boundaryValue,
167 'buckets': boundaryValue 167 'buckets': boundaryValue
168 }; 168 };
169 metrics.call_('recordValue', [metricDescr, index]); 169 metrics.call_('recordValue', [metricDescr, index]);
170 }; 170 };
OLDNEW
« no previous file with comments | « third_party/closure_compiler/externs/metrics_private.js ('k') | ui/file_manager/image_loader/image_loader_client.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698