OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef SKY_ENGINE_CORE_INSPECTOR_CONSOLEMESSAGESTORAGE_H_ | |
6 #define SKY_ENGINE_CORE_INSPECTOR_CONSOLEMESSAGESTORAGE_H_ | |
7 | |
8 #include "sky/engine/core/inspector/ConsoleMessage.h" | |
9 #include "sky/engine/platform/heap/Handle.h" | |
10 #include "sky/engine/wtf/Deque.h" | |
11 #include "sky/engine/wtf/Forward.h" | |
12 | |
13 namespace blink { | |
14 | |
15 class LocalDOMWindow; | |
16 | |
17 class ConsoleMessageStorage final { | |
18 WTF_MAKE_NONCOPYABLE(ConsoleMessageStorage); | |
19 WTF_MAKE_FAST_ALLOCATED; | |
20 public: | |
21 static PassOwnPtr<ConsoleMessageStorage> createForFrame(LocalFrame* frame) | |
22 { | |
23 return adoptPtr(new ConsoleMessageStorage(frame)); | |
24 } | |
25 | |
26 void reportMessage(PassRefPtr<ConsoleMessage>); | |
27 void clear(); | |
28 | |
29 Vector<unsigned> argumentCounts() const; | |
30 | |
31 void frameWindowDiscarded(LocalDOMWindow*); | |
32 | |
33 size_t size() const; | |
34 ConsoleMessage* at(size_t index) const; | |
35 | |
36 int expiredCount() const; | |
37 | |
38 private: | |
39 explicit ConsoleMessageStorage(ExecutionContext*); | |
40 explicit ConsoleMessageStorage(LocalFrame*); | |
41 | |
42 ExecutionContext* executionContext() const; | |
43 | |
44 int m_expiredCount; | |
45 Deque<RefPtr<ConsoleMessage> > m_messages; | |
46 RawPtr<ExecutionContext> m_context; | |
47 LocalFrame* m_frame; | |
48 }; | |
49 | |
50 } // namespace blink | |
51 | |
52 #endif // SKY_ENGINE_CORE_INSPECTOR_CONSOLEMESSAGESTORAGE_H_ | |
OLD | NEW |