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

Unified Diff: third_party/WebKit/Source/core/frame/UseCounter.cpp

Issue 1711703002: Add internals.isCSSPropertyUseCounted functionality (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/core/frame/UseCounter.cpp
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.cpp b/third_party/WebKit/Source/core/frame/UseCounter.cpp
index 15eb00c980c79d02610521b0b8ec5bf8a2a85790..022799f0e88213afb9c65014136ef5d5a685aae7 100644
--- a/third_party/WebKit/Source/core/frame/UseCounter.cpp
+++ b/third_party/WebKit/Source/core/frame/UseCounter.cpp
@@ -680,6 +680,27 @@ bool UseCounter::isCounted(Document& document, Feature feature)
return host->useCounter().hasRecordedMeasurement(feature);
}
+bool UseCounter::isCounted(CSSPropertyID unresolvedProperty)
+{
+ return m_CSSFeatureBits.quickGet(unresolvedProperty);
+}
+
+
+bool UseCounter::isCounted(Document& document, const String& string)
+{
+ Frame* frame = document.frame();
+ if (!frame)
+ return false;
+ FrameHost* host = frame->host();
+ if (!host)
+ return false;
+
+ CSSPropertyID propertyID = cssPropertyID(string);
+ if (propertyID == CSSPropertyInvalid)
+ return false;
+ return host->useCounter().isCounted(propertyID);
+}
+
void UseCounter::count(const ExecutionContext* context, Feature feature)
{
if (!context)
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/core/testing/Internals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698