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

Side by Side 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: OwnPtr<BitVector> -> BitVector 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/page/ContentSecurityPolicy.cpp ('k') | Source/core/page/PageConsole.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 14 matching lines...) Expand all
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #ifndef PageConsole_h 29 #ifndef PageConsole_h
30 #define PageConsole_h 30 #define PageConsole_h
31 31
32 #include "ConsoleTypes.h" 32 #include "ConsoleTypes.h"
33 #include "ScriptCallStack.h" 33 #include "ScriptCallStack.h"
34 #include "ScriptState.h" 34 #include "ScriptState.h"
35 #include <wtf/BitVector.h>
35 #include <wtf/Forward.h> 36 #include <wtf/Forward.h>
36 #include <wtf/PassOwnPtr.h> 37 #include <wtf/PassOwnPtr.h>
37 38
38 namespace WebCore { 39 namespace WebCore {
39 40
40 class Document; 41 class Document;
41 class Page; 42 class Page;
42 43
43 class PageConsole { 44 class PageConsole {
44 public: 45 public:
46 enum DeprecatedFeature {
47 PrefixedContentSecurityPolicyHeader,
48
49 // Add newly deprecated features above this line.
50 NumberOfFeatures, // Sentinel.
51 };
52
45 static PassOwnPtr<PageConsole> create(Page* page) { return adoptPtr(new Page Console(page)); } 53 static PassOwnPtr<PageConsole> create(Page* page) { return adoptPtr(new Page Console(page)); }
46 virtual ~PageConsole(); 54 virtual ~PageConsole();
47 55
48 void addMessage(MessageSource, MessageLevel, const String& message, const St ring& sourceURL, unsigned lineNumber, PassRefPtr<ScriptCallStack> = 0, ScriptSta te* = 0, unsigned long requestIdentifier = 0); 56 void addMessage(MessageSource, MessageLevel, const String& message, const St ring& sourceURL, unsigned lineNumber, PassRefPtr<ScriptCallStack> = 0, ScriptSta te* = 0, unsigned long requestIdentifier = 0);
49 void addMessage(MessageSource, MessageLevel, const String& message, PassRefP tr<ScriptCallStack>); 57 void addMessage(MessageSource, MessageLevel, const String& message, PassRefP tr<ScriptCallStack>);
50 void addMessage(MessageSource, MessageLevel, const String& message, unsigned long requestIdentifier = 0, Document* = 0); 58 void addMessage(MessageSource, MessageLevel, const String& message, unsigned long requestIdentifier = 0, Document* = 0);
51 59
60 static void reportDeprecation(Document*, DeprecatedFeature);
61
52 static void mute(); 62 static void mute();
53 static void unmute(); 63 static void unmute();
54 64
55 private: 65 private:
56 PageConsole(Page*); 66 PageConsole(Page*);
57 67
68 void addDeprecationMessage(DeprecatedFeature);
69
58 Page* page() { return m_page; }; 70 Page* page() { return m_page; };
59 71
60 Page* m_page; 72 Page* m_page;
73 BitVector m_deprecationNotifications;
61 }; 74 };
62 75
63 } // namespace WebCore 76 } // namespace WebCore
64 77
65 #endif // PageConsole_h 78 #endif // PageConsole_h
OLDNEW
« no previous file with comments | « Source/core/page/ContentSecurityPolicy.cpp ('k') | Source/core/page/PageConsole.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698