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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartView.js

Issue 2727233004: Timeline: fix NPE in heavy stack view when clearing Timeline (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.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 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 * @implements {Timeline.TimelineModeView} 6 * @implements {Timeline.TimelineModeView}
7 * @implements {PerfUI.FlameChartDelegate} 7 * @implements {PerfUI.FlameChartDelegate}
8 * @implements {UI.Searchable} 8 * @implements {UI.Searchable}
9 * @unrestricted 9 * @unrestricted
10 */ 10 */
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 * @override 108 * @override
109 * @param {?Timeline.PerformanceModel} model 109 * @param {?Timeline.PerformanceModel} model
110 */ 110 */
111 setModel(model) { 111 setModel(model) {
112 var extensionDataAdded = Timeline.PerformanceModel.Events.ExtensionDataAdded ; 112 var extensionDataAdded = Timeline.PerformanceModel.Events.ExtensionDataAdded ;
113 if (this._model) 113 if (this._model)
114 this._model.removeEventListener(extensionDataAdded, this._appendExtensionD ata, this); 114 this._model.removeEventListener(extensionDataAdded, this._appendExtensionD ata, this);
115 this._model = model; 115 this._model = model;
116 if (this._model) 116 if (this._model)
117 this._model.addEventListener(extensionDataAdded, this._appendExtensionData , this); 117 this._model.addEventListener(extensionDataAdded, this._appendExtensionData , this);
118 this._mainDataProvider.setModel(this._model);
119 this._networkDataProvider.setModel(this._model);
120 this._countersView.setModel(this._model);
121 this._detailsView.setModel(this._model);
122
123 this._nextExtensionIndex = 0;
124 this._appendExtensionData();
125
118 this._updateSearchHighlight(false, true); 126 this._updateSearchHighlight(false, true);
119 this._refresh(); 127 this._refresh();
120 } 128 }
121 129
122 _refresh() { 130 _refresh() {
123 this._mainDataProvider.setModel(this._model);
124 this._networkDataProvider.setModel(this._model);
125 this._countersView.setModel(this._model);
126 if (this._detailsView)
127 this._detailsView.setModel(this._model);
128
129 this._nextExtensionIndex = 0;
130 this._appendExtensionData();
131
132 if (this._networkDataProvider.isEmpty()) { 131 if (this._networkDataProvider.isEmpty()) {
133 this._mainFlameChart.enableRuler(true); 132 this._mainFlameChart.enableRuler(true);
134 this._networkSplitWidget.hideSidebar(); 133 this._networkSplitWidget.hideSidebar();
135 } else { 134 } else {
136 this._mainFlameChart.enableRuler(false); 135 this._mainFlameChart.enableRuler(false);
137 this._networkSplitWidget.showBoth(); 136 this._networkSplitWidget.showBoth();
138 this.resizeToPreferredHeights(); 137 this.resizeToPreferredHeights();
139 } 138 }
140 this._mainFlameChart.reset(); 139 this._mainFlameChart.reset();
141 this._networkFlameChart.reset(); 140 this._networkFlameChart.reset();
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 context.translate(this._style.lineWidth < 1 || (this._style.lineWidth & 1) ? 0.5 : 0, 0.5); 500 context.translate(this._style.lineWidth < 1 || (this._style.lineWidth & 1) ? 0.5 : 0, 0.5);
502 context.beginPath(); 501 context.beginPath();
503 context.moveTo(x, height); 502 context.moveTo(x, height);
504 context.setLineDash(this._style.dashStyle); 503 context.setLineDash(this._style.dashStyle);
505 context.lineTo(x, context.canvas.height); 504 context.lineTo(x, context.canvas.height);
506 context.stroke(); 505 context.stroke();
507 } 506 }
508 context.restore(); 507 context.restore();
509 } 508 }
510 }; 509 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/timeline/TimelineTreeView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698