OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 14 matching lines...) Expand all Loading... | |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef InspectorBaseAgent_h | 31 #ifndef InspectorBaseAgent_h |
32 #define InspectorBaseAgent_h | 32 #define InspectorBaseAgent_h |
33 | 33 |
34 #include "core/InspectorBackendDispatcher.h" | 34 #include "core/InspectorBackendDispatcher.h" |
35 #include "core/inspector/InstrumentingAgents.h" | |
36 #include "platform/heap/Handle.h" | |
35 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
36 #include "wtf/Vector.h" | 38 #include "wtf/Vector.h" |
37 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
38 | 40 |
39 namespace WebCore { | 41 namespace WebCore { |
40 | 42 |
41 class InspectorFrontend; | 43 class InspectorFrontend; |
42 class InspectorCompositeState; | 44 class InspectorCompositeState; |
43 class InspectorState; | 45 class InspectorState; |
44 class InstrumentingAgents; | 46 class InstrumentingAgents; |
45 | 47 |
46 class InspectorAgent { | 48 class InspectorAgent : public NoBaseWillBeGarbageCollectedFinalized<InspectorAge nt> { |
47 public: | 49 public: |
48 explicit InspectorAgent(const String&); | 50 explicit InspectorAgent(const String&); |
49 virtual ~InspectorAgent(); | 51 virtual ~InspectorAgent(); |
52 virtual void trace(Visitor*); | |
50 | 53 |
51 virtual void init() { } | 54 virtual void init() { } |
52 virtual void setFrontend(InspectorFrontend*) { } | 55 virtual void setFrontend(InspectorFrontend*) { } |
53 virtual void clearFrontend() { } | 56 virtual void clearFrontend() { } |
54 virtual void restore() { } | 57 virtual void restore() { } |
55 virtual void registerInDispatcher(InspectorBackendDispatcher*) = 0; | 58 virtual void registerInDispatcher(InspectorBackendDispatcher*) = 0; |
56 virtual void discardAgent() { } | 59 virtual void discardAgent() { } |
57 virtual void didCommitLoadForMainFrame() { } | 60 virtual void didCommitLoadForMainFrame() { } |
58 virtual void flushPendingFrontendMessages() { } | 61 virtual void flushPendingFrontendMessages() { } |
59 | 62 |
60 String name() { return m_name; } | 63 String name() { return m_name; } |
61 void appended(InstrumentingAgents*, InspectorState*); | 64 void appended(InstrumentingAgents*, InspectorState*); |
62 | 65 |
63 protected: | 66 protected: |
64 InstrumentingAgents* m_instrumentingAgents; | 67 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; |
68 // FIXME: Oilpan: Move InspectorState to heap in follow-up CL. | |
65 InspectorState* m_state; | 69 InspectorState* m_state; |
66 | 70 |
67 private: | 71 private: |
68 String m_name; | 72 String m_name; |
69 }; | 73 }; |
70 | 74 |
71 class InspectorAgentRegistry { | 75 class InspectorAgentRegistry FINAL : public NoBaseWillBeGarbageCollectedFinalize d<InspectorAgentRegistry> { |
72 public: | 76 public: |
73 InspectorAgentRegistry(InstrumentingAgents*, InspectorCompositeState*); | 77 InspectorAgentRegistry(InstrumentingAgents*, InspectorCompositeState*); |
74 void append(PassOwnPtr<InspectorAgent>); | 78 void append(PassOwnPtrWillBeRawPtr<InspectorAgent>); |
75 | 79 |
76 void setFrontend(InspectorFrontend*); | 80 void setFrontend(InspectorFrontend*); |
77 void clearFrontend(); | 81 void clearFrontend(); |
78 void restore(); | 82 void restore(); |
79 void registerInDispatcher(InspectorBackendDispatcher*); | 83 void registerInDispatcher(InspectorBackendDispatcher*); |
80 void discardAgents(); | 84 void discardAgents(); |
81 void flushPendingFrontendMessages(); | 85 void flushPendingFrontendMessages(); |
82 | 86 |
87 void trace(Visitor*); | |
88 | |
83 private: | 89 private: |
84 InstrumentingAgents* m_instrumentingAgents; | 90 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; |
91 // FIXME: Oilpan: Move InspectorCompositeState to heap in follow-up CL. | |
85 InspectorCompositeState* m_inspectorState; | 92 InspectorCompositeState* m_inspectorState; |
86 Vector<OwnPtr<InspectorAgent> > m_agents; | 93 WillBeHeapVector<OwnPtrWillBeMember<InspectorAgent> > m_agents; |
87 }; | 94 }; |
88 | 95 |
89 template<typename T> | 96 template<typename T> |
90 class InspectorBaseAgent : public InspectorAgent { | 97 class InspectorBaseAgent : public InspectorAgent { |
91 public: | 98 public: |
92 virtual ~InspectorBaseAgent() { } | 99 virtual ~InspectorBaseAgent() { } |
93 | 100 |
94 virtual void registerInDispatcher(InspectorBackendDispatcher* dispatcher) OV ERRIDE FINAL | 101 virtual void registerInDispatcher(InspectorBackendDispatcher* dispatcher) OV ERRIDE FINAL |
95 { | 102 { |
96 dispatcher->registerAgent(static_cast<T*>(this)); | 103 dispatcher->registerAgent(static_cast<T*>(this)); |
97 } | 104 } |
98 | 105 |
99 protected: | 106 protected: |
100 InspectorBaseAgent(const String& name) : InspectorAgent(name) | 107 InspectorBaseAgent(const String& name) : InspectorAgent(name) |
haraken
2014/06/17 14:06:17
Add explicit.
keishi
2014/06/18 12:31:06
Done.
| |
101 { | 108 { |
102 } | 109 } |
103 }; | 110 }; |
104 | 111 |
105 } // namespace WebCore | 112 } // namespace WebCore |
106 | 113 |
107 #endif // !defined(InspectorBaseAgent_h) | 114 #endif // !defined(InspectorBaseAgent_h) |
OLD | NEW |