| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 this.setProfileBeingRecorded(null); | 222 this.setProfileBeingRecorded(null); |
| 223 } | 223 } |
| 224 | 224 |
| 225 /** | 225 /** |
| 226 * @this {Profiler.CPUProfileType} | 226 * @this {Profiler.CPUProfileType} |
| 227 */ | 227 */ |
| 228 function fireEvent() { | 228 function fireEvent() { |
| 229 this.dispatchEventToListeners(Profiler.ProfileType.Events.ProfileComplete,
recordedProfile); | 229 this.dispatchEventToListeners(Profiler.ProfileType.Events.ProfileComplete,
recordedProfile); |
| 230 } | 230 } |
| 231 | 231 |
| 232 this.profileBeingRecorded().target() | 232 this.profileBeingRecorded() |
| 233 .target() |
| 233 .cpuProfilerModel.stopRecording() | 234 .cpuProfilerModel.stopRecording() |
| 234 .then(didStopProfiling.bind(this)) | 235 .then(didStopProfiling.bind(this)) |
| 235 .then(SDK.targetManager.resumeAllTargets.bind(SDK.targetManager)) | 236 .then(SDK.targetManager.resumeAllTargets.bind(SDK.targetManager)) |
| 236 .then(fireEvent.bind(this)); | 237 .then(fireEvent.bind(this)); |
| 237 } | 238 } |
| 238 | 239 |
| 239 /** | 240 /** |
| 240 * @override | 241 * @override |
| 241 * @param {string} title | 242 * @param {string} title |
| 242 * @return {!Profiler.ProfileHeader} | 243 * @return {!Profiler.ProfileHeader} |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 maxDepth = Math.max(maxDepth, depth); | 368 maxDepth = Math.max(maxDepth, depth); |
| 368 } | 369 } |
| 369 this._cpuProfile.forEachFrame(onOpenFrame, onCloseFrame); | 370 this._cpuProfile.forEachFrame(onOpenFrame, onCloseFrame); |
| 370 | 371 |
| 371 /** @type {!Array<!SDK.CPUProfileNode>} */ | 372 /** @type {!Array<!SDK.CPUProfileNode>} */ |
| 372 var entryNodes = new Array(entries.length); | 373 var entryNodes = new Array(entries.length); |
| 373 var entryLevels = new Uint16Array(entries.length); | 374 var entryLevels = new Uint16Array(entries.length); |
| 374 var entryTotalTimes = new Float32Array(entries.length); | 375 var entryTotalTimes = new Float32Array(entries.length); |
| 375 var entrySelfTimes = new Float32Array(entries.length); | 376 var entrySelfTimes = new Float32Array(entries.length); |
| 376 var entryStartTimes = new Float64Array(entries.length); | 377 var entryStartTimes = new Float64Array(entries.length); |
| 377 var minimumBoundary = this.minimumBoundary(); | |
| 378 | 378 |
| 379 for (var i = 0; i < entries.length; ++i) { | 379 for (var i = 0; i < entries.length; ++i) { |
| 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 |
| (...skipping 70 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 |