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

Unified Diff: Source/core/page/PageConsole.cpp

Issue 14146021: Move deprecation messages to UseCounter::measureDeprecatedFeature. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 8 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/page/PageConsole.h ('k') | Source/core/page/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/PageConsole.cpp
diff --git a/Source/core/page/PageConsole.cpp b/Source/core/page/PageConsole.cpp
index 56d9dc26dd405222a3d691281ace9d8c18d5900c..45f016d715b30b186e5ec36d35fa96f7debcd209 100644
--- a/Source/core/page/PageConsole.cpp
+++ b/Source/core/page/PageConsole.cpp
@@ -58,33 +58,10 @@ namespace {
int muteCount = 0;
-// Ensure that this stays in sync with the DeprecatedFeature enum.
-static const char* const deprecationMessages[] = {
- // CSP
- "The 'X-WebKit-CSP' headers are deprecated; please consider using the canonical 'Content-Security-Policy' header instead.",
-
- // HTMLMediaElement
- "'HTMLMediaElement.webkitAddKey()' is deprecated. Please use 'MediaKeySession.update()' instead.",
- "'HTMLMediaElement.webkitGenerateKeyRequest()' is deprecated. Please use 'MediaKeys.createSession()' instead.",
-
- // Performance
- "'window.performance.webkitGet*' methods have been deprecated. Please use the unprefixed 'performance.get*' methods instead.",
- "'window.performance.webkit*' methods have been deprecated. Please use the unprefixed 'window.performance.*' methods instead.",
-
- // Quota
- "'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead.",
-
- // Web Audio
- "AudioBufferSourceNode 'looping' attribute is deprecated. Use 'loop' instead.",
-};
-
-COMPILE_ASSERT(WTF_ARRAY_LENGTH(deprecationMessages) == static_cast<int>(WebCore::PageConsole::NumberOfFeatures), DeprecationMessages_matches_enum);
-
}
PageConsole::PageConsole(Page* page)
: m_page(page)
- , m_deprecationNotifications(NumberOfFeatures)
{
}
@@ -142,43 +119,4 @@ void PageConsole::unmute()
muteCount--;
}
-void PageConsole::reportDeprecation(DOMWindow* window, DeprecatedFeature feature)
-{
- if (!window)
- return;
- PageConsole::reportDeprecation(window->document(), feature);
-}
-
-// static
-void PageConsole::reportDeprecation(ScriptExecutionContext* context, DeprecatedFeature feature)
-{
- if (!context || !context->isDocument())
- return;
- PageConsole::reportDeprecation(toDocument(context), feature);
-}
-
-// static
-void PageConsole::reportDeprecation(Document* document, DeprecatedFeature feature)
-{
- if (!document)
- return;
-
- Page* page = document->page();
- if (!page || !page->console())
- return;
-
- page->console()->addDeprecationMessage(feature);
-}
-
-void PageConsole::addDeprecationMessage(DeprecatedFeature feature)
-{
- ASSERT(feature < NumberOfFeatures);
-
- if (m_deprecationNotifications.quickGet(feature))
- return;
-
- m_deprecationNotifications.quickSet(feature);
- addMessage(DeprecationMessageSource, WarningMessageLevel, ASCIILiteral(deprecationMessages[feature]));
-}
-
} // namespace WebCore
« no previous file with comments | « Source/core/page/PageConsole.h ('k') | Source/core/page/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698