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

Unified Diff: third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp

Issue 2707113003: Add "customPropertiesApplied" metric to StyleResolverStats. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/StyleResolverStats.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
index 6ccb2d97cb182cf8f6976a43dfdde6033ce2f54a..4ffcfb68234f1b5cf18984fa8022a41a35acf48e 100644
--- a/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/CSSVariableResolver.cpp
@@ -19,6 +19,8 @@
#include "core/css/resolver/StyleBuilder.h"
#include "core/css/resolver/StyleBuilderConverter.h"
#include "core/css/resolver/StyleResolverState.h"
+#include "core/css/resolver/StyleResolverStats.h"
+#include "core/dom/StyleEngine.h"
#include "core/style/StyleInheritedVariables.h"
#include "core/style/StyleNonInheritedVariables.h"
#include "wtf/Vector.h"
@@ -289,14 +291,19 @@ void CSSVariableResolver::resolveVariableDefinitions(
return;
CSSVariableResolver resolver(state);
+ int variableCount = 0;
if (inheritedVariables) {
for (auto& variable : inheritedVariables->m_data)
resolver.valueForCustomProperty(variable.key);
+ variableCount += inheritedVariables->m_data.size();
}
if (nonInheritedVariables) {
for (auto& variable : nonInheritedVariables->m_data)
resolver.valueForCustomProperty(variable.key);
+ variableCount += nonInheritedVariables->m_data.size();
}
+ INCREMENT_STYLE_STATS_COUNTER(state.document().styleEngine(),
+ customPropertiesApplied, variableCount);
}
void CSSVariableResolver::computeRegisteredVariables(
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/resolver/StyleResolverStats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698