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

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

Issue 1748993002: DevTools: Initial implementation of line-level CPU profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments. Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 { 672 {
673 var targets = WebInspector.targetManager.targets(); 673 var targets = WebInspector.targetManager.targets();
674 for (var i = 0; i < targets.length; ++i) 674 for (var i = 0; i < targets.length; ++i)
675 targets[i].heapProfilerAgent().collectGarbage(); 675 targets[i].heapProfilerAgent().collectGarbage();
676 }, 676 },
677 677
678 _clear: function() 678 _clear: function()
679 { 679 {
680 this._tracingModel.reset(); 680 this._tracingModel.reset();
681 this._model.reset(); 681 this._model.reset();
682 this._resetLineLevelCPUProfile();
682 this._showRecordingHelpMessage(); 683 this._showRecordingHelpMessage();
683 684
684 this.requestWindowTimes(0, Infinity); 685 this.requestWindowTimes(0, Infinity);
685 delete this._selection; 686 delete this._selection;
686 this._frameModel.reset(); 687 this._frameModel.reset();
687 this._overviewPane.reset(); 688 this._overviewPane.reset();
688 for (var i = 0; i < this._currentViews.length; ++i) 689 for (var i = 0; i < this._currentViews.length; ++i)
689 this._currentViews[i].reset(); 690 this._currentViews[i].reset();
690 for (var i = 0; i < this._overviewControls.length; ++i) 691 for (var i = 0; i < this._overviewControls.length; ++i)
691 this._overviewControls[i].reset(); 692 this._overviewControls[i].reset();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 return; 800 return;
800 } 801 }
801 802
802 if (this._statusPane) 803 if (this._statusPane)
803 this._statusPane.updateStatus(WebInspector.UIString("Processing time line\u2026")); 804 this._statusPane.updateStatus(WebInspector.UIString("Processing time line\u2026"));
804 this._model.setEvents(this._tracingModel, loadedFromFile); 805 this._model.setEvents(this._tracingModel, loadedFromFile);
805 this._frameModel.reset(); 806 this._frameModel.reset();
806 this._frameModel.addTraceEvents(this._model.target(), this._model.inspec tedTargetEvents(), this._model.sessionId() || ""); 807 this._frameModel.addTraceEvents(this._model.target(), this._model.inspec tedTargetEvents(), this._model.sessionId() || "");
807 if (this._irModel) 808 if (this._irModel)
808 this._irModel.populate(this._model); 809 this._irModel.populate(this._model);
810 this._setLineLevelCPUProfile(this._model.lineLevelCPUProfile());
809 if (this._statusPane) 811 if (this._statusPane)
810 this._statusPane.hide(); 812 this._statusPane.hide();
811 delete this._statusPane; 813 delete this._statusPane;
812 this._overviewPane.reset(); 814 this._overviewPane.reset();
813 this._overviewPane.setBounds(this._model.minimumRecordTime(), this._mode l.maximumRecordTime()); 815 this._overviewPane.setBounds(this._model.minimumRecordTime(), this._mode l.maximumRecordTime());
814 this._setAutoWindowTimes(); 816 this._setAutoWindowTimes();
815 this._refreshViews(); 817 this._refreshViews();
816 for (var i = 0; i < this._overviewControls.length; ++i) 818 for (var i = 0; i < this._overviewControls.length; ++i)
817 this._overviewControls[i].timelineStopped(); 819 this._overviewControls[i].timelineStopped();
818 this._setMarkers(); 820 this._setMarkers();
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 if (span < totalSpan * 0.1) { 1256 if (span < totalSpan * 0.1) {
1255 leftTime = this._tracingModel.minimumRecordTime(); 1257 leftTime = this._tracingModel.minimumRecordTime();
1256 rightTime = this._tracingModel.maximumRecordTime(); 1258 rightTime = this._tracingModel.maximumRecordTime();
1257 } else { 1259 } else {
1258 leftTime = Math.max(leftTime - 0.05 * span, this._tracingModel.minim umRecordTime()); 1260 leftTime = Math.max(leftTime - 0.05 * span, this._tracingModel.minim umRecordTime());
1259 rightTime = Math.min(rightTime + 0.05 * span, this._tracingModel.max imumRecordTime()); 1261 rightTime = Math.min(rightTime + 0.05 * span, this._tracingModel.max imumRecordTime());
1260 } 1262 }
1261 this.requestWindowTimes(leftTime, rightTime); 1263 this.requestWindowTimes(leftTime, rightTime);
1262 }, 1264 },
1263 1265
1266 /**
1267 * @param {!WebInspector.TimelineModel.LineLevelProfile} profile
1268 */
1269 _setLineLevelCPUProfile: function(profile)
1270 {
1271 for (var fileInfo of profile.files()) {
1272 var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(/** @ty pe {string} */ (fileInfo[0]));
1273 if (!uiSourceCode)
1274 continue;
1275 for (var lineInfo of fileInfo[1]) {
1276 var line = lineInfo[0];
1277 var time = lineInfo[1];
1278 uiSourceCode.addLineDecoration(line, WebInspector.TimelineUIUtil s.PerformanceLineDecorator.type, time);
1279 }
1280 }
1281 },
1282
1283 _resetLineLevelCPUProfile: function()
1284 {
1285 WebInspector.workspace.uiSourceCodes().forEach(uiSourceCode => uiSourceC ode.removeAllLineDecorations(WebInspector.TimelineUIUtils.PerformanceLineDecorat or.type));
1286 },
1287
1264 __proto__: WebInspector.Panel.prototype 1288 __proto__: WebInspector.Panel.prototype
1265 } 1289 }
1266 1290
1267 /** 1291 /**
1268 * @interface 1292 * @interface
1269 */ 1293 */
1270 WebInspector.TimelineLifecycleDelegate = function() 1294 WebInspector.TimelineLifecycleDelegate = function()
1271 { 1295 {
1272 } 1296 }
1273 1297
(...skipping 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
2159 * @override 2183 * @override
2160 * @param {!WebInspector.Target} target 2184 * @param {!WebInspector.Target} target
2161 */ 2185 */
2162 targetRemoved: function(target) 2186 targetRemoved: function(target)
2163 { 2187 {
2164 this._targets.remove(target, true); 2188 this._targets.remove(target, true);
2165 }, 2189 },
2166 2190
2167 __proto__: WebInspector.Object.prototype 2191 __proto__: WebInspector.Object.prototype
2168 } 2192 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698