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 InspectorController_h
32
#define InspectorController_h
36
#include "InspectorBaseAgent.h"
37
#include <wtf/Forward.h>
38
#include <wtf/HashMap.h>
39
#include <wtf/Noncopyable.h>
40
#include <wtf/text/WTFString.h>
44
class DOMWrapperWorld;
46
class GraphicsContext;
47
class InjectedScriptManager;
49
class InspectorApplicationCacheAgent;
50
class InspectorBackendDispatcher;
51
class InspectorBaseAgentInterface;
52
class InspectorClient;
53
class InspectorDOMAgent;
54
class InspectorDebuggerAgent;
55
class InspectorFrontend;
56
class InspectorFrontendChannel;
57
class InspectorFrontendClient;
58
class InspectorOverlay;
59
class InspectorPageAgent;
60
class InspectorProfilerAgent;
61
class InspectorResourceAgent;
63
class InstrumentingAgents;
66
class PostWorkerNotificationToFrontendTask;
71
class InspectorController {
72
WTF_MAKE_NONCOPYABLE(InspectorController);
73
WTF_MAKE_FAST_ALLOCATED;
75
~InspectorController();
77
static PassOwnPtr<InspectorController> create(Page*, InspectorClient*);
78
void inspectedPageDestroyed();
81
Page* inspectedPage() const;
86
void setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient>);
87
bool hasInspectorFrontendClient() const;
88
void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
89
void setInjectedScriptForOrigin(const String& origin, const String& source);
91
void dispatchMessageFromFrontend(const String& message);
93
bool hasFrontend() const { return m_inspectorFrontend; }
94
void connectFrontend(InspectorFrontendChannel*);
95
void disconnectFrontend();
96
void reconnectFrontend(InspectorFrontendChannel*, const String& inspectorStateCookie);
97
void setProcessId(long);
98
void webViewResized(const IntSize&);
101
void drawHighlight(GraphicsContext&) const;
102
void getHighlight(Highlight*) const;
103
void hideHighlight();
104
Node* highlightedNode() const;
106
void evaluateForTestInFrontend(long callId, const String& script);
108
#if ENABLE(JAVASCRIPT_DEBUGGER)
109
bool profilerEnabled();
110
void setProfilerEnabled(bool);
115
void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize);
117
InspectorClient* inspectorClient() const { return m_inspectorClient; }
118
InspectorPageAgent* pageAgent() const { return m_pageAgent; }
120
void reportMemoryUsage(MemoryObjectInfo*) const;
123
InspectorController(Page*, InspectorClient*);
125
friend class PostWorkerNotificationToFrontendTask;
126
friend InstrumentingAgents* instrumentationForPage(Page*);
128
OwnPtr<InstrumentingAgents> m_instrumentingAgents;
129
OwnPtr<InjectedScriptManager> m_injectedScriptManager;
130
OwnPtr<InspectorState> m_state;
131
OwnPtr<InspectorOverlay> m_overlay;
133
InspectorAgent* m_inspectorAgent;
134
InspectorDOMAgent* m_domAgent;
135
InspectorResourceAgent* m_resourceAgent;
136
InspectorPageAgent* m_pageAgent;
137
#if ENABLE(JAVASCRIPT_DEBUGGER)
138
InspectorDebuggerAgent* m_debuggerAgent;
139
InspectorProfilerAgent* m_profilerAgent;
142
RefPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher;
143
OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient;
144
OwnPtr<InspectorFrontend> m_inspectorFrontend;
146
InspectorClient* m_inspectorClient;
147
InspectorAgentRegistry m_agents;
152
#endif // ENABLE(INSPECTOR)
154
#endif // !defined(InspectorController_h)