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 23 matching lines...) Expand all Loading... |
34 */ | 34 */ |
35 WebInspector.CPUProfilerModel = function(target) | 35 WebInspector.CPUProfilerModel = function(target) |
36 { | 36 { |
37 WebInspector.SDKModel.call(this, WebInspector.CPUProfilerModel, target); | 37 WebInspector.SDKModel.call(this, WebInspector.CPUProfilerModel, target); |
38 this._isRecording = false; | 38 this._isRecording = false; |
39 target.registerProfilerDispatcher(this); | 39 target.registerProfilerDispatcher(this); |
40 target.profilerAgent().enable(); | 40 target.profilerAgent().enable(); |
41 | 41 |
42 this._configureCpuProfilerSamplingInterval(); | 42 this._configureCpuProfilerSamplingInterval(); |
43 WebInspector.moduleSetting("highResolutionCpuProfiling").addChangeListener(t
his._configureCpuProfilerSamplingInterval, this); | 43 WebInspector.moduleSetting("highResolutionCpuProfiling").addChangeListener(t
his._configureCpuProfilerSamplingInterval, this); |
44 } | 44 }; |
45 | 45 |
46 /** @enum {symbol} */ | 46 /** @enum {symbol} */ |
47 WebInspector.CPUProfilerModel.Events = { | 47 WebInspector.CPUProfilerModel.Events = { |
48 ConsoleProfileStarted: Symbol("ConsoleProfileStarted"), | 48 ConsoleProfileStarted: Symbol("ConsoleProfileStarted"), |
49 ConsoleProfileFinished: Symbol("ConsoleProfileFinished") | 49 ConsoleProfileFinished: Symbol("ConsoleProfileFinished") |
50 }; | 50 }; |
51 | 51 |
52 /** @typedef {!{id: string, scriptLocation: !WebInspector.DebuggerModel.Location
, title: (string|undefined), cpuProfile: (!ProfilerAgent.Profile|undefined)}} */ | 52 /** @typedef {!{id: string, scriptLocation: !WebInspector.DebuggerModel.Location
, title: (string|undefined), cpuProfile: (!ProfilerAgent.Profile|undefined)}} */ |
53 WebInspector.CPUProfilerModel.EventData; | 53 WebInspector.CPUProfilerModel.EventData; |
54 | 54 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 this._isRecording = false; | 133 this._isRecording = false; |
134 return this.target().profilerAgent().stop(extractProfile); | 134 return this.target().profilerAgent().stop(extractProfile); |
135 }, | 135 }, |
136 | 136 |
137 dispose: function() | 137 dispose: function() |
138 { | 138 { |
139 WebInspector.moduleSetting("highResolutionCpuProfiling").removeChangeLis
tener(this._configureCpuProfilerSamplingInterval, this); | 139 WebInspector.moduleSetting("highResolutionCpuProfiling").removeChangeLis
tener(this._configureCpuProfilerSamplingInterval, this); |
140 }, | 140 }, |
141 | 141 |
142 __proto__: WebInspector.SDKModel.prototype | 142 __proto__: WebInspector.SDKModel.prototype |
143 } | 143 }; |
OLD | NEW |