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

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

Issue 14320022: Warn developers about deprecated features only once per page-load. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: PageConsole. 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
Index: Source/core/page/PageConsole.h
diff --git a/Source/core/page/PageConsole.h b/Source/core/page/PageConsole.h
index 5fb29045bd35df976ebc4576dbce20a1ebf44b65..bd8f2e7e5e9ba889e70b07c1877b8c1e1f4007c2 100644
--- a/Source/core/page/PageConsole.h
+++ b/Source/core/page/PageConsole.h
@@ -32,7 +32,9 @@
#include "ConsoleTypes.h"
#include "ScriptCallStack.h"
#include "ScriptState.h"
+#include <wtf/BitVector.h>
#include <wtf/Forward.h>
+#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -42,6 +44,13 @@ class Page;
class PageConsole {
public:
+ enum DeprecatedFeature {
+ PrefixedContentSecurityPolicyHeader,
+
+ // Add newly deprecated features above this line.
+ NumberOfFeatures, // Sentinel.
+ };
+
static PassOwnPtr<PageConsole> create(Page* page) { return adoptPtr(new PageConsole(page)); }
virtual ~PageConsole();
@@ -49,15 +58,20 @@ public:
void addMessage(MessageSource, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>);
void addMessage(MessageSource, MessageLevel, const String& message, unsigned long requestIdentifier = 0, Document* = 0);
+ static void reportDeprecation(Document*, DeprecatedFeature);
+
static void mute();
static void unmute();
private:
PageConsole(Page*);
+ void addDeprecationMessage(DeprecatedFeature);
+
Page* page() { return m_page; };
Page* m_page;
+ OwnPtr<BitVector> m_deprecationNotifications;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698