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 37 namespace WebCore { 38 39 class InspectorAgent; 40 class InspectorApplicationCacheAgent; 41 class InspectorPageAgent; 42 class InspectorBrowserDebuggerAgent; 43 class InspectorCSSAgent; 44 class InspectorConsoleAgent; 45 class InspectorDOMAgent; 46 class InspectorDOMStorageAgent; 47 class InspectorDatabaseAgent; 48 class InspectorDebuggerAgent; 49 class InspectorProfilerAgent; 50 class InspectorResourceAgent; 51 class InspectorRuntimeAgent; 52 class InspectorTimelineAgent; 53 54 class InstrumentingAgents { 55 WTF_MAKE_NONCOPYABLE(InstrumentingAgents); 56 WTF_MAKE_FAST_ALLOCATED; 57 public: InstrumentingAgents()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 { } ~InstrumentingAgents()82 ~InstrumentingAgents() { } 83 inspectorAgent()84 InspectorAgent* inspectorAgent() const { return m_inspectorAgent; } setInspectorAgent(InspectorAgent * agent)85 void setInspectorAgent(InspectorAgent* agent) { m_inspectorAgent = agent; } 86 inspectorPageAgent()87 InspectorPageAgent* inspectorPageAgent() const { return m_inspectorPageAgent; } setInspectorPageAgent(InspectorPageAgent * agent)88 void setInspectorPageAgent(InspectorPageAgent* agent) { m_inspectorPageAgent = agent; } 89 inspectorCSSAgent()90 InspectorCSSAgent* inspectorCSSAgent() const { return m_inspectorCSSAgent; } setInspectorCSSAgent(InspectorCSSAgent * agent)91 void setInspectorCSSAgent(InspectorCSSAgent* agent) { m_inspectorCSSAgent = agent; } 92 inspectorConsoleAgent()93 InspectorConsoleAgent* inspectorConsoleAgent() const { return m_inspectorConsoleAgent; } setInspectorConsoleAgent(InspectorConsoleAgent * agent)94 void setInspectorConsoleAgent(InspectorConsoleAgent* agent) { m_inspectorConsoleAgent = agent; } 95 inspectorDOMAgent()96 InspectorDOMAgent* inspectorDOMAgent() const { return m_inspectorDOMAgent; } setInspectorDOMAgent(InspectorDOMAgent * agent)97 void setInspectorDOMAgent(InspectorDOMAgent* agent) { m_inspectorDOMAgent = agent; } 98 inspectorResourceAgent()99 InspectorResourceAgent* inspectorResourceAgent() const { return m_inspectorResourceAgent; } setInspectorResourceAgent(InspectorResourceAgent * agent)100 void setInspectorResourceAgent(InspectorResourceAgent* agent) { m_inspectorResourceAgent = agent; } 101 inspectorRuntimeAgent()102 InspectorRuntimeAgent* inspectorRuntimeAgent() const { return m_inspectorRuntimeAgent; } setInspectorRuntimeAgent(InspectorRuntimeAgent * agent)103 void setInspectorRuntimeAgent(InspectorRuntimeAgent* agent) { m_inspectorRuntimeAgent = agent; } 104 inspectorTimelineAgent()105 InspectorTimelineAgent* inspectorTimelineAgent() const { return m_inspectorTimelineAgent; } setInspectorTimelineAgent(InspectorTimelineAgent * agent)106 void setInspectorTimelineAgent(InspectorTimelineAgent* agent) { m_inspectorTimelineAgent = agent; } 107 108 #if ENABLE(DOM_STORAGE) inspectorDOMStorageAgent()109 InspectorDOMStorageAgent* inspectorDOMStorageAgent() const { return m_inspectorDOMStorageAgent; } setInspectorDOMStorageAgent(InspectorDOMStorageAgent * agent)110 void setInspectorDOMStorageAgent(InspectorDOMStorageAgent* agent) { m_inspectorDOMStorageAgent = agent; } 111 #endif 112 #if ENABLE(DATABASE) inspectorDatabaseAgent()113 InspectorDatabaseAgent* inspectorDatabaseAgent() const { return m_inspectorDatabaseAgent; } setInspectorDatabaseAgent(InspectorDatabaseAgent * agent)114 void setInspectorDatabaseAgent(InspectorDatabaseAgent* agent) { m_inspectorDatabaseAgent = agent; } 115 #endif 116 #if ENABLE(OFFLINE_WEB_APPLICATIONS) inspectorApplicationCacheAgent()117 InspectorApplicationCacheAgent* inspectorApplicationCacheAgent() const { return m_inspectorApplicationCacheAgent; } setInspectorApplicationCacheAgent(InspectorApplicationCacheAgent * agent)118 void setInspectorApplicationCacheAgent(InspectorApplicationCacheAgent* agent) { m_inspectorApplicationCacheAgent = agent; } 119 #endif 120 #if ENABLE(JAVASCRIPT_DEBUGGER) inspectorDebuggerAgent()121 InspectorDebuggerAgent* inspectorDebuggerAgent() const { return m_inspectorDebuggerAgent; } setInspectorDebuggerAgent(InspectorDebuggerAgent * agent)122 void setInspectorDebuggerAgent(InspectorDebuggerAgent* agent) { m_inspectorDebuggerAgent = agent; } 123 inspectorBrowserDebuggerAgent()124 InspectorBrowserDebuggerAgent* inspectorBrowserDebuggerAgent() const { return m_inspectorBrowserDebuggerAgent; } setInspectorBrowserDebuggerAgent(InspectorBrowserDebuggerAgent * agent)125 void setInspectorBrowserDebuggerAgent(InspectorBrowserDebuggerAgent* agent) { m_inspectorBrowserDebuggerAgent = agent; } 126 inspectorProfilerAgent()127 InspectorProfilerAgent* inspectorProfilerAgent() const { return m_inspectorProfilerAgent; } setInspectorProfilerAgent(InspectorProfilerAgent * agent)128 void setInspectorProfilerAgent(InspectorProfilerAgent* agent) { m_inspectorProfilerAgent = agent; } 129 #endif 130 131 private: 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