| 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 11 matching lines...) Expand all Loading... |
| 22 WebInspector.TimelineController.prototype = { | 22 WebInspector.TimelineController.prototype = { |
| 23 /** | 23 /** |
| 24 * @param {boolean} captureCauses | 24 * @param {boolean} captureCauses |
| 25 * @param {boolean} enableJSSampling | 25 * @param {boolean} enableJSSampling |
| 26 * @param {boolean} captureMemory | 26 * @param {boolean} captureMemory |
| 27 * @param {boolean} capturePictures | 27 * @param {boolean} capturePictures |
| 28 * @param {boolean} captureFilmStrip | 28 * @param {boolean} captureFilmStrip |
| 29 */ | 29 */ |
| 30 startRecording: function(captureCauses, enableJSSampling, captureMemory, cap
turePictures, captureFilmStrip) | 30 startRecording: function(captureCauses, enableJSSampling, captureMemory, cap
turePictures, captureFilmStrip) |
| 31 { | 31 { |
| 32 this._extensionTraceProviders = WebInspector.extensionServer.traceProvid
ers().slice(); |
| 33 |
| 32 function disabledByDefault(category) | 34 function disabledByDefault(category) |
| 33 { | 35 { |
| 34 return "disabled-by-default-" + category; | 36 return "disabled-by-default-" + category; |
| 35 } | 37 } |
| 36 var categoriesArray = [ | 38 var categoriesArray = [ |
| 37 "-*", | 39 "-*", |
| 38 "devtools.timeline", | 40 "devtools.timeline", |
| 39 "v8.execute", | 41 "v8.execute", |
| 40 disabledByDefault("devtools.timeline"), | 42 disabledByDefault("devtools.timeline"), |
| 41 disabledByDefault("devtools.timeline.frame"), | 43 disabledByDefault("devtools.timeline.frame"), |
| (...skipping 17 matching lines...) Expand all Loading... |
| 59 if (captureCauses && Runtime.experiments.isEnabled("timelineInvalidation
Tracking")) | 61 if (captureCauses && Runtime.experiments.isEnabled("timelineInvalidation
Tracking")) |
| 60 categoriesArray.push(disabledByDefault("devtools.timeline.invalidati
onTracking")); | 62 categoriesArray.push(disabledByDefault("devtools.timeline.invalidati
onTracking")); |
| 61 if (capturePictures) { | 63 if (capturePictures) { |
| 62 categoriesArray.push(disabledByDefault("devtools.timeline.layers"), | 64 categoriesArray.push(disabledByDefault("devtools.timeline.layers"), |
| 63 disabledByDefault("devtools.timeline.picture"), | 65 disabledByDefault("devtools.timeline.picture"), |
| 64 disabledByDefault("blink.graphics_context_annot
ations")); | 66 disabledByDefault("blink.graphics_context_annot
ations")); |
| 65 } | 67 } |
| 66 if (captureFilmStrip) | 68 if (captureFilmStrip) |
| 67 categoriesArray.push(disabledByDefault("devtools.screenshot")); | 69 categoriesArray.push(disabledByDefault("devtools.screenshot")); |
| 68 | 70 |
| 71 for (var traceProvider of this._extensionTraceProviders) |
| 72 traceProvider.start(); |
| 73 |
| 69 var categories = categoriesArray.join(","); | 74 var categories = categoriesArray.join(","); |
| 70 this._startRecordingWithCategories(categories, enableJSSampling); | 75 this._startRecordingWithCategories(categories, enableJSSampling); |
| 71 }, | 76 }, |
| 72 | 77 |
| 73 stopRecording: function() | 78 stopRecording: function() |
| 74 { | 79 { |
| 75 var tracingStoppedPromises = []; | 80 var tracingStoppedPromises = []; |
| 76 tracingStoppedPromises.push(new Promise(resolve => this._tracingComplete
Callback = resolve)); | 81 tracingStoppedPromises.push(new Promise(resolve => this._tracingComplete
Callback = resolve)); |
| 77 tracingStoppedPromises.push(this._stopProfilingOnAllTargets()); | 82 tracingStoppedPromises.push(this._stopProfilingOnAllTargets()); |
| 78 this._target.tracingManager.stop(); | 83 this._target.tracingManager.stop(); |
| 79 tracingStoppedPromises.push(WebInspector.targetManager.resumeAllTargets(
)); | 84 tracingStoppedPromises.push(WebInspector.targetManager.resumeAllTargets(
)); |
| 80 Promise.all(tracingStoppedPromises).then(() => this._allSourcesFinished(
)); | 85 Promise.all(tracingStoppedPromises).then(() => this._allSourcesFinished(
)); |
| 81 | 86 |
| 82 this._delegate.loadingStarted(); | 87 this._delegate.loadingStarted(); |
| 88 |
| 89 for (var traceProvider of this._extensionTraceProviders) |
| 90 traceProvider.stop(); |
| 83 }, | 91 }, |
| 84 | 92 |
| 85 /** | 93 /** |
| 86 * @override | 94 * @override |
| 87 * @param {!WebInspector.Target} target | 95 * @param {!WebInspector.Target} target |
| 88 */ | 96 */ |
| 89 targetAdded: function(target) | 97 targetAdded: function(target) |
| 90 { | 98 { |
| 91 this._targets.push(target); | 99 this._targets.push(target); |
| 92 if (this._profiling) | 100 if (this._profiling) |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 287 |
| 280 /** | 288 /** |
| 281 * @param {number} progress | 289 * @param {number} progress |
| 282 * @override | 290 * @override |
| 283 */ | 291 */ |
| 284 eventsRetrievalProgress: function(progress) | 292 eventsRetrievalProgress: function(progress) |
| 285 { | 293 { |
| 286 this._delegate.loadingProgress(progress); | 294 this._delegate.loadingProgress(progress); |
| 287 } | 295 } |
| 288 } | 296 } |
| OLD | NEW |