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

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

Issue 2472213005: DevTools: introduce "Track CSS Usage" experiment (Closed)
Patch Set: Unused CSS highlight in sources panel Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js
index f075760e19d973c338122f44eb4ce567ed5c3ce4..5363aa95295f0c7473c1189af1c749b1d9d3dd23 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js
@@ -18,6 +18,10 @@ WebInspector.TimelineController = class {
this._tracingModel = tracingModel;
this._targets = [];
WebInspector.targetManager.observeTargets(this);
+
+ if (Runtime.experiments.isEnabled('timelineRuleUsageRecording')) {
+ this._markUnusedCSS = WebInspector.settings.createSetting('timelineMarkUnusedCSS', false);
+ }
}
/**
@@ -74,7 +78,10 @@ WebInspector.TimelineController = class {
tracingStoppedPromises.push(new Promise(resolve => this._tracingCompleteCallback = resolve));
tracingStoppedPromises.push(this._stopProfilingOnAllTargets());
this._target.tracingManager.stop();
- tracingStoppedPromises.push(WebInspector.targetManager.resumeAllTargets());
+
+ if (!Runtime.experiments.isEnabled('timelineRuleUsageRecording') || !this._markUnusedCSS.get())
+ tracingStoppedPromises.push(WebInspector.targetManager.resumeAllTargets());
+
Promise.all(tracingStoppedPromises).then(() => this._allSourcesFinished());
this._delegate.loadingStarted();
@@ -160,7 +167,9 @@ WebInspector.TimelineController = class {
* @param {function(?string)=} callback
*/
_startRecordingWithCategories(categories, enableJSSampling, callback) {
- WebInspector.targetManager.suspendAllTargets();
+ if (!Runtime.experiments.isEnabled('timelineRuleUsageRecording') || !this._markUnusedCSS.get())
+ WebInspector.targetManager.suspendAllTargets();
+
var profilingStartedPromise = enableJSSampling && !Runtime.experiments.isEnabled('timelineTracingJSProfile') ?
this._startProfilingOnAllTargets() :
Promise.resolve();

Powered by Google App Engine
This is Rietveld 408576698