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

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
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 13 matching lines...) Expand all
24 WebInspector.TimelineController.prototype = { 24 WebInspector.TimelineController.prototype = {
25 /** 25 /**
26 * @param {boolean} captureCauses 26 * @param {boolean} captureCauses
27 * @param {boolean} enableJSSampling 27 * @param {boolean} enableJSSampling
28 * @param {boolean} captureMemory 28 * @param {boolean} captureMemory
29 * @param {boolean} capturePictures 29 * @param {boolean} capturePictures
30 * @param {boolean} captureFilmStrip 30 * @param {boolean} captureFilmStrip
31 */ 31 */
32 startRecording: function(captureCauses, enableJSSampling, captureMemory, cap turePictures, captureFilmStrip) 32 startRecording: function(captureCauses, enableJSSampling, captureMemory, cap turePictures, captureFilmStrip)
33 { 33 {
34 this._extensionTraceProviders = WebInspector.extensionServer.traceProvid ers().slice();
35
34 function disabledByDefault(category) 36 function disabledByDefault(category)
35 { 37 {
36 return "disabled-by-default-" + category; 38 return "disabled-by-default-" + category;
37 } 39 }
38 var categoriesArray = [ 40 var categoriesArray = [
39 "-*", 41 "-*",
40 "devtools.timeline", 42 "devtools.timeline",
41 disabledByDefault("devtools.timeline"), 43 disabledByDefault("devtools.timeline"),
42 disabledByDefault("devtools.timeline.frame"), 44 disabledByDefault("devtools.timeline.frame"),
43 WebInspector.TracingModel.TopLevelEventCategory, 45 WebInspector.TracingModel.TopLevelEventCategory,
(...skipping 16 matching lines...) Expand all
60 if (captureCauses && Runtime.experiments.isEnabled("timelineInvalidation Tracking")) 62 if (captureCauses && Runtime.experiments.isEnabled("timelineInvalidation Tracking"))
61 categoriesArray.push(disabledByDefault("devtools.timeline.invalidati onTracking")); 63 categoriesArray.push(disabledByDefault("devtools.timeline.invalidati onTracking"));
62 if (capturePictures) { 64 if (capturePictures) {
63 categoriesArray.push(disabledByDefault("devtools.timeline.layers"), 65 categoriesArray.push(disabledByDefault("devtools.timeline.layers"),
64 disabledByDefault("devtools.timeline.picture"), 66 disabledByDefault("devtools.timeline.picture"),
65 disabledByDefault("blink.graphics_context_annot ations")); 67 disabledByDefault("blink.graphics_context_annot ations"));
66 } 68 }
67 if (captureFilmStrip) 69 if (captureFilmStrip)
68 categoriesArray.push(disabledByDefault("devtools.screenshot")); 70 categoriesArray.push(disabledByDefault("devtools.screenshot"));
69 71
72 for (var traceProvider of this._extensionTraceProviders)
73 traceProvider.run();
caseq 2016/07/19 22:01:17 rename from run() to start()?
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();
caseq 2016/07/19 22:01:17 unused?
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

Powered by Google App Engine
This is Rietveld 408576698