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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 class InspectorFrontend; | 42 class InspectorFrontend; |
43 class InspectorCompositeState; | 43 class InspectorCompositeState; |
44 class InspectorState; | 44 class InspectorState; |
45 class InstrumentingAgents; | 45 class InstrumentingAgents; |
46 | 46 |
47 class InspectorAgent : public NoBaseWillBeGarbageCollectedFinalized<InspectorAge
nt> { | 47 class InspectorAgent : public NoBaseWillBeGarbageCollectedFinalized<InspectorAge
nt> { |
48 public: | 48 public: |
49 explicit InspectorAgent(const String&); | 49 explicit InspectorAgent(const String&); |
50 virtual ~InspectorAgent(); | 50 virtual ~InspectorAgent(); |
51 virtual void trace(Visitor*) { } | 51 virtual void trace(Visitor*); |
52 | 52 |
53 virtual void init() { } | 53 virtual void init() { } |
54 virtual void setFrontend(InspectorFrontend*) { } | 54 virtual void setFrontend(InspectorFrontend*) { } |
55 virtual void clearFrontend() { } | 55 virtual void clearFrontend() { } |
56 virtual void restore() { } | 56 virtual void restore() { } |
57 virtual void registerInDispatcher(InspectorBackendDispatcher*) = 0; | 57 virtual void registerInDispatcher(InspectorBackendDispatcher*) = 0; |
58 virtual void discardAgent() { } | 58 virtual void discardAgent() { } |
59 virtual void didCommitLoadForMainFrame() { } | 59 virtual void didCommitLoadForMainFrame() { } |
60 virtual void flushPendingFrontendMessages() { } | 60 virtual void flushPendingFrontendMessages() { } |
61 | 61 |
62 String name() { return m_name; } | 62 String name() { return m_name; } |
63 void appended(InstrumentingAgents*, InspectorState*); | 63 void appended(InstrumentingAgents*, InspectorState*); |
64 | 64 |
65 protected: | 65 protected: |
66 InstrumentingAgents* m_instrumentingAgents; | 66 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; |
67 InspectorState* m_state; | 67 InspectorState* m_state; |
68 | 68 |
69 private: | 69 private: |
70 String m_name; | 70 String m_name; |
71 }; | 71 }; |
72 | 72 |
73 class InspectorAgentRegistry : public NoBaseWillBeGarbageCollectedFinalized<Insp
ectorAgentRegistry> { | 73 class InspectorAgentRegistry : public NoBaseWillBeGarbageCollectedFinalized<Insp
ectorAgentRegistry> { |
74 public: | 74 public: |
75 InspectorAgentRegistry(InstrumentingAgents*, InspectorCompositeState*); | 75 InspectorAgentRegistry(InstrumentingAgents*, InspectorCompositeState*); |
76 void append(PassOwnPtrWillBeRawPtr<InspectorAgent>); | 76 void append(PassOwnPtrWillBeRawPtr<InspectorAgent>); |
77 | 77 |
78 void setFrontend(InspectorFrontend*); | 78 void setFrontend(InspectorFrontend*); |
79 void clearFrontend(); | 79 void clearFrontend(); |
80 void restore(); | 80 void restore(); |
81 void registerInDispatcher(InspectorBackendDispatcher*); | 81 void registerInDispatcher(InspectorBackendDispatcher*); |
82 void discardAgents(); | 82 void discardAgents(); |
83 void flushPendingFrontendMessages(); | 83 void flushPendingFrontendMessages(); |
84 | 84 |
85 void trace(Visitor*); | 85 void trace(Visitor*); |
86 | 86 |
87 private: | 87 private: |
88 InstrumentingAgents* m_instrumentingAgents; | 88 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; |
89 InspectorCompositeState* m_inspectorState; | 89 InspectorCompositeState* m_inspectorState; |
90 WillBeHeapVector<OwnPtrWillBeMember<InspectorAgent> > m_agents; | 90 WillBeHeapVector<OwnPtrWillBeMember<InspectorAgent> > m_agents; |
91 }; | 91 }; |
92 | 92 |
93 template<typename T> | 93 template<typename T> |
94 class InspectorBaseAgent : public InspectorAgent { | 94 class InspectorBaseAgent : public InspectorAgent { |
95 public: | 95 public: |
96 virtual ~InspectorBaseAgent() { } | 96 virtual ~InspectorBaseAgent() { } |
97 | 97 |
98 virtual void registerInDispatcher(InspectorBackendDispatcher* dispatcher) OV
ERRIDE FINAL | 98 virtual void registerInDispatcher(InspectorBackendDispatcher* dispatcher) OV
ERRIDE FINAL |
99 { | 99 { |
100 dispatcher->registerAgent(static_cast<T*>(this)); | 100 dispatcher->registerAgent(static_cast<T*>(this)); |
101 } | 101 } |
102 | 102 |
103 protected: | 103 protected: |
104 InspectorBaseAgent(const String& name) : InspectorAgent(name) | 104 InspectorBaseAgent(const String& name) : InspectorAgent(name) |
105 { | 105 { |
106 } | 106 } |
107 }; | 107 }; |
108 | 108 |
109 } // namespace WebCore | 109 } // namespace WebCore |
110 | 110 |
111 #endif // !defined(InspectorBaseAgent_h) | 111 #endif // !defined(InspectorBaseAgent_h) |
OLD | NEW |