| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |