Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js

Issue 2128133002: Timeline AddTraceProvider API Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Timeline AddTraceProvider API Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/externs.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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( );
caseq 2016/07/11 18:42:42 let's move this to startRecording() and make a cop
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
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)
72 traceProvider.run();
73
70 var categories = categoriesArray.join(","); 74 var categories = categoriesArray.join(",");
71 this._startRecordingWithCategories(categories, enableJSSampling); 75 this._startRecordingWithCategories(categories, enableJSSampling);
72 }, 76 },
73 77
74 stopRecording: function() 78 stopRecording: function()
75 { 79 {
76 this._allProfilesStoppedPromise = this._stopProfilingOnAllTargets(); 80 this._allProfilesStoppedPromise = this._stopProfilingOnAllTargets();
77 this._target.tracingManager.stop(); 81 this._target.tracingManager.stop();
78 this._targetsResumedPromise = WebInspector.targetManager.resumeAllTarget s(); 82 this._targetsResumedPromise = WebInspector.targetManager.resumeAllTarget s();
79 this._delegate.loadingStarted(); 83 this._delegate.loadingStarted();
84
85 var target = WebInspector.targetManager.mainTarget();
86 //var requests = target.networkLog.requests().slice();
caseq 2016/07/11 18:42:42 drop this.
87 for (var traceProvider of this._extensionTraceProviders)
88 traceProvider.stop();
80 }, 89 },
81 90
82 /** 91 /**
83 * @override 92 * @override
84 * @param {!WebInspector.Target} target 93 * @param {!WebInspector.Target} target
85 */ 94 */
86 targetAdded: function(target) 95 targetAdded: function(target)
87 { 96 {
88 this._targets.push(target); 97 this._targets.push(target);
89 if (this._profiling) 98 if (this._profiling)
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 285
277 /** 286 /**
278 * @param {number} progress 287 * @param {number} progress
279 * @override 288 * @override
280 */ 289 */
281 eventsRetrievalProgress: function(progress) 290 eventsRetrievalProgress: function(progress)
282 { 291 {
283 this._delegate.loadingProgress(progress); 292 this._delegate.loadingProgress(progress);
284 } 293 }
285 } 294 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/externs.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698