X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/2d39b0e377c0896910ee49ae70082ba665faf986..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/inspector/JSGlobalObjectInspectorController.h diff --git a/inspector/JSGlobalObjectInspectorController.h b/inspector/JSGlobalObjectInspectorController.h index 61ab1c1..6e3f94e 100644 --- a/inspector/JSGlobalObjectInspectorController.h +++ b/inspector/JSGlobalObjectInspectorController.h @@ -26,16 +26,24 @@ #ifndef JSGlobalObjectInspectorController_h #define JSGlobalObjectInspectorController_h -#if ENABLE(INSPECTOR) - #include "InspectorAgentRegistry.h" #include "InspectorEnvironment.h" #include #include #include +#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 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) override; +#endif private: void appendAPIBacktrace(ScriptCallStack* callStack); JSC::JSGlobalObject& m_globalObject; std::unique_ptr m_injectedScriptManager; - std::unique_ptr m_consoleClient; + std::unique_ptr m_consoleClient; + InspectorAgent* m_inspectorAgent; InspectorConsoleAgent* m_consoleAgent; - InspectorAgentRegistry m_agents; - InspectorFrontendChannel* m_inspectorFrontendChannel; - RefPtr m_inspectorBackendDispatcher; + InspectorDebuggerAgent* m_debuggerAgent; + AgentRegistry m_agents; + FrontendChannel* m_frontendChannel; + RefPtr m_backendDispatcher; + Ref 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)