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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
index 26248f1f0fbe15204189ba8571b232fa693a67a1..7b61026ade1294c4c9c2aab0de7a28976cb00102 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelinePanel.js
@@ -81,6 +81,8 @@ WebInspector.TimelinePanel = class extends WebInspector.Panel {
WebInspector.settings.createSetting('timelineCaptureLayersAndPictures', false);
this._captureFilmStripSetting = WebInspector.settings.createSetting('timelineCaptureFilmStrip', false);
+ this._markUnusedCSS = WebInspector.settings.createSetting('timelineMarkUnusedCSS', false);
+
this._panelToolbar = new WebInspector.Toolbar('', this.element);
this._createToolbarItems();
@@ -364,6 +366,12 @@ WebInspector.TimelinePanel = class extends WebInspector.Panel {
this._panelToolbar.appendToolbarItem(screenshotCheckbox);
}
+ if (Runtime.experiments.isEnabled('timelineRuleUsageRecording')) {
+ this._panelToolbar.appendToolbarItem(this._createSettingCheckbox(
+ WebInspector.UIString('CSS coverage'), this._markUnusedCSS,
+ WebInspector.UIString('Mark unused CSS in souces.')));
+ }
+
this._captureNetworkSetting.addChangeListener(this._onNetworkChanged, this);
this._captureMemorySetting.addChangeListener(this._onModeChanged, this);
this._captureFilmStripSetting.addChangeListener(this._onModeChanged, this);
@@ -574,6 +582,9 @@ WebInspector.TimelinePanel = class extends WebInspector.Panel {
this._setState(WebInspector.TimelinePanel.State.StartPending);
this._showRecordingStarted();
+ if (Runtime.experiments.isEnabled('timelineRuleUsageRecording') && this._markUnusedCSS.get())
+ WebInspector.CSSModel.fromTarget(mainTarget).startRuleUsageTracking();
+
this._autoRecordGeneration = userInitiated ? null : Symbol('Generation');
this._controller = new WebInspector.TimelineController(mainTarget, this, this._tracingModel);
this._controller.startRecording(
@@ -629,6 +640,9 @@ WebInspector.TimelinePanel = class extends WebInspector.Panel {
}
_clear() {
+ if (Runtime.experiments.isEnabled('timelineRuleUsageRecording') && this._markUnusedCSS.get())
+ WebInspector.CoverageProfile.instance().reset();
+
WebInspector.LineLevelProfile.instance().reset();
this._tracingModel.reset();
this._model.reset();
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/timeline/TimelineController.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698