| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 var cpuProfilerModel = UI.context.flavor(SDK.CPUProfilerModel); | 192 var cpuProfilerModel = UI.context.flavor(SDK.CPUProfilerModel); |
| 193 if (this.profileBeingRecorded() || !cpuProfilerModel) | 193 if (this.profileBeingRecorded() || !cpuProfilerModel) |
| 194 return; | 194 return; |
| 195 var profile = new Profiler.CPUProfileHeader(cpuProfilerModel.target(), this)
; | 195 var profile = new Profiler.CPUProfileHeader(cpuProfilerModel.target(), this)
; |
| 196 this.setProfileBeingRecorded(profile); | 196 this.setProfileBeingRecorded(profile); |
| 197 SDK.targetManager.suspendAllTargets(); | 197 SDK.targetManager.suspendAllTargets(); |
| 198 this.addProfile(profile); | 198 this.addProfile(profile); |
| 199 profile.updateStatus(Common.UIString('Recording\u2026')); | 199 profile.updateStatus(Common.UIString('Recording\u2026')); |
| 200 this._recording = true; | 200 this._recording = true; |
| 201 cpuProfilerModel.startRecording(); | 201 cpuProfilerModel.startRecording(); |
| 202 Host.userMetrics.actionTaken(Host.UserMetrics.Action.ProfilesCPUProfileTaken
); |
| 202 } | 203 } |
| 203 | 204 |
| 204 stopRecordingProfile() { | 205 stopRecordingProfile() { |
| 205 this._recording = false; | 206 this._recording = false; |
| 206 if (!this.profileBeingRecorded() || !this.profileBeingRecorded().target()) | 207 if (!this.profileBeingRecorded() || !this.profileBeingRecorded().target()) |
| 207 return; | 208 return; |
| 208 | 209 |
| 209 var recordedProfile; | 210 var recordedProfile; |
| 210 | 211 |
| 211 /** | 212 /** |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 * @param {!SDK.CPUProfileNode} node | 460 * @param {!SDK.CPUProfileNode} node |
| 460 */ | 461 */ |
| 461 constructor(depth, duration, startTime, selfTime, node) { | 462 constructor(depth, duration, startTime, selfTime, node) { |
| 462 this.depth = depth; | 463 this.depth = depth; |
| 463 this.duration = duration; | 464 this.duration = duration; |
| 464 this.startTime = startTime; | 465 this.startTime = startTime; |
| 465 this.selfTime = selfTime; | 466 this.selfTime = selfTime; |
| 466 this.node = node; | 467 this.node = node; |
| 467 } | 468 } |
| 468 }; | 469 }; |
| OLD | NEW |