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

Side by Side Diff: Source/devtools/front_end/TimelinePowerOverview.js

Issue 212503002: DevTools: Fix JSDoc and code landed in r169951. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « Source/devtools/front_end/PowerProfiler.js ('k') | 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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.Object} 7 * @extends {WebInspector.Object}
8 */ 8 */
9 WebInspector.TimelinePowerOverviewDataProvider = function() 9 WebInspector.TimelinePowerOverviewDataProvider = function()
10 { 10 {
11 this._records = []; 11 this._records = [];
12 if (Capabilities.canProfilePower) 12 if (Capabilities.canProfilePower)
13 WebInspector.powerProfiler.addEventListener(WebInspector.PowerProfiler.E ventTypes.PowerEventRecorded, this._onRecordAdded, this); 13 WebInspector.powerProfiler.addEventListener(WebInspector.PowerProfiler.E ventTypes.PowerEventRecorded, this._onRecordAdded, this);
14 } 14 }
15 15
16 WebInspector.TimelinePowerOverviewDataProvider.prototype = { 16 WebInspector.TimelinePowerOverviewDataProvider.prototype = {
17 /** 17 /**
18 * @return {Array.<PowerEvent>} 18 * @return {!Array.<!PowerAgent.PowerEvent>}
19 */ 19 */
20 records : function() 20 records : function()
21 { 21 {
22 // The last record is not used, as its "value" is not set. 22 // The last record is not used, as its "value" is not set.
23 return this._records.slice(0, this._records.length - 1); 23 return this._records.slice(0, this._records.length - 1);
24 }, 24 },
25 25
26 _onRecordAdded: function(event) 26 _onRecordAdded: function(event)
27 { 27 {
28 // "value" of original PowerEvent means the anverage power between previ ous sampling to current one. 28 // "value" of original PowerEvent means the average power between previo us sampling to current one.
29 // Here, it is converted to anverage power between current sampling to n ext one. 29 // Here, it is converted to average power between current sampling to ne xt one.
30 var record = event.data; 30 var record = event.data;
31 var length = this._records.length; 31 var length = this._records.length;
32 if (length) 32 if (length)
33 this._records[length - 1].value = record.value; 33 this._records[length - 1].value = record.value;
34 this._records.push(record); 34 this._records.push(record);
35 }, 35 },
36 36
37 __proto__: WebInspector.Object.prototype 37 __proto__: WebInspector.Object.prototype
38 } 38 }
39 39
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 ctx.restore(); 145 ctx.restore();
146 146
147 this._maxPowerLabel.textContent = WebInspector.UIString("%.2f\u2009watts ", maxPower); 147 this._maxPowerLabel.textContent = WebInspector.UIString("%.2f\u2009watts ", maxPower);
148 this._minPowerLabel.textContent = WebInspector.UIString("%.2f\u2009watts ", minPower);; 148 this._minPowerLabel.textContent = WebInspector.UIString("%.2f\u2009watts ", minPower);;
149 }, 149 },
150 150
151 __proto__: WebInspector.TimelineOverviewBase.prototype 151 __proto__: WebInspector.TimelineOverviewBase.prototype
152 } 152 }
153 153
154 154
OLDNEW
« no previous file with comments | « Source/devtools/front_end/PowerProfiler.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698