Index: Source/core/workers/WorkerGlobalScope.cpp |
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp |
index 6d6a901ca86fe65db42f79609be6d214c6e2da06..0617ab47c55862a7e09b0e168949a3791af4442c 100644 |
--- a/Source/core/workers/WorkerGlobalScope.cpp |
+++ b/Source/core/workers/WorkerGlobalScope.cpp |
@@ -334,9 +334,18 @@ 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? |
+ |
+ ASSERT(isSharedWorkerGlobalScope() || isServiceWorkerGlobalScope()); |
+ // For each deprecated feature, send console message at most once |
+ // per worker lifecycle. |
+ if (m_deprecationWarningBits.recordMeasurement(feature)) { |
+ ASSERT(!UseCounter::deprecationMessage(feature).isEmpty()); |
+ ASSERT(executionContext()); |
+ executionContext()->addConsoleMessage(ConsoleMessage::create(DeprecationMessageSource, WarningMessageLevel, UseCounter::deprecationMessage(feature))); |
+ } |
} |
ConsoleMessageStorage* WorkerGlobalScope::messageStorage() |