Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @param {!WebInspector.Target} target | 7 * @param {!WebInspector.Target} target |
| 8 * @param {!WebInspector.TimelineLifecycleDelegate} delegate | 8 * @param {!WebInspector.TimelineLifecycleDelegate} delegate |
| 9 * @param {!WebInspector.TracingModel} tracingModel | 9 * @param {!WebInspector.TracingModel} tracingModel |
| 10 * @implements {WebInspector.TargetManager.Observer} | 10 * @implements {WebInspector.TargetManager.Observer} |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 */ | 165 */ |
| 166 _startRecordingWithCategories: function(categories, enableJSSampling, callba ck) | 166 _startRecordingWithCategories: function(categories, enableJSSampling, callba ck) |
| 167 { | 167 { |
| 168 WebInspector.targetManager.suspendAllTargets(); | 168 WebInspector.targetManager.suspendAllTargets(); |
| 169 var profilingStartedPromise = enableJSSampling && !Runtime.experiments.i sEnabled("timelineTracingJSProfile") ? | 169 var profilingStartedPromise = enableJSSampling && !Runtime.experiments.i sEnabled("timelineTracingJSProfile") ? |
| 170 this._startProfilingOnAllTargets() : Promise.resolve(); | 170 this._startProfilingOnAllTargets() : Promise.resolve(); |
| 171 var samplingFrequencyHz = WebInspector.moduleSetting("highResolutionCpuP rofiling").get() ? 10000 : 1000; | 171 var samplingFrequencyHz = WebInspector.moduleSetting("highResolutionCpuP rofiling").get() ? 10000 : 1000; |
| 172 var options = "sampling-frequency=" + samplingFrequencyHz; | 172 var options = "sampling-frequency=" + samplingFrequencyHz; |
| 173 var target = this._target; | 173 var target = this._target; |
| 174 var tracingManager = target.tracingManager; | 174 var tracingManager = target.tracingManager; |
| 175 target.resourceTreeModel.suspendReload(); | 175 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target ); |
| 176 if (resourceTreeModel) | |
| 177 resourceTreeModel.suspendReload(); | |
|
dgozman
2016/08/19 20:23:37
Didn't we agree to move suspend/resume to target m
eostroukhov
2016/08/20 01:22:31
Done.
| |
| 176 profilingStartedPromise.then(tracingManager.start.bind(tracingManager, t his, categories, options, onTraceStarted)); | 178 profilingStartedPromise.then(tracingManager.start.bind(tracingManager, t his, categories, options, onTraceStarted)); |
| 177 /** | 179 /** |
| 178 * @param {?string} error | 180 * @param {?string} error |
| 179 */ | 181 */ |
| 180 function onTraceStarted(error) | 182 function onTraceStarted(error) |
| 181 { | 183 { |
| 182 target.resourceTreeModel.resumeReload(); | 184 if (resourceTreeModel) |
| 185 resourceTreeModel.resumeReload(); | |
| 183 if (callback) | 186 if (callback) |
| 184 callback(error); | 187 callback(error); |
| 185 } | 188 } |
| 186 }, | 189 }, |
| 187 | 190 |
| 188 /** | 191 /** |
| 189 * @override | 192 * @override |
| 190 */ | 193 */ |
| 191 tracingStarted: function() | 194 tracingStarted: function() |
| 192 { | 195 { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 | 281 |
| 279 /** | 282 /** |
| 280 * @param {number} progress | 283 * @param {number} progress |
| 281 * @override | 284 * @override |
| 282 */ | 285 */ |
| 283 eventsRetrievalProgress: function(progress) | 286 eventsRetrievalProgress: function(progress) |
| 284 { | 287 { |
| 285 this._delegate.loadingProgress(progress); | 288 this._delegate.loadingProgress(progress); |
| 286 } | 289 } |
| 287 } | 290 } |
| OLD | NEW |