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

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
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698