| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @constructor | 8 * @constructor |
| 9 * @extends {WebInspector.Object} | 9 * @extends {WebInspector.Object} |
| 10 * @implements {WebInspector.TargetManager.Observer} | 10 * @implements {WebInspector.TargetManager.Observer} |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 /** | 85 /** |
| 86 * @param {string} categoryFilter | 86 * @param {string} categoryFilter |
| 87 * @param {string} options | 87 * @param {string} options |
| 88 * @param {function(?string)=} callback | 88 * @param {function(?string)=} callback |
| 89 */ | 89 */ |
| 90 start: function(categoryFilter, options, callback) | 90 start: function(categoryFilter, options, callback) |
| 91 { | 91 { |
| 92 if (this._active) | 92 if (this._active) |
| 93 return; | 93 return; |
| 94 WebInspector.profilingLock().acquire(); | 94 WebInspector.targetManager.suspendAllTargets(); |
| 95 this._shouldReleaseLock = true; | |
| 96 var bufferUsageReportingIntervalMs = 500; | 95 var bufferUsageReportingIntervalMs = 500; |
| 97 TracingAgent.start(categoryFilter, options, bufferUsageReportingInterval
Ms, callback); | 96 TracingAgent.start(categoryFilter, options, bufferUsageReportingInterval
Ms, callback); |
| 98 this._active = true; | 97 this._active = true; |
| 99 this.dispatchEventToListeners(WebInspector.TracingManager.Events.Tracing
Started); | 98 this.dispatchEventToListeners(WebInspector.TracingManager.Events.Tracing
Started); |
| 100 }, | 99 }, |
| 101 | 100 |
| 102 stop: function() | 101 stop: function() |
| 103 { | 102 { |
| 104 if (!this._active) | 103 if (!this._active) |
| 105 return; | 104 return; |
| 106 TracingAgent.end(this._onStop.bind(this)); | 105 TracingAgent.end(this._onStop.bind(this)); |
| 107 if (this._shouldReleaseLock) { | 106 WebInspector.targetManager.resumeAllTargets(); |
| 108 this._shouldReleaseLock = false; | |
| 109 WebInspector.profilingLock().release(); | |
| 110 } | |
| 111 }, | 107 }, |
| 112 | 108 |
| 113 _onStop: function() | 109 _onStop: function() |
| 114 { | 110 { |
| 115 if (!this._active) | 111 if (!this._active) |
| 116 return; | 112 return; |
| 117 this.dispatchEventToListeners(WebInspector.TracingManager.Events.Tracing
Stopped); | 113 this.dispatchEventToListeners(WebInspector.TracingManager.Events.Tracing
Stopped); |
| 118 this._active = false; | 114 this._active = false; |
| 119 }, | 115 }, |
| 120 | 116 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 146 dataCollected: function(data) | 142 dataCollected: function(data) |
| 147 { | 143 { |
| 148 this._tracingManager._eventsCollected(data); | 144 this._tracingManager._eventsCollected(data); |
| 149 }, | 145 }, |
| 150 | 146 |
| 151 tracingComplete: function() | 147 tracingComplete: function() |
| 152 { | 148 { |
| 153 this._tracingManager._tracingComplete(); | 149 this._tracingManager._tracingComplete(); |
| 154 } | 150 } |
| 155 } | 151 } |
| OLD | NEW |