2 * Copyright (C) 2011 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
31 #ifndef InstrumentingAgents_h
32 #define InstrumentingAgents_h
34 #include <inspector/InspectorEnvironment.h>
35 #include <wtf/FastMalloc.h>
36 #include <wtf/Noncopyable.h>
37 #include <wtf/PassRefPtr.h>
38 #include <wtf/RefCounted.h>
46 class InspectorApplicationCacheAgent;
47 class InspectorCSSAgent;
48 class InspectorCanvasAgent;
49 class InspectorConsoleAgent;
50 class InspectorDOMAgent;
51 class InspectorDOMDebuggerAgent;
52 class InspectorDOMStorageAgent;
53 class InspectorDatabaseAgent;
54 class InspectorDebuggerAgent;
55 class InspectorHeapProfilerAgent;
56 class InspectorLayerTreeAgent;
57 class InspectorPageAgent;
58 class InspectorProfilerAgent;
59 class InspectorResourceAgent;
60 class InspectorTimelineAgent;
61 class InspectorWorkerAgent;
63 class PageDebuggerAgent;
64 class PageRuntimeAgent;
65 class WorkerGlobalScope;
66 class WorkerRuntimeAgent;
68 class InstrumentingAgents : public RefCounted<InstrumentingAgents> {
69 WTF_MAKE_NONCOPYABLE(InstrumentingAgents);
70 WTF_MAKE_FAST_ALLOCATED;
72 static PassRefPtr<InstrumentingAgents> create(Inspector::InspectorEnvironment& environment)
74 return adoptRef(new InstrumentingAgents(environment));
76 ~InstrumentingAgents() { }
79 Inspector::InspectorEnvironment& inspectorEnvironment() const { return m_environment; }
81 Inspector::InspectorAgent* inspectorAgent() const { return m_inspectorAgent; }
82 void setInspectorAgent(Inspector::InspectorAgent* agent) { m_inspectorAgent = agent; }
84 InspectorPageAgent* inspectorPageAgent() const { return m_inspectorPageAgent; }
85 void setInspectorPageAgent(InspectorPageAgent* agent) { m_inspectorPageAgent = agent; }
87 InspectorCSSAgent* inspectorCSSAgent() const { return m_inspectorCSSAgent; }
88 void setInspectorCSSAgent(InspectorCSSAgent* agent) { m_inspectorCSSAgent = agent; }
90 InspectorConsoleAgent* inspectorConsoleAgent() const { return m_inspectorConsoleAgent; }
91 void setInspectorConsoleAgent(InspectorConsoleAgent* agent) { m_inspectorConsoleAgent = agent; }
93 InspectorDOMAgent* inspectorDOMAgent() const { return m_inspectorDOMAgent; }
94 void setInspectorDOMAgent(InspectorDOMAgent* agent) { m_inspectorDOMAgent = agent; }
96 InspectorResourceAgent* inspectorResourceAgent() const { return m_inspectorResourceAgent; }
97 void setInspectorResourceAgent(InspectorResourceAgent* agent) { m_inspectorResourceAgent = agent; }
99 PageRuntimeAgent* pageRuntimeAgent() const { return m_pageRuntimeAgent; }
100 void setPageRuntimeAgent(PageRuntimeAgent* agent) { m_pageRuntimeAgent = agent; }
102 WorkerRuntimeAgent* workerRuntimeAgent() const { return m_workerRuntimeAgent; }
103 void setWorkerRuntimeAgent(WorkerRuntimeAgent* agent) { m_workerRuntimeAgent = agent; }
105 InspectorTimelineAgent* inspectorTimelineAgent() const { return m_inspectorTimelineAgent; }
106 void setInspectorTimelineAgent(InspectorTimelineAgent* agent) { m_inspectorTimelineAgent = agent; }
108 InspectorDOMStorageAgent* inspectorDOMStorageAgent() const { return m_inspectorDOMStorageAgent; }
109 void setInspectorDOMStorageAgent(InspectorDOMStorageAgent* agent) { m_inspectorDOMStorageAgent = agent; }
111 #if ENABLE(SQL_DATABASE)
112 InspectorDatabaseAgent* inspectorDatabaseAgent() const { return m_inspectorDatabaseAgent; }
113 void setInspectorDatabaseAgent(InspectorDatabaseAgent* agent) { m_inspectorDatabaseAgent = agent; }
116 InspectorApplicationCacheAgent* inspectorApplicationCacheAgent() const { return m_inspectorApplicationCacheAgent; }
117 void setInspectorApplicationCacheAgent(InspectorApplicationCacheAgent* agent) { m_inspectorApplicationCacheAgent = agent; }
119 #if ENABLE(JAVASCRIPT_DEBUGGER)
120 InspectorDebuggerAgent* inspectorDebuggerAgent() const { return m_inspectorDebuggerAgent; }
121 void setInspectorDebuggerAgent(InspectorDebuggerAgent* agent) { m_inspectorDebuggerAgent = agent; }
123 PageDebuggerAgent* pageDebuggerAgent() const { return m_pageDebuggerAgent; }
124 void setPageDebuggerAgent(PageDebuggerAgent* agent) { m_pageDebuggerAgent = agent; }
126 InspectorDOMDebuggerAgent* inspectorDOMDebuggerAgent() const { return m_inspectorDOMDebuggerAgent; }
127 void setInspectorDOMDebuggerAgent(InspectorDOMDebuggerAgent* agent) { m_inspectorDOMDebuggerAgent = agent; }
129 InspectorProfilerAgent* inspectorProfilerAgent() const { return m_inspectorProfilerAgent; }
130 void setInspectorProfilerAgent(InspectorProfilerAgent* agent) { m_inspectorProfilerAgent = agent; }
132 InspectorHeapProfilerAgent* inspectorHeapProfilerAgent() const { return m_inspectorHeapProfilerAgent; }
133 void setInspectorHeapProfilerAgent(InspectorHeapProfilerAgent* agent) { m_inspectorHeapProfilerAgent = agent; }
136 InspectorWorkerAgent* inspectorWorkerAgent() const { return m_inspectorWorkerAgent; }
137 void setInspectorWorkerAgent(InspectorWorkerAgent* agent) { m_inspectorWorkerAgent = agent; }
139 InspectorCanvasAgent* inspectorCanvasAgent() const { return m_inspectorCanvasAgent; }
140 void setInspectorCanvasAgent(InspectorCanvasAgent* agent) { m_inspectorCanvasAgent = agent; }
142 #if USE(ACCELERATED_COMPOSITING)
143 InspectorLayerTreeAgent* inspectorLayerTreeAgent() const { return m_inspectorLayerTreeAgent; }
144 void setInspectorLayerTreeAgent(InspectorLayerTreeAgent* agent) { m_inspectorLayerTreeAgent = agent; }
148 InstrumentingAgents(Inspector::InspectorEnvironment&);
150 Inspector::InspectorEnvironment& m_environment;
152 Inspector::InspectorAgent* m_inspectorAgent;
153 InspectorPageAgent* m_inspectorPageAgent;
154 InspectorCSSAgent* m_inspectorCSSAgent;
155 #if USE(ACCELERATED_COMPOSITING)
156 InspectorLayerTreeAgent* m_inspectorLayerTreeAgent;
158 InspectorConsoleAgent* m_inspectorConsoleAgent;
159 InspectorDOMAgent* m_inspectorDOMAgent;
160 InspectorResourceAgent* m_inspectorResourceAgent;
161 PageRuntimeAgent* m_pageRuntimeAgent;
162 WorkerRuntimeAgent* m_workerRuntimeAgent;
163 InspectorTimelineAgent* m_inspectorTimelineAgent;
164 InspectorDOMStorageAgent* m_inspectorDOMStorageAgent;
165 #if ENABLE(SQL_DATABASE)
166 InspectorDatabaseAgent* m_inspectorDatabaseAgent;
168 InspectorApplicationCacheAgent* m_inspectorApplicationCacheAgent;
169 #if ENABLE(JAVASCRIPT_DEBUGGER)
170 InspectorDebuggerAgent* m_inspectorDebuggerAgent;
171 PageDebuggerAgent* m_pageDebuggerAgent;
172 InspectorDOMDebuggerAgent* m_inspectorDOMDebuggerAgent;
173 InspectorProfilerAgent* m_inspectorProfilerAgent;
174 InspectorHeapProfilerAgent* m_inspectorHeapProfilerAgent;
176 InspectorWorkerAgent* m_inspectorWorkerAgent;
177 InspectorCanvasAgent* m_inspectorCanvasAgent;
180 InstrumentingAgents* instrumentationForPage(Page*);
181 InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope*);
185 #endif // !defined(InstrumentingAgents_h)