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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 case 'self': | 59 case 'self': |
60 return Common.UIString('Self Time'); | 60 return Common.UIString('Self Time'); |
61 case 'total': | 61 case 'total': |
62 return Common.UIString('Total Time'); | 62 return Common.UIString('Total Time'); |
63 } | 63 } |
64 return ''; | 64 return ''; |
65 } | 65 } |
66 | 66 |
67 /** | 67 /** |
68 * @override | 68 * @override |
69 * @return {!UI.FlameChartDataProvider} | 69 * @return {!PerfUI.FlameChartDataProvider} |
70 */ | 70 */ |
71 createFlameChartDataProvider() { | 71 createFlameChartDataProvider() { |
72 return new Profiler.CPUFlameChartDataProvider(this.profile, this._profileHea
der.target()); | 72 return new Profiler.CPUFlameChartDataProvider(this.profile, this._profileHea
der.target()); |
73 } | 73 } |
74 }; | 74 }; |
75 | 75 |
76 /** | 76 /** |
77 * @unrestricted | 77 * @unrestricted |
78 */ | 78 */ |
79 Profiler.CPUProfileType = class extends Profiler.ProfileType { | 79 Profiler.CPUProfileType = class extends Profiler.ProfileType { |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 * @param {?SDK.Target} target | 333 * @param {?SDK.Target} target |
334 */ | 334 */ |
335 constructor(cpuProfile, target) { | 335 constructor(cpuProfile, target) { |
336 super(); | 336 super(); |
337 this._cpuProfile = cpuProfile; | 337 this._cpuProfile = cpuProfile; |
338 this._target = target; | 338 this._target = target; |
339 } | 339 } |
340 | 340 |
341 /** | 341 /** |
342 * @override | 342 * @override |
343 * @return {!UI.FlameChart.TimelineData} | 343 * @return {!PerfUI.FlameChart.TimelineData} |
344 */ | 344 */ |
345 _calculateTimelineData() { | 345 _calculateTimelineData() { |
346 /** @type {!Array.<?Profiler.CPUFlameChartDataProvider.ChartEntry>} */ | 346 /** @type {!Array.<?Profiler.CPUFlameChartDataProvider.ChartEntry>} */ |
347 var entries = []; | 347 var entries = []; |
348 /** @type {!Array.<number>} */ | 348 /** @type {!Array.<number>} */ |
349 var stack = []; | 349 var stack = []; |
350 var maxDepth = 5; | 350 var maxDepth = 5; |
351 | 351 |
352 function onOpenFrame() { | 352 function onOpenFrame() { |
353 stack.push(entries.length); | 353 stack.push(entries.length); |
(...skipping 26 matching lines...) Expand all Loading... |
380 var entry = entries[i]; | 380 var entry = entries[i]; |
381 entryNodes[i] = entry.node; | 381 entryNodes[i] = entry.node; |
382 entryLevels[i] = entry.depth; | 382 entryLevels[i] = entry.depth; |
383 entryTotalTimes[i] = entry.duration; | 383 entryTotalTimes[i] = entry.duration; |
384 entryStartTimes[i] = entry.startTime; | 384 entryStartTimes[i] = entry.startTime; |
385 entrySelfTimes[i] = entry.selfTime; | 385 entrySelfTimes[i] = entry.selfTime; |
386 } | 386 } |
387 | 387 |
388 this._maxStackDepth = maxDepth; | 388 this._maxStackDepth = maxDepth; |
389 | 389 |
390 this._timelineData = new UI.FlameChart.TimelineData(entryLevels, entryTotalT
imes, entryStartTimes, null); | 390 this._timelineData = new PerfUI.FlameChart.TimelineData(entryLevels, entryTo
talTimes, entryStartTimes, null); |
391 | 391 |
392 /** @type {!Array<!SDK.CPUProfileNode>} */ | 392 /** @type {!Array<!SDK.CPUProfileNode>} */ |
393 this._entryNodes = entryNodes; | 393 this._entryNodes = entryNodes; |
394 this._entrySelfTimes = entrySelfTimes; | 394 this._entrySelfTimes = entrySelfTimes; |
395 | 395 |
396 return this._timelineData; | 396 return this._timelineData; |
397 } | 397 } |
398 | 398 |
399 /** | 399 /** |
400 * @override | 400 * @override |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 * @param {!SDK.CPUProfileNode} node | 458 * @param {!SDK.CPUProfileNode} node |
459 */ | 459 */ |
460 constructor(depth, duration, startTime, selfTime, node) { | 460 constructor(depth, duration, startTime, selfTime, node) { |
461 this.depth = depth; | 461 this.depth = depth; |
462 this.duration = duration; | 462 this.duration = duration; |
463 this.startTime = startTime; | 463 this.startTime = startTime; |
464 this.selfTime = selfTime; | 464 this.selfTime = selfTime; |
465 this.node = node; | 465 this.node = node; |
466 } | 466 } |
467 }; | 467 }; |
OLD | NEW |