]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - inspector/JSGlobalObjectInspectorController.h
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / inspector / JSGlobalObjectInspectorController.h
index 61ab1c13c2b70462e4d27a7cbf41df23ceaacacf..6e3f94eac234ec8983698ceac73f16e03604cbcf 100644 (file)
 #ifndef JSGlobalObjectInspectorController_h
 #define JSGlobalObjectInspectorController_h
 
-#if ENABLE(INSPECTOR)
-
 #include "InspectorAgentRegistry.h"
 #include "InspectorEnvironment.h"
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/text/WTFString.h>
 
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+#include "AugmentableInspectorController.h"
+#endif
+
+namespace WTF {
+class Stopwatch;
+}
+
+
 namespace JSC {
 class ConsoleClient;
+class Exception;
 class ExecState;
 class JSGlobalObject;
 class JSValue;
@@ -43,23 +51,29 @@ class JSValue;
 
 namespace Inspector {
 
+class BackendDispatcher;
+class FrontendChannel;
 class InjectedScriptManager;
+class InspectorAgent;
 class InspectorConsoleAgent;
-class InspectorBackendDispatcher;
-class InspectorConsoleAgent;
-class InspectorFrontendChannel;
-class JSConsoleClient;
+class InspectorDebuggerAgent;
+class JSGlobalObjectConsoleClient;
 class ScriptCallStack;
 
-class JSGlobalObjectInspectorController final : public InspectorEnvironment {
+class JSGlobalObjectInspectorController final
+    : public InspectorEnvironment
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+    , public AugmentableInspectorController
+#endif
+{
     WTF_MAKE_NONCOPYABLE(JSGlobalObjectInspectorController);
     WTF_MAKE_FAST_ALLOCATED;
 public:
     JSGlobalObjectInspectorController(JSC::JSGlobalObject&);
     ~JSGlobalObjectInspectorController();
 
-    void connectFrontend(InspectorFrontendChannel*);
-    void disconnectFrontend(InspectorDisconnectReason reason);
+    void connectFrontend(FrontendChannel*, bool isAutomaticInspection);
+    void disconnectFrontend(DisconnectReason);
     void dispatchMessageFromFrontend(const String&);
 
     void globalObjectDestroyed();
@@ -67,7 +81,8 @@ public:
     bool includesNativeCallStackWhenReportingExceptions() const { return m_includeNativeCallStackWithExceptions; }
     void setIncludesNativeCallStackWhenReportingExceptions(bool includesNativeCallStack) { m_includeNativeCallStackWithExceptions = includesNativeCallStack; }
 
-    void reportAPIException(JSC::ExecState*, JSC::JSValue exception);
+    void pause();
+    void reportAPIException(JSC::ExecState*, JSC::Exception*);
 
     JSC::ConsoleClient* consoleClient() const;
 
@@ -77,22 +92,38 @@ public:
     virtual InspectorEvaluateHandler evaluateHandler() const override;
     virtual void willCallInjectedScriptFunction(JSC::ExecState*, const String&, int) override { }
     virtual void didCallInjectedScriptFunction(JSC::ExecState*) override { }
+    virtual void frontendInitialized() override;
+    virtual Ref<WTF::Stopwatch> executionStopwatch() override;
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+    virtual AugmentableInspectorControllerClient* augmentableInspectorControllerClient() const override { return m_augmentingClient; } 
+    virtual void setAugmentableInspectorControllerClient(AugmentableInspectorControllerClient* client) override { m_augmentingClient = client; }
+
+    virtual FrontendChannel* frontendChannel() const override { return m_frontendChannel; }
+    virtual void appendExtraAgent(std::unique_ptr<InspectorAgentBase>) override;
+#endif
 
 private:
     void appendAPIBacktrace(ScriptCallStack* callStack);
 
     JSC::JSGlobalObject& m_globalObject;
     std::unique_ptr<InjectedScriptManager> m_injectedScriptManager;
-    std::unique_ptr<JSConsoleClient> m_consoleClient;
+    std::unique_ptr<JSGlobalObjectConsoleClient> m_consoleClient;
+    InspectorAgent* m_inspectorAgent;
     InspectorConsoleAgent* m_consoleAgent;
-    InspectorAgentRegistry m_agents;
-    InspectorFrontendChannel* m_inspectorFrontendChannel;
-    RefPtr<InspectorBackendDispatcher> m_inspectorBackendDispatcher;
+    InspectorDebuggerAgent* m_debuggerAgent;
+    AgentRegistry m_agents;
+    FrontendChannel* m_frontendChannel;
+    RefPtr<BackendDispatcher> m_backendDispatcher;
+    Ref<WTF::Stopwatch> m_executionStopwatch;
     bool m_includeNativeCallStackWithExceptions;
+    bool m_isAutomaticInspection;
+
+#if ENABLE(INSPECTOR_ALTERNATE_DISPATCHERS)
+    AugmentableInspectorControllerClient* m_augmentingClient;
+#endif
 };
 
 } // namespace Inspector
 
-#endif // ENABLE(INSPECTOR)
-
 #endif // !defined(JSGlobalObjectInspectorController_h)