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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 virtual void registerInDispatcher(InspectorBackendDispatcher*) = 0; | 58 virtual void registerInDispatcher(InspectorBackendDispatcher*) = 0; |
59 virtual void discardAgent() { } | 59 virtual void discardAgent() { } |
60 virtual void didCommitLoadForMainFrame() { } | 60 virtual void didCommitLoadForMainFrame() { } |
61 virtual void flushPendingFrontendMessages() { } | 61 virtual void flushPendingFrontendMessages() { } |
62 | 62 |
63 String name() { return m_name; } | 63 String name() { return m_name; } |
64 void appended(InstrumentingAgents*, InspectorState*); | 64 void appended(InstrumentingAgents*, InspectorState*); |
65 | 65 |
66 protected: | 66 protected: |
67 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; | 67 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; |
68 // FIXME: Oilpan: Move InspectorState to heap in follow-up CL. | 68 RawPtrWillBeMember<InspectorState> m_state; |
69 InspectorState* m_state; | |
70 | 69 |
71 private: | 70 private: |
72 String m_name; | 71 String m_name; |
73 }; | 72 }; |
74 | 73 |
75 class InspectorAgentRegistry FINAL { | 74 class InspectorAgentRegistry FINAL { |
76 DISALLOW_ALLOCATION(); | 75 DISALLOW_ALLOCATION(); |
77 public: | 76 public: |
78 InspectorAgentRegistry(InstrumentingAgents*, InspectorCompositeState*); | 77 InspectorAgentRegistry(InstrumentingAgents*, InspectorCompositeState*); |
79 void append(PassOwnPtrWillBeRawPtr<InspectorAgent>); | 78 void append(PassOwnPtrWillBeRawPtr<InspectorAgent>); |
80 | 79 |
81 void setFrontend(InspectorFrontend*); | 80 void setFrontend(InspectorFrontend*); |
82 void clearFrontend(); | 81 void clearFrontend(); |
83 void restore(); | 82 void restore(); |
84 void registerInDispatcher(InspectorBackendDispatcher*); | 83 void registerInDispatcher(InspectorBackendDispatcher*); |
85 void discardAgents(); | 84 void discardAgents(); |
86 void flushPendingFrontendMessages(); | 85 void flushPendingFrontendMessages(); |
87 | 86 |
88 void trace(Visitor*); | 87 void trace(Visitor*); |
89 | 88 |
90 private: | 89 private: |
91 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; | 90 RawPtrWillBeMember<InstrumentingAgents> m_instrumentingAgents; |
92 // FIXME: Oilpan: Move InspectorCompositeState to heap in follow-up CL. | 91 RawPtrWillBeMember<InspectorCompositeState> m_inspectorState; |
93 InspectorCompositeState* m_inspectorState; | |
94 WillBeHeapVector<OwnPtrWillBeMember<InspectorAgent> > m_agents; | 92 WillBeHeapVector<OwnPtrWillBeMember<InspectorAgent> > m_agents; |
95 }; | 93 }; |
96 | 94 |
97 template<typename T> | 95 template<typename T> |
98 class InspectorBaseAgent : public InspectorAgent { | 96 class InspectorBaseAgent : public InspectorAgent { |
99 public: | 97 public: |
100 virtual ~InspectorBaseAgent() { } | 98 virtual ~InspectorBaseAgent() { } |
101 | 99 |
102 virtual void registerInDispatcher(InspectorBackendDispatcher* dispatcher) OV
ERRIDE FINAL | 100 virtual void registerInDispatcher(InspectorBackendDispatcher* dispatcher) OV
ERRIDE FINAL |
103 { | 101 { |
104 dispatcher->registerAgent(static_cast<T*>(this)); | 102 dispatcher->registerAgent(static_cast<T*>(this)); |
105 } | 103 } |
106 | 104 |
107 protected: | 105 protected: |
108 explicit InspectorBaseAgent(const String& name) : InspectorAgent(name) | 106 explicit InspectorBaseAgent(const String& name) : InspectorAgent(name) |
109 { | 107 { |
110 } | 108 } |
111 }; | 109 }; |
112 | 110 |
113 } // namespace WebCore | 111 } // namespace WebCore |
114 | 112 |
115 #endif // !defined(InspectorBaseAgent_h) | 113 #endif // !defined(InspectorBaseAgent_h) |
OLD | NEW |