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

Unified Diff: Source/core/workers/WorkerGlobalScope.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
Index: Source/core/workers/WorkerGlobalScope.cpp
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp
index 6d6a901ca86fe65db42f79609be6d214c6e2da06..d3d560afee320e7c239610a51d8aab30405939b6 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -334,9 +334,21 @@ void WorkerGlobalScope::countFeature(UseCounter::Feature) const
// FIXME: How should we count features for shared/service workers?
}
-void WorkerGlobalScope::countDeprecation(UseCounter::Feature) const
+void WorkerGlobalScope::countDeprecation(UseCounter::Feature feature) const
{
// FIXME: How should we count features for shared/service workers?
+
sof 2015/02/05 08:48:18 Could you add a comment (or an assert, if you pref
Kunihiko Sakamoto 2015/02/05 10:35:37 Done.
+ // For each deprecated feature, send console message at most once
+ // per worker lifecycle.
+ if (!m_deprecationWarningBits) {
+ m_deprecationWarningBits = adoptPtr(new BitVector(UseCounter::NumberOfFeatures));
+ m_deprecationWarningBits->clearAll();
+ }
+ if (!m_deprecationWarningBits->quickGet(feature)) {
+ m_deprecationWarningBits->quickSet(feature);
+ ASSERT(!UseCounter::deprecationMessage(feature).isEmpty());
+ executionContext()->addConsoleMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, UseCounter::deprecationMessage(feature)));
sof 2015/02/05 08:48:18 We know currently from calling context that execut
Kunihiko Sakamoto 2015/02/05 10:35:37 Done.
+ }
}
ConsoleMessageStorage* WorkerGlobalScope::messageStorage()
« Source/core/workers/WorkerGlobalScope.h ('K') | « Source/core/workers/WorkerGlobalScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698