~ubuntu-branches/ubuntu/raring/qtwebkit-source/raring-proposed

« back to all changes in this revision

Viewing changes to Source/WebCore/inspector/InspectorController.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-02-18 14:24:18 UTC
  • Revision ID: package-import@ubuntu.com-20130218142418-eon0jmjg3nj438uy
Tags: upstream-2.3
ImportĀ upstreamĀ versionĀ 2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 InspectorController_h
 
32
#define InspectorController_h
 
33
 
 
34
#if ENABLE(INSPECTOR)
 
35
 
 
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>
 
41
 
 
42
namespace WebCore {
 
43
 
 
44
class DOMWrapperWorld;
 
45
class Frame;
 
46
class GraphicsContext;
 
47
class InjectedScriptManager;
 
48
class InspectorAgent;
 
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;
 
62
class InspectorState;
 
63
class InstrumentingAgents;
 
64
class IntSize;
 
65
class Page;
 
66
class PostWorkerNotificationToFrontendTask;
 
67
class Node;
 
68
 
 
69
struct Highlight;
 
70
 
 
71
class InspectorController {
 
72
    WTF_MAKE_NONCOPYABLE(InspectorController);
 
73
    WTF_MAKE_FAST_ALLOCATED;
 
74
public:
 
75
    ~InspectorController();
 
76
 
 
77
    static PassOwnPtr<InspectorController> create(Page*, InspectorClient*);
 
78
    void inspectedPageDestroyed();
 
79
 
 
80
    bool enabled() const;
 
81
    Page* inspectedPage() const;
 
82
 
 
83
    void show();
 
84
    void close();
 
85
 
 
86
    void setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient>);
 
87
    bool hasInspectorFrontendClient() const;
 
88
    void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
 
89
    void setInjectedScriptForOrigin(const String& origin, const String& source);
 
90
 
 
91
    void dispatchMessageFromFrontend(const String& message);
 
92
 
 
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&);
 
99
 
 
100
    void inspect(Node*);
 
101
    void drawHighlight(GraphicsContext&) const;
 
102
    void getHighlight(Highlight*) const;
 
103
    void hideHighlight();
 
104
    Node* highlightedNode() const;
 
105
 
 
106
    void evaluateForTestInFrontend(long callId, const String& script);
 
107
 
 
108
#if ENABLE(JAVASCRIPT_DEBUGGER)
 
109
    bool profilerEnabled();
 
110
    void setProfilerEnabled(bool);
 
111
 
 
112
    void resume();
 
113
#endif
 
114
 
 
115
    void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize);
 
116
 
 
117
    InspectorClient* inspectorClient() const { return m_inspectorClient; }
 
118
    InspectorPageAgent* pageAgent() const { return m_pageAgent; }
 
119
 
 
120
    void reportMemoryUsage(MemoryObjectInfo*) const;
 
121
 
 
122
private:
 
123
    InspectorController(Page*, InspectorClient*);
 
124
 
 
125
    friend class PostWorkerNotificationToFrontendTask;
 
126
    friend InstrumentingAgents* instrumentationForPage(Page*);
 
127
 
 
128
    OwnPtr<InstrumentingAgents> m_instrumentingAgents;
 
129
    OwnPtr<InjectedScriptManager> m_injectedScriptManager;
 
130
    OwnPtr<InspectorState> m_state;
 
131
    OwnPtr<InspectorOverlay> m_overlay;
 
132
 
 
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;
 
140
#endif
 
141
 
 
142
    RefPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher;
 
143
    OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient;
 
144
    OwnPtr<InspectorFrontend> m_inspectorFrontend;
 
145
    Page* m_page;
 
146
    InspectorClient* m_inspectorClient;
 
147
    InspectorAgentRegistry m_agents;
 
148
};
 
149
 
 
150
}
 
151
 
 
152
#endif // ENABLE(INSPECTOR)
 
153
 
 
154
#endif // !defined(InspectorController_h)