Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1261 rightTime = Math.min(rightTime + 0.05 * span, this._tracingModel.max imumRecordTime()); | 1261 rightTime = Math.min(rightTime + 0.05 * span, this._tracingModel.max imumRecordTime()); |
| 1262 } | 1262 } |
| 1263 this.requestWindowTimes(leftTime, rightTime); | 1263 this.requestWindowTimes(leftTime, rightTime); |
| 1264 }, | 1264 }, |
| 1265 | 1265 |
| 1266 /** | 1266 /** |
| 1267 * @param {!WebInspector.TimelineModel.LineLevelProfile} profile | 1267 * @param {!WebInspector.TimelineModel.LineLevelProfile} profile |
| 1268 */ | 1268 */ |
| 1269 _setLineLevelCPUProfile: function(profile) | 1269 _setLineLevelCPUProfile: function(profile) |
| 1270 { | 1270 { |
| 1271 var debuggerModel = WebInspector.DebuggerModel.fromTarget(WebInspector.t argetManager.mainTarget()); | |
| 1272 if (!debuggerModel) | |
| 1273 return; | |
| 1271 for (var fileInfo of profile.files()) { | 1274 for (var fileInfo of profile.files()) { |
| 1272 var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(/** @ty pe {string} */ (fileInfo[0])); | 1275 var url = /** @type {string} */ (fileInfo[0]); |
| 1273 if (!uiSourceCode) | 1276 var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(url); |
| 1274 continue; | |
| 1275 for (var lineInfo of fileInfo[1]) { | 1277 for (var lineInfo of fileInfo[1]) { |
| 1276 var line = lineInfo[0]; | 1278 var line = lineInfo[0]; |
| 1277 var time = lineInfo[1]; | 1279 var time = lineInfo[1]; |
| 1278 uiSourceCode.addLineDecoration(line, WebInspector.TimelineUIUtil s.PerformanceLineDecorator.type, time); | 1280 var rawLocation = debuggerModel.createRawLocationByURL(url, line - 1, 0); |
| 1281 if (rawLocation) | |
| 1282 WebInspector.debuggerWorkspaceBinding.createLiveLocation(raw Location, updateLocation.bind(null, time)); | |
| 1283 else if (uiSourceCode) | |
| 1284 uiSourceCode.addLineDecoration(line, WebInspector.TimelineUI Utils.PerformanceLineDecorator.type, time); | |
| 1279 } | 1285 } |
| 1280 } | 1286 } |
| 1287 | |
| 1288 /** | |
| 1289 * @param {number} time | |
| 1290 * @param {!WebInspector.LiveLocation} liveLocation | |
| 1291 */ | |
| 1292 function updateLocation(time, liveLocation) | |
| 1293 { | |
| 1294 var uiLocation = liveLocation.uiLocation(); | |
|
pfeldman
2016/03/17 01:20:58
remove them from the old one?
alph
2016/03/22 21:41:54
Done.
| |
| 1295 if (uiLocation) | |
| 1296 uiLocation.uiSourceCode.addLineDecoration(uiLocation.lineNumber, WebInspector.TimelineUIUtils.PerformanceLineDecorator.type, time); | |
| 1297 } | |
| 1281 }, | 1298 }, |
| 1282 | 1299 |
| 1283 _resetLineLevelCPUProfile: function() | 1300 _resetLineLevelCPUProfile: function() |
| 1284 { | 1301 { |
| 1285 WebInspector.workspace.uiSourceCodes().forEach(uiSourceCode => uiSourceC ode.removeAllLineDecorations(WebInspector.TimelineUIUtils.PerformanceLineDecorat or.type)); | 1302 WebInspector.workspace.uiSourceCodes().forEach(uiSourceCode => uiSourceC ode.removeAllLineDecorations(WebInspector.TimelineUIUtils.PerformanceLineDecorat or.type)); |
| 1286 }, | 1303 }, |
| 1287 | 1304 |
| 1288 __proto__: WebInspector.Panel.prototype | 1305 __proto__: WebInspector.Panel.prototype |
| 1289 } | 1306 } |
| 1290 | 1307 |
| (...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2183 * @override | 2200 * @override |
| 2184 * @param {!WebInspector.Target} target | 2201 * @param {!WebInspector.Target} target |
| 2185 */ | 2202 */ |
| 2186 targetRemoved: function(target) | 2203 targetRemoved: function(target) |
| 2187 { | 2204 { |
| 2188 this._targets.remove(target, true); | 2205 this._targets.remove(target, true); |
| 2189 }, | 2206 }, |
| 2190 | 2207 |
| 2191 __proto__: WebInspector.Object.prototype | 2208 __proto__: WebInspector.Object.prototype |
| 2192 } | 2209 } |
| OLD | NEW |