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

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: Merge branch 'master' of https://chromium.googlesource.com/chromium/src into record 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}
(...skipping 11 matching lines...) Expand all
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 disabledByDefault("devtools.timeline"), 41 disabledByDefault("devtools.timeline"),
40 disabledByDefault("devtools.timeline.frame"), 42 disabledByDefault("devtools.timeline.frame"),
41 WebInspector.TracingModel.TopLevelEventCategory, 43 WebInspector.TracingModel.TopLevelEventCategory,
(...skipping 16 matching lines...) Expand all
58 if (captureCauses && Runtime.experiments.isEnabled("timelineInvalidation Tracking")) 60 if (captureCauses && Runtime.experiments.isEnabled("timelineInvalidation Tracking"))
59 categoriesArray.push(disabledByDefault("devtools.timeline.invalidati onTracking")); 61 categoriesArray.push(disabledByDefault("devtools.timeline.invalidati onTracking"));
60 if (capturePictures) { 62 if (capturePictures) {
61 categoriesArray.push(disabledByDefault("devtools.timeline.layers"), 63 categoriesArray.push(disabledByDefault("devtools.timeline.layers"),
62 disabledByDefault("devtools.timeline.picture"), 64 disabledByDefault("devtools.timeline.picture"),
63 disabledByDefault("blink.graphics_context_annot ations")); 65 disabledByDefault("blink.graphics_context_annot ations"));
64 } 66 }
65 if (captureFilmStrip) 67 if (captureFilmStrip)
66 categoriesArray.push(disabledByDefault("devtools.screenshot")); 68 categoriesArray.push(disabledByDefault("devtools.screenshot"));
67 69
70 for (var traceProvider of this._extensionTraceProviders)
71 traceProvider.start();
72
68 var categories = categoriesArray.join(","); 73 var categories = categoriesArray.join(",");
69 this._startRecordingWithCategories(categories, enableJSSampling); 74 this._startRecordingWithCategories(categories, enableJSSampling);
70 }, 75 },
71 76
72 stopRecording: function() 77 stopRecording: function()
73 { 78 {
74 var tracingStoppedPromises = []; 79 var tracingStoppedPromises = [];
75 tracingStoppedPromises.push(new Promise(resolve => this._tracingComplete Callback = resolve)); 80 tracingStoppedPromises.push(new Promise(resolve => this._tracingComplete Callback = resolve));
76 tracingStoppedPromises.push(this._stopProfilingOnAllTargets()); 81 tracingStoppedPromises.push(this._stopProfilingOnAllTargets());
77 this._target.tracingManager.stop(); 82 this._target.tracingManager.stop();
78 tracingStoppedPromises.push(WebInspector.targetManager.resumeAllTargets( )); 83 tracingStoppedPromises.push(WebInspector.targetManager.resumeAllTargets( ));
79 Promise.all(tracingStoppedPromises).then(() => this._allSourcesFinished( )); 84 Promise.all(tracingStoppedPromises).then(() => this._allSourcesFinished( ));
80 85
81 this._delegate.loadingStarted(); 86 this._delegate.loadingStarted();
87
88 for (var traceProvider of this._extensionTraceProviders)
89 traceProvider.stop();
82 }, 90 },
83 91
84 /** 92 /**
85 * @override 93 * @override
86 * @param {!WebInspector.Target} target 94 * @param {!WebInspector.Target} target
87 */ 95 */
88 targetAdded: function(target) 96 targetAdded: function(target)
89 { 97 {
90 this._targets.push(target); 98 this._targets.push(target);
91 if (this._profiling) 99 if (this._profiling)
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 286
279 /** 287 /**
280 * @param {number} progress 288 * @param {number} progress
281 * @override 289 * @override
282 */ 290 */
283 eventsRetrievalProgress: function(progress) 291 eventsRetrievalProgress: function(progress)
284 { 292 {
285 this._delegate.loadingProgress(progress); 293 this._delegate.loadingProgress(progress);
286 } 294 }
287 } 295 }
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