| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ConsoleMessageStorage_h | 5 #ifndef ConsoleMessageStorage_h |
| 6 #define ConsoleMessageStorage_h | 6 #define ConsoleMessageStorage_h |
| 7 | 7 |
| 8 #include "core/inspector/ConsoleMessage.h" | 8 #include "core/inspector/ConsoleMessage.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "wtf/Forward.h" | 10 #include "wtf/Forward.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class FrameHost; |
| 14 class LocalDOMWindow; | 15 class LocalDOMWindow; |
| 15 class WorkerGlobalScopeProxy; | 16 class WorkerGlobalScopeProxy; |
| 16 | 17 |
| 17 class ConsoleMessageStorage final : public NoBaseWillBeGarbageCollected<ConsoleM
essageStorage> { | 18 class ConsoleMessageStorage final : public NoBaseWillBeGarbageCollected<ConsoleM
essageStorage> { |
| 18 WTF_MAKE_NONCOPYABLE(ConsoleMessageStorage); | 19 WTF_MAKE_NONCOPYABLE(ConsoleMessageStorage); |
| 19 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 20 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 20 public: | 21 public: |
| 21 static PassOwnPtrWillBeRawPtr<ConsoleMessageStorage> createForWorker(Executi
onContext* context) | 22 static PassOwnPtrWillBeRawPtr<ConsoleMessageStorage> createForWorker(Executi
onContext* context) |
| 22 { | 23 { |
| 23 return adoptPtrWillBeNoop(new ConsoleMessageStorage(context)); | 24 return adoptPtrWillBeNoop(new ConsoleMessageStorage(context)); |
| 24 } | 25 } |
| 25 | 26 |
| 26 static PassOwnPtrWillBeRawPtr<ConsoleMessageStorage> createForFrame(LocalFra
me* frame) | 27 static PassOwnPtrWillBeRawPtr<ConsoleMessageStorage> createForFrameHost(Fram
eHost* frameHost) |
| 27 { | 28 { |
| 28 return adoptPtrWillBeNoop(new ConsoleMessageStorage(frame)); | 29 return adoptPtrWillBeNoop(new ConsoleMessageStorage(frameHost)); |
| 29 } | 30 } |
| 30 | 31 |
| 31 void reportMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>); | 32 void reportMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>); |
| 32 void clear(); | 33 void clear(); |
| 33 | 34 |
| 34 Vector<unsigned> argumentCounts() const; | 35 Vector<unsigned> argumentCounts() const; |
| 35 | 36 |
| 36 void adoptWorkerMessagesAfterTermination(WorkerGlobalScopeProxy*); | 37 void adoptWorkerMessagesAfterTermination(WorkerGlobalScopeProxy*); |
| 37 void frameWindowDiscarded(LocalDOMWindow*); | 38 void frameWindowDiscarded(LocalDOMWindow*); |
| 38 | 39 |
| 39 size_t size() const; | 40 size_t size() const; |
| 40 ConsoleMessage* at(size_t index) const; | 41 ConsoleMessage* at(size_t index) const; |
| 41 | 42 |
| 42 int expiredCount() const; | 43 int expiredCount() const; |
| 43 | 44 |
| 44 void trace(Visitor*); | 45 void trace(Visitor*); |
| 45 | 46 |
| 46 private: | 47 private: |
| 47 explicit ConsoleMessageStorage(ExecutionContext*); | 48 explicit ConsoleMessageStorage(ExecutionContext*); |
| 48 explicit ConsoleMessageStorage(LocalFrame*); | 49 explicit ConsoleMessageStorage(FrameHost*); |
| 49 | |
| 50 ExecutionContext* executionContext() const; | |
| 51 | 50 |
| 52 int m_expiredCount; | 51 int m_expiredCount; |
| 53 WillBeHeapDeque<RefPtrWillBeMember<ConsoleMessage> > m_messages; | 52 WillBeHeapDeque<RefPtrWillBeMember<ConsoleMessage> > m_messages; |
| 54 RawPtrWillBeMember<ExecutionContext> m_context; | 53 RawPtrWillBeMember<ExecutionContext> m_context; |
| 55 RawPtrWillBeMember<LocalFrame> m_frame; | 54 RawPtrWillBeMember<FrameHost> m_frameHost; |
| 56 }; | 55 }; |
| 57 | 56 |
| 58 } // namespace blink | 57 } // namespace blink |
| 59 | 58 |
| 60 #endif // ConsoleMessageStorage_h | 59 #endif // ConsoleMessageStorage_h |
| OLD | NEW |