]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - inspector/agents/JSGlobalObjectRuntimeAgent.cpp
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / inspector / agents / JSGlobalObjectRuntimeAgent.cpp
index 126189e312762011ccde003c107e1e9a8c16c8a6..46049f56c75ad7398f3c9d075846ce7a1c128268 100644 (file)
@@ -26,8 +26,6 @@
 #include "config.h"
 #include "JSGlobalObjectRuntimeAgent.h"
 
-#if ENABLE(INSPECTOR)
-
 #include "InjectedScript.h"
 #include "InjectedScriptManager.h"
 #include "JSGlobalObject.h"
@@ -42,16 +40,18 @@ JSGlobalObjectRuntimeAgent::JSGlobalObjectRuntimeAgent(InjectedScriptManager* in
 {
 }
 
-void JSGlobalObjectRuntimeAgent::didCreateFrontendAndBackend(InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher)
+void JSGlobalObjectRuntimeAgent::didCreateFrontendAndBackend(FrontendChannel* frontendChannel, BackendDispatcher* backendDispatcher)
 {
-    m_frontendDispatcher = std::make_unique<InspectorRuntimeFrontendDispatcher>(frontendChannel);
-    m_backendDispatcher = InspectorRuntimeBackendDispatcher::create(backendDispatcher, this);
+    m_frontendDispatcher = std::make_unique<RuntimeFrontendDispatcher>(frontendChannel);
+    m_backendDispatcher = RuntimeBackendDispatcher::create(backendDispatcher, this);
 }
 
-void JSGlobalObjectRuntimeAgent::willDestroyFrontendAndBackend(InspectorDisconnectReason)
+void JSGlobalObjectRuntimeAgent::willDestroyFrontendAndBackend(DisconnectReason reason)
 {
     m_frontendDispatcher = nullptr;
-    m_backendDispatcher.clear();
+    m_backendDispatcher = nullptr;
+
+    InspectorRuntimeAgent::willDestroyFrontendAndBackend(reason);
 }
 
 VM& JSGlobalObjectRuntimeAgent::globalVM()
@@ -59,18 +59,16 @@ VM& JSGlobalObjectRuntimeAgent::globalVM()
     return m_globalObject.vm();
 }
 
-InjectedScript JSGlobalObjectRuntimeAgent::injectedScriptForEval(ErrorString* errorString, const int* executionContextId)
+InjectedScript JSGlobalObjectRuntimeAgent::injectedScriptForEval(ErrorString& errorString, const int* executionContextId)
 {
     ASSERT_UNUSED(executionContextId, !executionContextId);
 
     JSC::ExecState* scriptState = m_globalObject.globalExec();
     InjectedScript injectedScript = injectedScriptManager()->injectedScriptFor(scriptState);
     if (injectedScript.hasNoValue())
-        *errorString = ASCIILiteral("Internal error: main world execution context not found.");
+        errorString = ASCIILiteral("Internal error: main world execution context not found.");
 
     return injectedScript;
 }
 
 } // namespace Inspector
-
-#endif // ENABLE(INSPECTOR)