| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 #include "bindings/core/v8/ScriptState.h" | 32 #include "bindings/core/v8/ScriptState.h" |
| 33 #include "core/CoreExport.h" | 33 #include "core/CoreExport.h" |
| 34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
| 35 #include "wtf/Forward.h" | 35 #include "wtf/Forward.h" |
| 36 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PassOwnPtr.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class ConsoleMessage; | 40 class ConsoleMessage; |
| 41 class ConsoleMessageStorage; | |
| 42 class DocumentLoader; | 41 class DocumentLoader; |
| 43 class ResourceError; | 42 class ResourceError; |
| 44 class ResourceResponse; | 43 class ResourceResponse; |
| 45 class ScriptCallStack; | |
| 46 class WorkerInspectorProxy; | |
| 47 | 44 |
| 48 // FrameConsole takes per-frame console messages and routes them up through the
FrameHost to the ChromeClient and Inspector. | 45 // FrameConsole takes per-frame console messages and routes them up through the
FrameHost to the ChromeClient and Inspector. |
| 49 // It's meant as an abstraction around ChromeClient calls and the way that Blink
core/ can add messages to the console. | 46 // It's meant as an abstraction around ChromeClient calls and the way that Blink
core/ can add messages to the console. |
| 50 class CORE_EXPORT FrameConsole final : public GarbageCollected<FrameConsole> { | 47 class CORE_EXPORT FrameConsole final : public GarbageCollected<FrameConsole> { |
| 51 public: | 48 public: |
| 52 static FrameConsole* create(LocalFrame& frame) | 49 static FrameConsole* create(LocalFrame& frame) |
| 53 { | 50 { |
| 54 return new FrameConsole(frame); | 51 return new FrameConsole(frame); |
| 55 } | 52 } |
| 56 | 53 |
| 57 void addMessage(ConsoleMessage*); | 54 void addMessage(ConsoleMessage*); |
| 55 bool addMessageToStorage(ConsoleMessage*); |
| 56 void reportMessageToClient(ConsoleMessage*); |
| 58 | 57 |
| 59 void reportWorkerMessage(ConsoleMessage*); | 58 void reportWorkerMessage(ConsoleMessage*); |
| 60 void adoptWorkerMessage(ConsoleMessage*); | 59 void adoptWorkerMessage(ConsoleMessage*); |
| 61 | 60 |
| 62 void reportResourceResponseReceived(DocumentLoader*, unsigned long requestId
entifier, const ResourceResponse&); | 61 void reportResourceResponseReceived(DocumentLoader*, unsigned long requestId
entifier, const ResourceResponse&); |
| 63 | 62 |
| 64 static void mute(); | |
| 65 static void unmute(); | |
| 66 | |
| 67 void clearMessages(); | 63 void clearMessages(); |
| 68 | 64 |
| 69 void didFailLoading(unsigned long requestIdentifier, const ResourceError&); | 65 void didFailLoading(unsigned long requestIdentifier, const ResourceError&); |
| 70 | 66 |
| 71 DECLARE_TRACE(); | 67 DECLARE_TRACE(); |
| 72 | 68 |
| 73 private: | 69 private: |
| 74 explicit FrameConsole(LocalFrame&); | 70 explicit FrameConsole(LocalFrame&); |
| 75 | 71 |
| 76 LocalFrame& frame() const | 72 LocalFrame& frame() const |
| 77 { | 73 { |
| 78 ASSERT(m_frame); | 74 ASSERT(m_frame); |
| 79 return *m_frame; | 75 return *m_frame; |
| 80 } | 76 } |
| 81 | 77 |
| 82 ConsoleMessageStorage* messageStorage(); | |
| 83 bool addMessageToStorage(ConsoleMessage*); | |
| 84 void reportMessageToClient(ConsoleMessage*); | |
| 85 | |
| 86 Member<LocalFrame> m_frame; | 78 Member<LocalFrame> m_frame; |
| 87 }; | 79 }; |
| 88 | 80 |
| 89 } // namespace blink | 81 } // namespace blink |
| 90 | 82 |
| 91 #endif // FrameConsole_h | 83 #endif // FrameConsole_h |
| OLD | NEW |