| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @implements {WebInspector.Searchable} | 7 * @implements {WebInspector.Searchable} |
| 8 * @extends {WebInspector.SimpleView} | 8 * @extends {WebInspector.SimpleView} |
| 9 * @param {!WebInspector.ProfileDataGridNode.Formatter} nodeFormatter | 9 * @param {!WebInspector.ProfileDataGridNode.Formatter} nodeFormatter |
| 10 * @param {!Array<string>=} viewTypes | 10 * @param {!Array<string>=} viewTypes |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 this.resetButton = new WebInspector.ToolbarButton(WebInspector.UIString("Res
tore all functions"), "refresh-toolbar-item"); | 57 this.resetButton = new WebInspector.ToolbarButton(WebInspector.UIString("Res
tore all functions"), "refresh-toolbar-item"); |
| 58 this.resetButton.setEnabled(false); | 58 this.resetButton.setEnabled(false); |
| 59 this.resetButton.addEventListener("click", this._resetClicked, this); | 59 this.resetButton.addEventListener("click", this._resetClicked, this); |
| 60 | 60 |
| 61 this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.Defa
ultFormatter(30)); | 61 this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.Defa
ultFormatter(30)); |
| 62 | 62 |
| 63 this._changeView(); | 63 this._changeView(); |
| 64 if (this._flameChart) | 64 if (this._flameChart) |
| 65 this._flameChart.update(); | 65 this._flameChart.update(); |
| 66 } | 66 }; |
| 67 | 67 |
| 68 /** @enum {string} */ | 68 /** @enum {string} */ |
| 69 WebInspector.ProfileView.ViewTypes = { | 69 WebInspector.ProfileView.ViewTypes = { |
| 70 Flame: "Flame", | 70 Flame: "Flame", |
| 71 Tree: "Tree", | 71 Tree: "Tree", |
| 72 Heavy: "Heavy" | 72 Heavy: "Heavy" |
| 73 } | 73 }; |
| 74 | 74 |
| 75 /** | 75 /** |
| 76 * @param {!Array<!{title: string, value: string}>} entryInfo | 76 * @param {!Array<!{title: string, value: string}>} entryInfo |
| 77 * @return {!Element} | 77 * @return {!Element} |
| 78 */ | 78 */ |
| 79 WebInspector.ProfileView.buildPopoverTable = function(entryInfo) | 79 WebInspector.ProfileView.buildPopoverTable = function(entryInfo) |
| 80 { | 80 { |
| 81 var table = createElement("table"); | 81 var table = createElement("table"); |
| 82 for (var entry of entryInfo) { | 82 for (var entry of entryInfo) { |
| 83 var row = table.createChild("tr"); | 83 var row = table.createChild("tr"); |
| 84 row.createChild("td").textContent = entry.title; | 84 row.createChild("td").textContent = entry.title; |
| 85 row.createChild("td").textContent = entry.value; | 85 row.createChild("td").textContent = entry.value; |
| 86 } | 86 } |
| 87 return table; | 87 return table; |
| 88 } | 88 }; |
| 89 | 89 |
| 90 WebInspector.ProfileView.prototype = { | 90 WebInspector.ProfileView.prototype = { |
| 91 focus: function() | 91 focus: function() |
| 92 { | 92 { |
| 93 if (this._flameChart) | 93 if (this._flameChart) |
| 94 this._flameChart.focus(); | 94 this._flameChart.focus(); |
| 95 else | 95 else |
| 96 WebInspector.Widget.prototype.focus.call(this); | 96 WebInspector.Widget.prototype.focus.call(this); |
| 97 }, | 97 }, |
| 98 | 98 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 { | 376 { |
| 377 var sortAscending = this.dataGrid.isSortOrderAscending(); | 377 var sortAscending = this.dataGrid.isSortOrderAscending(); |
| 378 var sortColumnIdentifier = this.dataGrid.sortColumnIdentifier(); | 378 var sortColumnIdentifier = this.dataGrid.sortColumnIdentifier(); |
| 379 var sortProperty = sortColumnIdentifier === "function" ? "functionName"
: sortColumnIdentifier || ""; | 379 var sortProperty = sortColumnIdentifier === "function" ? "functionName"
: sortColumnIdentifier || ""; |
| 380 this.profileDataGridTree.sort(WebInspector.ProfileDataGridTree.propertyC
omparator(sortProperty, sortAscending)); | 380 this.profileDataGridTree.sort(WebInspector.ProfileDataGridTree.propertyC
omparator(sortProperty, sortAscending)); |
| 381 | 381 |
| 382 this.refresh(); | 382 this.refresh(); |
| 383 }, | 383 }, |
| 384 | 384 |
| 385 __proto__: WebInspector.SimpleView.prototype | 385 __proto__: WebInspector.SimpleView.prototype |
| 386 } | 386 }; |
| 387 | 387 |
| 388 /** | 388 /** |
| 389 * @constructor | 389 * @constructor |
| 390 * @extends {WebInspector.ProfileHeader} | 390 * @extends {WebInspector.ProfileHeader} |
| 391 * @implements {WebInspector.OutputStream} | 391 * @implements {WebInspector.OutputStream} |
| 392 * @implements {WebInspector.OutputStreamDelegate} | 392 * @implements {WebInspector.OutputStreamDelegate} |
| 393 * @param {?WebInspector.Target} target | 393 * @param {?WebInspector.Target} target |
| 394 * @param {!WebInspector.ProfileType} type | 394 * @param {!WebInspector.ProfileType} type |
| 395 * @param {string=} title | 395 * @param {string=} title |
| 396 */ | 396 */ |
| 397 WebInspector.WritableProfileHeader = function(target, type, title) | 397 WebInspector.WritableProfileHeader = function(target, type, title) |
| 398 { | 398 { |
| 399 WebInspector.ProfileHeader.call(this, target, type, title || WebInspector.UI
String("Profile %d", type.nextProfileUid())); | 399 WebInspector.ProfileHeader.call(this, target, type, title || WebInspector.UI
String("Profile %d", type.nextProfileUid())); |
| 400 this._debuggerModel = WebInspector.DebuggerModel.fromTarget(target); | 400 this._debuggerModel = WebInspector.DebuggerModel.fromTarget(target); |
| 401 this._tempFile = null; | 401 this._tempFile = null; |
| 402 } | 402 }; |
| 403 | 403 |
| 404 WebInspector.WritableProfileHeader.prototype = { | 404 WebInspector.WritableProfileHeader.prototype = { |
| 405 /** | 405 /** |
| 406 * @override | 406 * @override |
| 407 */ | 407 */ |
| 408 onTransferStarted: function() | 408 onTransferStarted: function() |
| 409 { | 409 { |
| 410 this._jsonifiedProfile = ""; | 410 this._jsonifiedProfile = ""; |
| 411 this.updateStatus(WebInspector.UIString("Loading\u2026 %s", Number.bytes
ToString(this._jsonifiedProfile.length)), true); | 411 this.updateStatus(WebInspector.UIString("Loading\u2026 %s", Number.bytes
ToString(this._jsonifiedProfile.length)), true); |
| 412 }, | 412 }, |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 | 598 |
| 599 _notifyTempFileReady: function() | 599 _notifyTempFileReady: function() |
| 600 { | 600 { |
| 601 if (this._onTempFileReady) { | 601 if (this._onTempFileReady) { |
| 602 this._onTempFileReady(); | 602 this._onTempFileReady(); |
| 603 this._onTempFileReady = null; | 603 this._onTempFileReady = null; |
| 604 } | 604 } |
| 605 }, | 605 }, |
| 606 | 606 |
| 607 __proto__: WebInspector.ProfileHeader.prototype | 607 __proto__: WebInspector.ProfileHeader.prototype |
| 608 } | 608 }; |
| OLD | NEW |