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