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

Side by Side Diff: chrome/browser/resources/file_manager/js/metrics.js

Issue 10832096: Make FileCopyManager work on harness. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/mock_chrome.js » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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
11 (function() { 11 (function() {
12 // Switch to the 'test harness' mode when loading from a file or http url. 12 // Switch to the 'test harness' mode when loading from a file or http url.
13 // Do this as early as possible because the metrics code depends on 13 // Do this as early as possible because the metrics code depends on
14 // chrome private APIs. 14 // chrome private APIs.
15 if (document.location.protocol == 'file:' || 15 if (document.location.protocol == 'file:' ||
16 document.location.protocol == 'http:') { 16 document.location.protocol == 'http:') {
17 console.log('created mock script'); 17 console.log('created mock script');
18 document.write('<script src="js/mock_chrome.js"><\57script>'); 18 document.write('<script src="js/mock_chrome.js"><\57script>');
19 document.write('<script src="js/file_copy_manager.js"><\57script>');
19 } 20 }
20 })(); 21 })();
21 22
22 var metrics = {}; 23 var metrics = {};
23 24
24 /** 25 /**
25 * A map from interval name to interval start timestamp. 26 * A map from interval name to interval start timestamp.
26 */ 27 */
27 metrics.intervals = {}; 28 metrics.intervals = {};
28 29
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 'min': 1, 120 'min': 1,
120 'max': boundaryValue, 121 'max': boundaryValue,
121 'buckets': boundaryValue + 1 122 'buckets': boundaryValue + 1
122 }; 123 };
123 chrome.metricsPrivate.recordValue(metricDescr, index); 124 chrome.metricsPrivate.recordValue(metricDescr, index);
124 if (localStorage.logMetrics) { 125 if (localStorage.logMetrics) {
125 console.log('chrome.metricsPrivate.recordValue', 126 console.log('chrome.metricsPrivate.recordValue',
126 [metricDescr.metricName, index, value]); 127 [metricDescr.metricName, index, value]);
127 } 128 }
128 }; 129 };
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/file_manager/js/mock_chrome.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698