| 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 10 matching lines...) Expand all Loading... |
| 21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 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 * @constructor | 30 * @constructor |
| 31 * @extends {WebInspector.TargetAwareObject} | 31 * @extends {WebInspector.SDKObject} |
| 32 * @param {!WebInspector.Target} target | 32 * @param {!WebInspector.Target} target |
| 33 * @implements {ProfilerAgent.Dispatcher} | 33 * @implements {ProfilerAgent.Dispatcher} |
| 34 */ | 34 */ |
| 35 WebInspector.CPUProfilerModel = function(target) | 35 WebInspector.CPUProfilerModel = function(target) |
| 36 { | 36 { |
| 37 WebInspector.TargetAwareObject.call(this, target); | 37 WebInspector.SDKObject.call(this, 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 | 42 |
| 43 WebInspector.CPUProfilerModel.EventTypes = { | 43 WebInspector.CPUProfilerModel.EventTypes = { |
| 44 ProfileStarted: "ProfileStarted", | 44 ProfileStarted: "ProfileStarted", |
| 45 ProfileStopped: "ProfileStopped", | 45 ProfileStopped: "ProfileStopped", |
| 46 ConsoleProfileStarted: "ConsoleProfileStarted", | 46 ConsoleProfileStarted: "ConsoleProfileStarted", |
| 47 ConsoleProfileFinished: "ConsoleProfileFinished" | 47 ConsoleProfileFinished: "ConsoleProfileFinished" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 /** | 94 /** |
| 95 * @param {!function(?string,?ProfilerAgent.CPUProfile)} callback | 95 * @param {!function(?string,?ProfilerAgent.CPUProfile)} callback |
| 96 */ | 96 */ |
| 97 stopRecording: function(callback) | 97 stopRecording: function(callback) |
| 98 { | 98 { |
| 99 this._isRecording = false; | 99 this._isRecording = false; |
| 100 this.target().profilerAgent().stop(callback); | 100 this.target().profilerAgent().stop(callback); |
| 101 this.dispatchEventToListeners(WebInspector.CPUProfilerModel.EventTypes.P
rofileStopped); | 101 this.dispatchEventToListeners(WebInspector.CPUProfilerModel.EventTypes.P
rofileStopped); |
| 102 }, | 102 }, |
| 103 | 103 |
| 104 __proto__: WebInspector.TargetAwareObject.prototype | 104 __proto__: WebInspector.SDKObject.prototype |
| 105 } | 105 } |
| 106 | 106 |
| 107 /** | 107 /** |
| 108 * @type {!WebInspector.CPUProfilerModel} | 108 * @type {!WebInspector.CPUProfilerModel} |
| 109 */ | 109 */ |
| 110 WebInspector.cpuProfilerModel; | 110 WebInspector.cpuProfilerModel; |
| OLD | NEW |