| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 this._addMessageToConsole(WebInspector.ConsoleMessage.MessageType.Profil
e, data.scriptLocation, WebInspector.UIString("Profile '%s' started.", resolvedT
itle)); | 158 this._addMessageToConsole(WebInspector.ConsoleMessage.MessageType.Profil
e, data.scriptLocation, WebInspector.UIString("Profile '%s' started.", resolvedT
itle)); |
| 159 }, | 159 }, |
| 160 | 160 |
| 161 /** | 161 /** |
| 162 * @param {!WebInspector.Event} event | 162 * @param {!WebInspector.Event} event |
| 163 */ | 163 */ |
| 164 _consoleProfileFinished: function(event) | 164 _consoleProfileFinished: function(event) |
| 165 { | 165 { |
| 166 var data = /** @type {!WebInspector.CPUProfilerModel.EventData} */ (even
t.data); | 166 var data = /** @type {!WebInspector.CPUProfilerModel.EventData} */ (even
t.data); |
| 167 var cpuProfile = /** @type {!ProfilerAgent.CPUProfile} */ (data.cpuProfi
le); | 167 var cpuProfile = /** @type {!ProfilerAgent.Profile} */ (data.cpuProfile)
; |
| 168 var resolvedTitle = data.title; | 168 var resolvedTitle = data.title; |
| 169 if (typeof resolvedTitle === "undefined") { | 169 if (typeof resolvedTitle === "undefined") { |
| 170 resolvedTitle = this._anonymousConsoleProfileIdToTitle[data.id]; | 170 resolvedTitle = this._anonymousConsoleProfileIdToTitle[data.id]; |
| 171 delete this._anonymousConsoleProfileIdToTitle[data.id]; | 171 delete this._anonymousConsoleProfileIdToTitle[data.id]; |
| 172 } | 172 } |
| 173 var profile = new WebInspector.CPUProfileHeader(data.scriptLocation.targ
et(), this, resolvedTitle); | 173 var profile = new WebInspector.CPUProfileHeader(data.scriptLocation.targ
et(), this, resolvedTitle); |
| 174 profile.setProtocolProfile(cpuProfile); | 174 profile.setProtocolProfile(cpuProfile); |
| 175 this.addProfile(profile); | 175 this.addProfile(profile); |
| 176 this._addMessageToConsole(WebInspector.ConsoleMessage.MessageType.Profil
eEnd, data.scriptLocation, WebInspector.UIString("Profile '%s' finished.", resol
vedTitle)); | 176 this._addMessageToConsole(WebInspector.ConsoleMessage.MessageType.Profil
eEnd, data.scriptLocation, WebInspector.UIString("Profile '%s' finished.", resol
vedTitle)); |
| 177 }, | 177 }, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 222 |
| 223 stopRecordingProfile: function() | 223 stopRecordingProfile: function() |
| 224 { | 224 { |
| 225 this._recording = false; | 225 this._recording = false; |
| 226 if (!this._profileBeingRecorded || !this._profileBeingRecorded.target()) | 226 if (!this._profileBeingRecorded || !this._profileBeingRecorded.target()) |
| 227 return; | 227 return; |
| 228 | 228 |
| 229 var recordedProfile; | 229 var recordedProfile; |
| 230 | 230 |
| 231 /** | 231 /** |
| 232 * @param {?ProfilerAgent.CPUProfile} profile | 232 * @param {?ProfilerAgent.Profile} profile |
| 233 * @this {WebInspector.CPUProfileType} | 233 * @this {WebInspector.CPUProfileType} |
| 234 */ | 234 */ |
| 235 function didStopProfiling(profile) | 235 function didStopProfiling(profile) |
| 236 { | 236 { |
| 237 if (!this._profileBeingRecorded) | 237 if (!this._profileBeingRecorded) |
| 238 return; | 238 return; |
| 239 console.assert(profile); | 239 console.assert(profile); |
| 240 this._profileBeingRecorded.setProtocolProfile(profile); | 240 this._profileBeingRecorded.setProtocolProfile(profile); |
| 241 this._profileBeingRecorded.updateStatus(""); | 241 this._profileBeingRecorded.updateStatus(""); |
| 242 recordedProfile = this._profileBeingRecorded; | 242 recordedProfile = this._profileBeingRecorded; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 /** | 294 /** |
| 295 * @override | 295 * @override |
| 296 * @return {!WebInspector.ProfileView} | 296 * @return {!WebInspector.ProfileView} |
| 297 */ | 297 */ |
| 298 createView: function() | 298 createView: function() |
| 299 { | 299 { |
| 300 return new WebInspector.CPUProfileView(this); | 300 return new WebInspector.CPUProfileView(this); |
| 301 }, | 301 }, |
| 302 | 302 |
| 303 /** | 303 /** |
| 304 * @return {!ProfilerAgent.CPUProfile} | 304 * @return {!ProfilerAgent.Profile} |
| 305 */ | 305 */ |
| 306 protocolProfile: function() | 306 protocolProfile: function() |
| 307 { | 307 { |
| 308 return this._protocolProfile; | 308 return this._protocolProfile; |
| 309 }, | 309 }, |
| 310 | 310 |
| 311 __proto__: WebInspector.WritableProfileHeader.prototype | 311 __proto__: WebInspector.WritableProfileHeader.prototype |
| 312 } | 312 } |
| 313 | 313 |
| 314 /** | 314 /** |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 pushEntryInfoRow(WebInspector.UIString("Aggregated self time"), Number.s
econdsToString(node.self / 1000, true)); | 492 pushEntryInfoRow(WebInspector.UIString("Aggregated self time"), Number.s
econdsToString(node.self / 1000, true)); |
| 493 pushEntryInfoRow(WebInspector.UIString("Aggregated total time"), Number.
secondsToString(node.total / 1000, true)); | 493 pushEntryInfoRow(WebInspector.UIString("Aggregated total time"), Number.
secondsToString(node.total / 1000, true)); |
| 494 if (node.deoptReason) | 494 if (node.deoptReason) |
| 495 pushEntryInfoRow(WebInspector.UIString("Not optimized"), node.deoptR
eason); | 495 pushEntryInfoRow(WebInspector.UIString("Not optimized"), node.deoptR
eason); |
| 496 | 496 |
| 497 return entryInfo; | 497 return entryInfo; |
| 498 }, | 498 }, |
| 499 | 499 |
| 500 __proto__: WebInspector.ProfileFlameChartDataProvider.prototype | 500 __proto__: WebInspector.ProfileFlameChartDataProvider.prototype |
| 501 } | 501 } |
| OLD | NEW |