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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h

Issue 2455943003: Backend for css rule tracking (Closed)
Patch Set: Backend for CSS Rule tracking. 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/core/inspector/InspectorCSSAgent.h
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h
index 07d2624a06ef0dfb72afeec67bebe917f2b32119..baca5f180294a526470b1453bad63c166d591fbc 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h
@@ -57,6 +57,7 @@ class InspectorResourceContentLoader;
class MediaList;
class Node;
class LayoutObject;
+class StyleRuleUsageTracker;
class CORE_EXPORT InspectorCSSAgent final
: public InspectorBaseAgent<protocol::CSS::Metainfo>,
@@ -124,6 +125,9 @@ class CORE_EXPORT InspectorCSSAgent final
void activeStyleSheetsUpdated(Document*);
void documentDetached(Document*);
void fontsUpdated();
+ void getUnusedRules(
+ std::unique_ptr<protocol::Array<protocol::CSS::RuleUsage>>*);
+ void setUsageTrackerStatus(bool enabled);
void enable(std::unique_ptr<EnableCallback>) override;
Response disable() override;
@@ -191,6 +195,12 @@ class CORE_EXPORT InspectorCSSAgent final
int nodeId,
Maybe<protocol::Array<String>>* backgroundColors) override;
+ Response startRuleUsageTracking() override;
+
+ Response stopRuleUsageTracking(
+ std::unique_ptr<protocol::Array<protocol::CSS::RuleUsage>>* result)
+ override;
+
void collectMediaQueriesFromRule(CSSRule*,
protocol::Array<protocol::CSS::CSSMedia>*);
void collectMediaQueriesFromStyleSheet(
@@ -281,12 +291,16 @@ class CORE_EXPORT InspectorCSSAgent final
String detectOrigin(CSSStyleSheet* pageStyleSheet, Document* ownerDocument);
std::unique_ptr<protocol::CSS::CSSRule> buildObjectForRule(CSSStyleRule*);
+ std::unique_ptr<protocol::CSS::RuleUsage> buildObjectForRuleUsage(
+ CSSStyleRule*,
+ bool);
std::unique_ptr<protocol::Array<protocol::CSS::RuleMatch>>
buildArrayForMatchedRuleList(CSSRuleList*, Element*, PseudoId);
std::unique_ptr<protocol::CSS::CSSStyle> buildObjectForAttributesStyle(
Element*);
// InspectorDOMAgent::DOMListener implementation
+ void didAddDocument(Document*) override;
void didRemoveDocument(Document*) override;
void didRemoveDOMNode(Node*) override;
void didModifyDOMAttr(Element*) override;
@@ -336,6 +350,8 @@ class CORE_EXPORT InspectorCSSAgent final
NodeToInspectorStyleSheet m_nodeToInspectorStyleSheet;
NodeIdToForcedPseudoState m_nodeIdToForcedPseudoState;
+ Member<StyleRuleUsageTracker> m_tracker;
+
Member<CSSStyleSheet> m_inspectorUserAgentStyleSheet;
int m_resourceContentLoaderClientId;
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.cpp ('k') | third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698