Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 WebInspector.CPUProfileView = function(profileHeader) | 32 WebInspector.CPUProfileView = function(profileHeader) |
| 33 { | 33 { |
| 34 this._profileHeader = profileHeader; | 34 this._profileHeader = profileHeader; |
| 35 this.profile = new WebInspector.CPUProfileDataModel(profileHeader._profile | | profileHeader.protocolProfile()); | 35 this.profile = new WebInspector.CPUProfileDataModel(profileHeader._profile | | profileHeader.protocolProfile()); |
| 36 this.adjustedTotal = this.profile.profileHead.total; | 36 this.adjustedTotal = this.profile.profileHead.total; |
| 37 this.adjustedTotal -= this.profile.idleNode ? this.profile.idleNode.total : 0; | 37 this.adjustedTotal -= this.profile.idleNode ? this.profile.idleNode.total : 0; |
| 38 WebInspector.ProfileView.call(this, new WebInspector.CPUProfileView.NodeForm atter(this)); | 38 WebInspector.ProfileView.call(this, new WebInspector.CPUProfileView.NodeForm atter(this)); |
| 39 } | 39 } |
| 40 | 40 |
| 41 WebInspector.CPUProfileView.prototype = { | 41 WebInspector.CPUProfileView.prototype = { |
| 42 /** | |
| 43 * @override | |
| 44 * @return {string} | |
| 45 */ | |
| 46 units: function() | |
| 47 { | |
| 48 return "Time [ms]"; | |
|
caseq
2016/04/27 21:24:07
WebInspector.UIString(). Also, "(ms)" perhaps?
alph
2016/04/28 00:47:26
Done.
| |
| 49 }, | |
| 50 | |
| 42 __proto__: WebInspector.ProfileView.prototype | 51 __proto__: WebInspector.ProfileView.prototype |
| 43 } | 52 } |
| 44 | 53 |
| 45 /** | 54 /** |
| 46 * @constructor | 55 * @constructor |
| 47 * @extends {WebInspector.ProfileType} | 56 * @extends {WebInspector.ProfileType} |
| 48 */ | 57 */ |
| 49 WebInspector.CPUProfileType = function() | 58 WebInspector.CPUProfileType = function() |
| 50 { | 59 { |
| 51 WebInspector.ProfileType.call(this, WebInspector.CPUProfileType.TypeId, WebI nspector.UIString("Collect JavaScript CPU Profile")); | 60 WebInspector.ProfileType.call(this, WebInspector.CPUProfileType.TypeId, WebI nspector.UIString("Collect JavaScript CPU Profile")); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 287 } | 296 } |
| 288 | 297 |
| 289 WebInspector.CPUProfileView.NodeFormatter.prototype = { | 298 WebInspector.CPUProfileView.NodeFormatter.prototype = { |
| 290 /** | 299 /** |
| 291 * @override | 300 * @override |
| 292 * @param {number} value | 301 * @param {number} value |
| 293 * @return {string} | 302 * @return {string} |
| 294 */ | 303 */ |
| 295 formatValue: function(value) | 304 formatValue: function(value) |
| 296 { | 305 { |
| 297 return WebInspector.UIString("%.1f\u2009ms", value); | 306 return WebInspector.UIString("%.1f", value); |
|
caseq
2016/04/27 21:24:07
String.vsprintf() perhaps -- this is no longer UIS
alph
2016/04/28 00:47:26
Done.
| |
| 298 }, | 307 }, |
| 299 | 308 |
| 300 /** | 309 /** |
| 301 * @override | 310 * @override |
| 302 * @param {number} value | 311 * @param {number} value |
| 303 * @param {!WebInspector.ProfileDataGridNode} node | 312 * @param {!WebInspector.ProfileDataGridNode} node |
| 304 * @return {string} | 313 * @return {string} |
| 305 */ | 314 */ |
| 306 formatPercent: function(value, node) | 315 formatPercent: function(value, node) |
| 307 { | 316 { |
| 308 return node.profileNode === this._profileView.profile.idleNode ? "" : We bInspector.UIString("%.2f\u2009%%", value); | 317 return node.profileNode === this._profileView.profile.idleNode ? "" : We bInspector.UIString("%.2f\u2009%%", value); |
| 309 }, | 318 }, |
| 310 | 319 |
| 311 /** | 320 /** |
| 312 * @override | 321 * @override |
| 313 * @param {!WebInspector.ProfileDataGridNode} node | 322 * @param {!WebInspector.ProfileDataGridNode} node |
| 314 * @return {!Element} | 323 * @return {!Element} |
| 315 */ | 324 */ |
| 316 linkifyNode: function(node) | 325 linkifyNode: function(node) |
| 317 { | 326 { |
| 318 var callFrame = node.profileNode.frame; | 327 var callFrame = node.profileNode.frame; |
| 319 return this._profileView.linkifier().linkifyConsoleCallFrame(this._profi leView.target(), callFrame, "profile-node-file"); | 328 return this._profileView.linkifier().linkifyConsoleCallFrame(this._profi leView.target(), callFrame, "profile-node-file"); |
| 320 } | 329 } |
| 321 } | 330 } |
| OLD | NEW |