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

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

Issue 901143002: Support deprecation warnings in shared/service workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 | « Source/core/frame/UseCounter.h ('k') | Source/core/workers/WorkerGlobalScope.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/UseCounter.cpp
diff --git a/Source/core/frame/UseCounter.cpp b/Source/core/frame/UseCounter.cpp
index 61b61417748a971016950f422b4060f57acbeb58..511e8716c2d5f2eaa902b283ea20a489a1a5f633 100644
--- a/Source/core/frame/UseCounter.cpp
+++ b/Source/core/frame/UseCounter.cpp
@@ -537,18 +537,22 @@ UseCounter::~UseCounter()
updateMeasurements();
}
-void UseCounter::updateMeasurements()
+void UseCounter::CountBits::updateMeasurements()
{
- blink::Platform::current()->histogramEnumeration("WebCore.FeatureObserver", PageVisits, NumberOfFeatures);
-
- if (m_countBits) {
+ if (m_bits) {
for (unsigned i = 0; i < NumberOfFeatures; ++i) {
- if (m_countBits->quickGet(i))
+ if (m_bits->quickGet(i))
blink::Platform::current()->histogramEnumeration("WebCore.FeatureObserver", i, NumberOfFeatures);
}
// Clearing count bits is timing sensitive.
- m_countBits->clearAll();
+ m_bits->clearAll();
}
+}
+
+void UseCounter::updateMeasurements()
+{
+ blink::Platform::current()->histogramEnumeration("WebCore.FeatureObserver", PageVisits, NumberOfFeatures);
+ m_countBits.updateMeasurements();
// FIXME: Sometimes this function is called more than once per page. The following
// bool guards against incrementing the page count when there are no CSS
@@ -581,7 +585,7 @@ void UseCounter::count(const Frame* frame, Feature feature)
if (!host)
return;
- ASSERT(host->useCounter().deprecationMessage(feature).isEmpty());
+ ASSERT(deprecationMessage(feature).isEmpty());
host->useCounter().recordMeasurement(feature);
}
@@ -632,8 +636,8 @@ void UseCounter::countDeprecation(const LocalFrame* frame, Feature feature)
return;
if (host->useCounter().recordMeasurement(feature)) {
- ASSERT(!host->useCounter().deprecationMessage(feature).isEmpty());
- frame->console().addMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, host->useCounter().deprecationMessage(feature)));
+ ASSERT(!deprecationMessage(feature).isEmpty());
+ frame->console().addMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, deprecationMessage(feature)));
}
}
« no previous file with comments | « Source/core/frame/UseCounter.h ('k') | Source/core/workers/WorkerGlobalScope.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698