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 11 matching lines...) Expand all Loading... |
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
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 SKY_ENGINE_CORE_FRAME_FRAMECONSOLE_H_ | 29 #ifndef SKY_ENGINE_CORE_FRAME_FRAMECONSOLE_H_ |
30 #define SKY_ENGINE_CORE_FRAME_FRAMECONSOLE_H_ | 30 #define SKY_ENGINE_CORE_FRAME_FRAMECONSOLE_H_ |
31 | 31 |
32 #include "sky/engine/bindings/core/v8/ScriptState.h" | |
33 #include "sky/engine/core/frame/ConsoleTypes.h" | 32 #include "sky/engine/core/frame/ConsoleTypes.h" |
34 #include "sky/engine/platform/heap/Handle.h" | 33 #include "sky/engine/platform/heap/Handle.h" |
35 #include "sky/engine/wtf/Forward.h" | 34 #include "sky/engine/wtf/Forward.h" |
36 #include "sky/engine/wtf/PassOwnPtr.h" | 35 #include "sky/engine/wtf/PassOwnPtr.h" |
37 | 36 |
38 namespace blink { | 37 namespace blink { |
39 | 38 |
40 class ConsoleMessage; | 39 class ConsoleMessage; |
41 class ConsoleMessageStorage; | 40 class ConsoleMessageStorage; |
42 class Document; | 41 class Document; |
43 class FrameHost; | 42 class FrameHost; |
44 class ResourceResponse; | 43 class ResourceResponse; |
45 class ScriptCallStack; | 44 class LocalFrame; |
46 | 45 |
47 // FrameConsole takes per-frame console messages and routes them up through the
FrameHost to the ChromeClient and Inspector. | 46 // FrameConsole takes per-frame console messages and routes them up through the
FrameHost to the ChromeClient and Inspector. |
48 // It's meant as an abstraction around ChromeClient calls and the way that Blink
core/ can add messages to the console. | 47 // It's meant as an abstraction around ChromeClient calls and the way that Blink
core/ can add messages to the console. |
49 class FrameConsole final { | 48 class FrameConsole final { |
50 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(FrameConsole); | 49 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(FrameConsole); |
51 public: | 50 public: |
52 static PassOwnPtr<FrameConsole> create(LocalFrame& frame) | 51 static PassOwnPtr<FrameConsole> create(LocalFrame& frame) |
53 { | 52 { |
54 return adoptPtr(new FrameConsole(frame)); | 53 return adoptPtr(new FrameConsole(frame)); |
55 } | 54 } |
56 | 55 |
57 void addMessage(PassRefPtr<ConsoleMessage>); | 56 void addMessage(PassRefPtr<ConsoleMessage>); |
58 | 57 |
59 void reportResourceResponseReceived(Document*, unsigned long requestIdentifi
er, const ResourceResponse&); | 58 void reportResourceResponseReceived(Document*, unsigned long requestIdentifi
er, const ResourceResponse&); |
60 | 59 |
61 static String formatStackTraceString(const String& originalMessage, PassRefP
tr<ScriptCallStack>); | |
62 | |
63 static void mute(); | |
64 static void unmute(); | |
65 | |
66 ConsoleMessageStorage* messageStorage(); | |
67 void clearMessages(); | |
68 | |
69 private: | 60 private: |
70 explicit FrameConsole(LocalFrame&); | 61 explicit FrameConsole(LocalFrame&); |
71 | 62 |
72 LocalFrame& m_frame; | 63 LocalFrame& m_frame; |
73 | |
74 OwnPtr<ConsoleMessageStorage> m_consoleMessageStorage; | |
75 }; | 64 }; |
76 | 65 |
77 } // namespace blink | 66 } // namespace blink |
78 | 67 |
79 #endif // SKY_ENGINE_CORE_FRAME_FRAMECONSOLE_H_ | 68 #endif // SKY_ENGINE_CORE_FRAME_FRAMECONSOLE_H_ |
OLD | NEW |