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

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngine.cpp

Issue 1644543002: Moved element style recalc count and stats to StyleEngine. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/StyleEngine.cpp
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
index 6c2876a1e5fbd86440dad6f33f444813ae179376..65d35a495c2bea315b815a173f321f985edba6f6 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -56,16 +56,7 @@ using namespace HTMLNames;
StyleEngine::StyleEngine(Document& document)
: m_document(&document)
, m_isMaster(!document.importsController() || document.importsController()->master() == &document)
- , m_pendingStylesheets(0)
, m_documentStyleSheetCollection(DocumentStyleSheetCollection::create(document))
- , m_documentScopeDirty(true)
- , m_usesSiblingRules(false)
- , m_usesFirstLineRules(false)
- , m_usesWindowInactiveSelector(false)
- , m_usesRemUnits(false)
- , m_maxDirectAdjacentSelectors(0)
- , m_ignorePendingStylesheets(false)
- , m_didCalculateResolver(false)
// We don't need to create CSSFontSelector for imported document or
// HTMLTemplateElement's document, because those documents have no frame.
, m_fontSelector(document.frame() ? CSSFontSelector::create(&document) : nullptr)
@@ -434,11 +425,6 @@ void StyleEngine::clearMasterResolver()
master->styleEngine().clearResolver();
}
-unsigned StyleEngine::resolverAccessCount() const
-{
- return m_resolver ? m_resolver->accessCount() : 0;
-}
-
void StyleEngine::didDetach()
{
clearResolver();
@@ -726,6 +712,18 @@ void StyleEngine::pseudoStateChangedForElement(CSSSelector::PseudoType pseudoTyp
m_styleInvalidator.scheduleInvalidationSetsForElement(invalidationLists, element);
}
+void StyleEngine::setStatsEnabled(bool enabled)
+{
+ if (!enabled) {
+ m_styleResolverStats = nullptr;
+ return;
+ }
+ if (!m_styleResolverStats)
+ m_styleResolverStats = StyleResolverStats::create();
+ else
+ m_styleResolverStats->reset();
+}
+
DEFINE_TRACE(StyleEngine)
{
#if ENABLE(OILPAN)
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/html/shadow/MediaControlsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698