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

Unified Diff: third_party/WebKit/Source/core/dom/SelectorQuery.h

Issue 2797083002: Test cases for querySelector fast paths. (Closed)
Patch Set: Working tests. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/SelectorQuery.h
diff --git a/third_party/WebKit/Source/core/dom/SelectorQuery.h b/third_party/WebKit/Source/core/dom/SelectorQuery.h
index 15906d8190ed1f6d5d9cd3fcf92d30c8323bdacd..5cdd31502182aceffaef5450531c43c58c2f225d 100644
--- a/third_party/WebKit/Source/core/dom/SelectorQuery.h
+++ b/third_party/WebKit/Source/core/dom/SelectorQuery.h
@@ -64,6 +64,20 @@ class CORE_EXPORT SelectorQuery {
// https://dom.spec.whatwg.org/#dom-parentnode-queryselector
Element* queryFirst(ContainerNode& rootNode) const;
+ struct QueryStats {
+ unsigned totalCount;
+ unsigned fastId;
+ unsigned fastClass;
+ unsigned fastTagName;
+ unsigned fastScan;
+ unsigned slowScan;
+ unsigned slowTraversingShadowTreeScan;
+ };
+ // Used by unit tests to get information about what paths were taken during
+ // the last query. Always reset between queries. This system is disabled in
+ // non DCHECK builds to avoid the overhead on the query process.
+ static QueryStats lastQueryStats();
+
private:
explicit SelectorQuery(CSSSelectorList);
« no previous file with comments | « third_party/WebKit/Source/core/dom/ContainerNode.h ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698