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} |
| 11 * @implements {WebInspector.TracingManagerClient} | 11 * @implements {WebInspector.TracingManagerClient} |
| 12 */ | 12 */ |
| 13 WebInspector.TimelineController = function(target, delegate, tracingModel) | 13 WebInspector.TimelineController = function(target, delegate, tracingModel) |
| 14 { | 14 { |
| 15 this._delegate = delegate; | 15 this._delegate = delegate; |
| 16 this._target = target; | 16 this._target = target; |
| 17 this._tracingModel = tracingModel; | 17 this._tracingModel = tracingModel; |
| 18 this._targets = []; | 18 this._targets = []; |
| 19 this._allProfilesStoppedPromise = Promise.resolve(); | 19 this._allProfilesStoppedPromise = Promise.resolve(); |
| 20 this._targetsResumedPromise = Promise.resolve(); | 20 this._targetsResumedPromise = Promise.resolve(); |
| 21 this._extensionTraceProviders = WebInspector.extensionServer.traceProviders( ); | |
| 21 WebInspector.targetManager.observeTargets(this); | 22 WebInspector.targetManager.observeTargets(this); |
| 22 } | 23 } |
| 23 | 24 |
| 24 WebInspector.TimelineController.prototype = { | 25 WebInspector.TimelineController.prototype = { |
| 25 /** | 26 /** |
| 26 * @param {boolean} captureCauses | 27 * @param {boolean} captureCauses |
| 27 * @param {boolean} enableJSSampling | 28 * @param {boolean} enableJSSampling |
| 28 * @param {boolean} captureMemory | 29 * @param {boolean} captureMemory |
| 29 * @param {boolean} capturePictures | 30 * @param {boolean} capturePictures |
| 30 * @param {boolean} captureFilmStrip | 31 * @param {boolean} captureFilmStrip |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 60 if (captureCauses && Runtime.experiments.isEnabled("timelineInvalidation Tracking")) | 61 if (captureCauses && Runtime.experiments.isEnabled("timelineInvalidation Tracking")) |
| 61 categoriesArray.push(disabledByDefault("devtools.timeline.invalidati onTracking")); | 62 categoriesArray.push(disabledByDefault("devtools.timeline.invalidati onTracking")); |
| 62 if (capturePictures) { | 63 if (capturePictures) { |
| 63 categoriesArray.push(disabledByDefault("devtools.timeline.layers"), | 64 categoriesArray.push(disabledByDefault("devtools.timeline.layers"), |
| 64 disabledByDefault("devtools.timeline.picture"), | 65 disabledByDefault("devtools.timeline.picture"), |
| 65 disabledByDefault("blink.graphics_context_annot ations")); | 66 disabledByDefault("blink.graphics_context_annot ations")); |
| 66 } | 67 } |
| 67 if (captureFilmStrip) | 68 if (captureFilmStrip) |
| 68 categoriesArray.push(disabledByDefault("devtools.screenshot")); | 69 categoriesArray.push(disabledByDefault("devtools.screenshot")); |
| 69 | 70 |
| 71 for (var traceProvider of this._extensionTraceProviders) { | |
|
caseq
2016/07/08 00:57:49
nit: drop redundant {}
| |
| 72 traceProvider.run(); | |
| 73 } | |
| 74 | |
| 70 var categories = categoriesArray.join(","); | 75 var categories = categoriesArray.join(","); |
| 71 this._startRecordingWithCategories(categories, enableJSSampling); | 76 this._startRecordingWithCategories(categories, enableJSSampling); |
| 72 }, | 77 }, |
| 73 | 78 |
| 74 stopRecording: function() | 79 stopRecording: function() |
| 75 { | 80 { |
| 76 this._allProfilesStoppedPromise = this._stopProfilingOnAllTargets(); | 81 this._allProfilesStoppedPromise = this._stopProfilingOnAllTargets(); |
| 77 this._target.tracingManager.stop(); | 82 this._target.tracingManager.stop(); |
| 78 this._targetsResumedPromise = WebInspector.targetManager.resumeAllTarget s(); | 83 this._targetsResumedPromise = WebInspector.targetManager.resumeAllTarget s(); |
| 79 this._delegate.loadingStarted(); | 84 this._delegate.loadingStarted(); |
| 85 | |
| 86 var target = WebInspector.targetManager.mainTarget(); | |
| 87 var requests = target.networkLog.requests().slice(); | |
|
caseq
2016/07/08 00:57:49
Why are we doing this? This does not look good.
| |
| 88 for (var traceProvider of this._extensionTraceProviders) { | |
| 89 traceProvider.stop(requests); | |
| 90 } | |
| 80 }, | 91 }, |
| 81 | 92 |
| 82 /** | 93 /** |
| 83 * @override | 94 * @override |
| 84 * @param {!WebInspector.Target} target | 95 * @param {!WebInspector.Target} target |
| 85 */ | 96 */ |
| 86 targetAdded: function(target) | 97 targetAdded: function(target) |
| 87 { | 98 { |
| 88 this._targets.push(target); | 99 this._targets.push(target); |
| 89 if (this._profiling) | 100 if (this._profiling) |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 | 287 |
| 277 /** | 288 /** |
| 278 * @param {number} progress | 289 * @param {number} progress |
| 279 * @override | 290 * @override |
| 280 */ | 291 */ |
| 281 eventsRetrievalProgress: function(progress) | 292 eventsRetrievalProgress: function(progress) |
| 282 { | 293 { |
| 283 this._delegate.loadingProgress(progress); | 294 this._delegate.loadingProgress(progress); |
| 284 } | 295 } |
| 285 } | 296 } |
| OLD | NEW |