1/*
2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
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
13 * distribution.
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.
17 *
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.
29 */
30
31#ifndef InstrumentingAgents_h
32#define InstrumentingAgents_h
33
34#include <wtf/FastAllocBase.h>
35#include <wtf/Noncopyable.h>
36
37namespace WebCore {
38
39class InspectorAgent;
40class InspectorApplicationCacheAgent;
41class InspectorPageAgent;
42class InspectorBrowserDebuggerAgent;
43class InspectorCSSAgent;
44class InspectorConsoleAgent;
45class InspectorDOMAgent;
46class InspectorDOMStorageAgent;
47class InspectorDatabaseAgent;
48class InspectorDebuggerAgent;
49class InspectorProfilerAgent;
50class InspectorResourceAgent;
51class InspectorRuntimeAgent;
52class InspectorTimelineAgent;
53
54class InstrumentingAgents {
55    WTF_MAKE_NONCOPYABLE(InstrumentingAgents);
56    WTF_MAKE_FAST_ALLOCATED;
57public:
58    InstrumentingAgents()
59        : m_inspectorAgent(0)
60        , m_inspectorPageAgent(0)
61        , m_inspectorCSSAgent(0)
62        , m_inspectorConsoleAgent(0)
63        , m_inspectorDOMAgent(0)
64        , m_inspectorResourceAgent(0)
65        , m_inspectorRuntimeAgent(0)
66        , m_inspectorTimelineAgent(0)
67#if ENABLE(DOM_STORAGE)
68        , m_inspectorDOMStorageAgent(0)
69#endif
70#if ENABLE(DATABASE)
71        , m_inspectorDatabaseAgent(0)
72#endif
73#if ENABLE(OFFLINE_WEB_APPLICATIONS)
74        , m_inspectorApplicationCacheAgent(0)
75#endif
76#if ENABLE(JAVASCRIPT_DEBUGGER)
77        , m_inspectorDebuggerAgent(0)
78        , m_inspectorBrowserDebuggerAgent(0)
79        , m_inspectorProfilerAgent(0)
80#endif
81    { }
82    ~InstrumentingAgents() { }
83
84    InspectorAgent* inspectorAgent() const { return m_inspectorAgent; }
85    void setInspectorAgent(InspectorAgent* agent) { m_inspectorAgent = agent; }
86
87    InspectorPageAgent* inspectorPageAgent() const { return m_inspectorPageAgent; }
88    void setInspectorPageAgent(InspectorPageAgent* agent) { m_inspectorPageAgent = agent; }
89
90    InspectorCSSAgent* inspectorCSSAgent() const { return m_inspectorCSSAgent; }
91    void setInspectorCSSAgent(InspectorCSSAgent* agent) { m_inspectorCSSAgent = agent; }
92
93    InspectorConsoleAgent* inspectorConsoleAgent() const { return m_inspectorConsoleAgent; }
94    void setInspectorConsoleAgent(InspectorConsoleAgent* agent) { m_inspectorConsoleAgent = agent; }
95
96    InspectorDOMAgent* inspectorDOMAgent() const { return m_inspectorDOMAgent; }
97    void setInspectorDOMAgent(InspectorDOMAgent* agent) { m_inspectorDOMAgent = agent; }
98
99    InspectorResourceAgent* inspectorResourceAgent() const { return m_inspectorResourceAgent; }
100    void setInspectorResourceAgent(InspectorResourceAgent* agent) { m_inspectorResourceAgent = agent; }
101
102    InspectorRuntimeAgent* inspectorRuntimeAgent() const { return m_inspectorRuntimeAgent; }
103    void setInspectorRuntimeAgent(InspectorRuntimeAgent* agent) { m_inspectorRuntimeAgent = agent; }
104
105    InspectorTimelineAgent* inspectorTimelineAgent() const { return m_inspectorTimelineAgent; }
106    void setInspectorTimelineAgent(InspectorTimelineAgent* agent) { m_inspectorTimelineAgent = agent; }
107
108#if ENABLE(DOM_STORAGE)
109    InspectorDOMStorageAgent* inspectorDOMStorageAgent() const { return m_inspectorDOMStorageAgent; }
110    void setInspectorDOMStorageAgent(InspectorDOMStorageAgent* agent) { m_inspectorDOMStorageAgent = agent; }
111#endif
112#if ENABLE(DATABASE)
113    InspectorDatabaseAgent* inspectorDatabaseAgent() const { return m_inspectorDatabaseAgent; }
114    void setInspectorDatabaseAgent(InspectorDatabaseAgent* agent) { m_inspectorDatabaseAgent = agent; }
115#endif
116#if ENABLE(OFFLINE_WEB_APPLICATIONS)
117    InspectorApplicationCacheAgent* inspectorApplicationCacheAgent() const { return m_inspectorApplicationCacheAgent; }
118    void setInspectorApplicationCacheAgent(InspectorApplicationCacheAgent* agent) { m_inspectorApplicationCacheAgent = agent; }
119#endif
120#if ENABLE(JAVASCRIPT_DEBUGGER)
121    InspectorDebuggerAgent* inspectorDebuggerAgent() const { return m_inspectorDebuggerAgent; }
122    void setInspectorDebuggerAgent(InspectorDebuggerAgent* agent) { m_inspectorDebuggerAgent = agent; }
123
124    InspectorBrowserDebuggerAgent* inspectorBrowserDebuggerAgent() const { return m_inspectorBrowserDebuggerAgent; }
125    void setInspectorBrowserDebuggerAgent(InspectorBrowserDebuggerAgent* agent) { m_inspectorBrowserDebuggerAgent = agent; }
126
127    InspectorProfilerAgent* inspectorProfilerAgent() const { return m_inspectorProfilerAgent; }
128    void setInspectorProfilerAgent(InspectorProfilerAgent* agent) { m_inspectorProfilerAgent = agent; }
129#endif
130
131private:
132    InspectorAgent* m_inspectorAgent;
133    InspectorPageAgent* m_inspectorPageAgent;
134    InspectorCSSAgent* m_inspectorCSSAgent;
135    InspectorConsoleAgent* m_inspectorConsoleAgent;
136    InspectorDOMAgent* m_inspectorDOMAgent;
137    InspectorResourceAgent* m_inspectorResourceAgent;
138    InspectorRuntimeAgent* m_inspectorRuntimeAgent;
139    InspectorTimelineAgent* m_inspectorTimelineAgent;
140#if ENABLE(DOM_STORAGE)
141    InspectorDOMStorageAgent* m_inspectorDOMStorageAgent;
142#endif
143#if ENABLE(DATABASE)
144    InspectorDatabaseAgent* m_inspectorDatabaseAgent;
145#endif
146#if ENABLE(OFFLINE_WEB_APPLICATIONS)
147    InspectorApplicationCacheAgent* m_inspectorApplicationCacheAgent;
148#endif
149#if ENABLE(JAVASCRIPT_DEBUGGER)
150    InspectorDebuggerAgent* m_inspectorDebuggerAgent;
151    InspectorBrowserDebuggerAgent* m_inspectorBrowserDebuggerAgent;
152    InspectorProfilerAgent* m_inspectorProfilerAgent;
153#endif
154};
155
156}
157
158#endif // !defined(InstrumentingAgents_h)
159