OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * | 10 * |
(...skipping 14 matching lines...) Expand all Loading... |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 /** | 29 /** |
30 * @implements {Protocol.ProfilerDispatcher} | 30 * @implements {Protocol.ProfilerDispatcher} |
31 */ | 31 */ |
32 SDK.CPUProfilerModel = class extends SDK.SDKModel { | 32 SDK.CPUProfilerModel = class extends SDK.SDKModel { |
33 /** | 33 /** |
34 * @param {!SDK.Target} target | 34 * @param {!SDK.Target} target |
| 35 * @param {!Protocol.Dispatcher} dispatcher |
35 */ | 36 */ |
36 constructor(target) { | 37 constructor(target, dispatcher) { |
37 super(target); | 38 super(target, dispatcher); |
38 this._isRecording = false; | 39 this._isRecording = false; |
39 this._nextAnonymousConsoleProfileNumber = 1; | 40 this._nextAnonymousConsoleProfileNumber = 1; |
40 this._anonymousConsoleProfileIdToTitle = new Map(); | 41 this._anonymousConsoleProfileIdToTitle = new Map(); |
41 this._profilerAgent = target.profilerAgent(); | 42 this._profilerAgent = dispatcher.profilerAgent(); |
42 target.registerProfilerDispatcher(this); | 43 dispatcher.registerProfilerDispatcher(this); |
43 this._profilerAgent.enable(); | 44 this._profilerAgent.enable(); |
44 this._debuggerModel = /** @type {!SDK.DebuggerModel} */ (target.model(SDK.De
buggerModel)); | 45 this._debuggerModel = /** @type {!SDK.DebuggerModel} */ (target.model(SDK.De
buggerModel)); |
45 } | 46 } |
46 | 47 |
47 /** | 48 /** |
48 * @return {!SDK.RuntimeModel} | 49 * @return {!SDK.RuntimeModel} |
49 */ | 50 */ |
50 runtimeModel() { | 51 runtimeModel() { |
51 return this._debuggerModel.runtimeModel(); | 52 return this._debuggerModel.runtimeModel(); |
52 } | 53 } |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 SDK.SDKModel.register(SDK.CPUProfilerModel, SDK.Target.Capability.JS, true); | 162 SDK.SDKModel.register(SDK.CPUProfilerModel, SDK.Target.Capability.JS, true); |
162 | 163 |
163 /** @enum {symbol} */ | 164 /** @enum {symbol} */ |
164 SDK.CPUProfilerModel.Events = { | 165 SDK.CPUProfilerModel.Events = { |
165 ConsoleProfileStarted: Symbol('ConsoleProfileStarted'), | 166 ConsoleProfileStarted: Symbol('ConsoleProfileStarted'), |
166 ConsoleProfileFinished: Symbol('ConsoleProfileFinished') | 167 ConsoleProfileFinished: Symbol('ConsoleProfileFinished') |
167 }; | 168 }; |
168 | 169 |
169 /** @typedef {!{id: string, scriptLocation: !SDK.DebuggerModel.Location, title:
string, cpuProfile: (!Protocol.Profiler.Profile|undefined), cpuProfilerModel: !S
DK.CPUProfilerModel}} */ | 170 /** @typedef {!{id: string, scriptLocation: !SDK.DebuggerModel.Location, title:
string, cpuProfile: (!Protocol.Profiler.Profile|undefined), cpuProfilerModel: !S
DK.CPUProfilerModel}} */ |
170 SDK.CPUProfilerModel.EventData; | 171 SDK.CPUProfilerModel.EventData; |
OLD | NEW |