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
34 #include "PlatformString.h"
35 #include <wtf/Forward.h>
36 #include <wtf/Noncopyable.h>
37 #include <wtf/Vector.h>
41 class DOMWrapperWorld;
43 class GraphicsContext;
45 class InspectorBackendDispatcher;
46 class InspectorClient;
47 class InspectorFrontend;
48 class InspectorFrontendClient;
50 class PostWorkerNotificationToFrontendTask;
53 class InspectorController {
54 WTF_MAKE_NONCOPYABLE(InspectorController);
55 WTF_MAKE_FAST_ALLOCATED;
57 InspectorController(Page*, InspectorClient*);
58 ~InspectorController();
61 Page* inspectedPage() const;
66 void setInspectorFrontendClient(PassOwnPtr<InspectorFrontendClient>);
67 bool hasInspectorFrontendClient() const;
68 void didClearWindowObjectInWorld(Frame*, DOMWrapperWorld*);
69 void setInspectorExtensionAPI(const String& source);
71 void dispatchMessageFromFrontend(const String& message);
73 bool hasFrontend() const { return m_inspectorFrontend; }
74 void connectFrontend();
75 void disconnectFrontend();
76 void restoreInspectorStateFromCookie(const String& inspectorCookie);
80 void drawNodeHighlight(GraphicsContext&) const;
83 void evaluateForTestInFrontend(long callId, const String& script);
85 void startTimelineProfiler();
86 void stopTimelineProfiler();
87 bool timelineProfilerEnabled();
89 #if ENABLE(JAVASCRIPT_DEBUGGER)
90 bool profilerEnabled();
91 void enableProfiler();
92 void startUserInitiatedProfiling();
93 bool isRecordingUserInitiatedProfile() const;
94 void stopUserInitiatedProfiling();
95 void disableProfiler();
96 void showAndEnableDebugger();
97 bool debuggerEnabled();
98 void disableDebugger();
103 friend class PostWorkerNotificationToFrontendTask;
105 OwnPtr<InspectorAgent> m_inspectorAgent;
106 OwnPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher;
107 OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient;
108 OwnPtr<InspectorFrontend> m_inspectorFrontend;
109 InspectorClient* m_inspectorClient;
110 bool m_openingFrontend;
115 #endif // !defined(InspectorController_h)