[Cleanup] Remove ScriptGlobalObject
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Aug 2017 17:59:54 +0000 (17:59 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Aug 2017 17:59:54 +0000 (17:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175173

Reviewed by Darin Adler.

Source/WebCore:

ScriptGlobalObject's two functions were only being used in
four places. Three of those uses (ScriptGlobalObject::set in
InspectorFrontendClientLocal, WebInspectorUI, and RemoteWebInspectorUI)
were merged into the new function addSelfToGlobalObjectInWorld on
InspectorFrontendHost. The remaining function (ScriptGlobalObject::get
in InspectorFrontendHost) was easily inlined.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/ScriptGlobalObject.cpp: Removed.
* bindings/js/ScriptGlobalObject.h: Removed.
Removed ScriptGlobalObject.

* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::windowObjectCleared):
Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead.

* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::showContextMenu):
Inline ScriptGlobalObject::get.

(WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld):
Add helper which inlines ScriptGlobalObject::set and works
as a helper for the three inspector frontends.

Source/WebKit:

* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::windowObjectCleared):
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::windowObjectCleared):
Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220278 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/ScriptGlobalObject.cpp [deleted file]
Source/WebCore/bindings/js/ScriptGlobalObject.h [deleted file]
Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
Source/WebCore/inspector/InspectorFrontendHost.cpp
Source/WebCore/inspector/InspectorFrontendHost.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.cpp
Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp

index d2ad9f3f5cf98bb95929275397771e2a90d87cc3..fe5417fd80445142ae1523e929b5fd363bf07a02 100644 (file)
@@ -1259,7 +1259,6 @@ set(WebCore_SOURCES
     bindings/js/ScheduledAction.cpp
     bindings/js/ScriptCachedFrameData.cpp
     bindings/js/ScriptController.cpp
-    bindings/js/ScriptGlobalObject.cpp
     bindings/js/ScriptModuleLoader.cpp
     bindings/js/ScriptState.cpp
     bindings/js/StructuredClone.cpp
index bf2e7d53673ad026acb1189fd5108f61a860d03c..de59f2e6b1debe5ec33f3fb955495879a0149f32 100644 (file)
@@ -1,3 +1,37 @@
+2017-08-03  Sam Weinig  <sam@webkit.org>
+
+        [Cleanup] Remove ScriptGlobalObject
+        https://bugs.webkit.org/show_bug.cgi?id=175173
+
+        Reviewed by Darin Adler.
+
+        ScriptGlobalObject's two functions were only being used in
+        four places. Three of those uses (ScriptGlobalObject::set in 
+        InspectorFrontendClientLocal, WebInspectorUI, and RemoteWebInspectorUI)
+        were merged into the new function addSelfToGlobalObjectInWorld on
+        InspectorFrontendHost. The remaining function (ScriptGlobalObject::get
+        in InspectorFrontendHost) was easily inlined.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * bindings/js/ScriptGlobalObject.cpp: Removed.
+        * bindings/js/ScriptGlobalObject.h: Removed.
+        Removed ScriptGlobalObject.
+
+        * inspector/InspectorFrontendClientLocal.cpp:
+        (WebCore::InspectorFrontendClientLocal::windowObjectCleared):
+        Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead.
+
+        * inspector/InspectorFrontendHost.h:
+        * inspector/InspectorFrontendHost.cpp:
+        (WebCore::InspectorFrontendHost::showContextMenu):
+        Inline ScriptGlobalObject::get.
+
+        (WebCore::InspectorFrontendHost::addSelfToGlobalObjectInWorld):
+        Add helper which inlines ScriptGlobalObject::set and works
+        as a helper for the three inspector frontends.
+
 2017-08-04  Ryan Haddad  <ryanhaddad@apple.com>
 
         Unreviewed, rolling out r220268.
index ace9854402a9e0bc08459fd20a55637e75f45141..e9d63daa0aa7b33df4298d7302a04d8e65809aaf 100644 (file)
                41E408391DCB748900EFCE19 /* PeerConnectionBackend.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41E408381DCB747900EFCE19 /* PeerConnectionBackend.cpp */; };
                41F062140F5F192600A07EAC /* InspectorDatabaseResource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F062120F5F192600A07EAC /* InspectorDatabaseResource.h */; };
                41F062150F5F192600A07EAC /* InspectorDatabaseResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F062130F5F192600A07EAC /* InspectorDatabaseResource.cpp */; };
-               41F066E40F64BCF600A07EAC /* ScriptGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F066E20F64BCF600A07EAC /* ScriptGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               41F066E50F64BCF600A07EAC /* ScriptGlobalObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F066E30F64BCF600A07EAC /* ScriptGlobalObject.cpp */; };
                41F1D21F0EF35C2A00DA8753 /* ScriptCachedFrameData.h in Headers */ = {isa = PBXBuildFile; fileRef = 41F1D21D0EF35C2A00DA8753 /* ScriptCachedFrameData.h */; settings = {ATTRIBUTES = (Private, ); }; };
                41F1D2200EF35C2A00DA8753 /* ScriptCachedFrameData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F1D21E0EF35C2A00DA8753 /* ScriptCachedFrameData.cpp */; };
                41F54F8B1C50C50300338488 /* FetchBody.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41F54F7D1C50C4F600338488 /* FetchBody.cpp */; };
                41E408381DCB747900EFCE19 /* PeerConnectionBackend.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PeerConnectionBackend.cpp; sourceTree = "<group>"; };
                41F062120F5F192600A07EAC /* InspectorDatabaseResource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseResource.h; sourceTree = "<group>"; };
                41F062130F5F192600A07EAC /* InspectorDatabaseResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDatabaseResource.cpp; sourceTree = "<group>"; };
-               41F066E20F64BCF600A07EAC /* ScriptGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptGlobalObject.h; sourceTree = "<group>"; };
-               41F066E30F64BCF600A07EAC /* ScriptGlobalObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptGlobalObject.cpp; sourceTree = "<group>"; };
                41F1D21D0EF35C2A00DA8753 /* ScriptCachedFrameData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptCachedFrameData.h; sourceTree = "<group>"; };
                41F1D21E0EF35C2A00DA8753 /* ScriptCachedFrameData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptCachedFrameData.cpp; sourceTree = "<group>"; };
                41F54F7D1C50C4F600338488 /* FetchBody.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FetchBody.cpp; sourceTree = "<group>"; };
                                93B70D5309EB0C7C009D8468 /* ScriptController.cpp */,
                                93B70D5409EB0C7C009D8468 /* ScriptController.h */,
                                A83E1C720E49042B00140B9C /* ScriptControllerMac.mm */,
-                               41F066E30F64BCF600A07EAC /* ScriptGlobalObject.cpp */,
-                               41F066E20F64BCF600A07EAC /* ScriptGlobalObject.h */,
                                E38838941BAD145F00D62EE3 /* ScriptModuleLoader.cpp */,
                                E38838951BAD145F00D62EE3 /* ScriptModuleLoader.h */,
                                934CC1090EDB223900A658F2 /* ScriptSourceCode.h */,
                                08A484780E5272C500C3FE76 /* ScriptElement.h in Headers */,
                                E3E4E2A81E3B17100023BB8A /* ScriptElementCachedScriptFetcher.h in Headers */,
                                E11C9D9B0EB3681200E409DB /* ScriptExecutionContext.h in Headers */,
-                               41F066E40F64BCF600A07EAC /* ScriptGlobalObject.h in Headers */,
                                E38838991BAD145F00D62EE3 /* ScriptModuleLoader.h in Headers */,
                                E38838991BAD145F00D62EE3 /* ScriptModuleLoader.h in Headers */,
                                FD31603612B0267600C1A359 /* ScriptProcessorNode.h in Headers */,
                                08A484770E5272C500C3FE76 /* ScriptElement.cpp in Sources */,
                                E3E4E2A71E3B17100023BB8A /* ScriptElementCachedScriptFetcher.cpp in Sources */,
                                E11C9DB00EB3699500E409DB /* ScriptExecutionContext.cpp in Sources */,
-                               41F066E50F64BCF600A07EAC /* ScriptGlobalObject.cpp in Sources */,
                                E38838981BAD145F00D62EE3 /* ScriptModuleLoader.cpp in Sources */,
                                FD31603512B0267600C1A359 /* ScriptProcessorNode.cpp in Sources */,
                                8A413AE11207BBA50082016E /* ScriptRunner.cpp in Sources */,
index 2e3812d19ff7f6af60dd70d4610e195065393fc6..d90142ef38a3a8ae5b7f74488d73b9886748b180 100644 (file)
 #include "ScheduledAction.cpp"
 #include "ScriptCachedFrameData.cpp"
 #include "ScriptController.cpp"
-#include "ScriptGlobalObject.cpp"
 #include "ScriptModuleLoader.cpp"
 #include "ScriptState.cpp"
 #include "SerializedScriptValue.cpp"
diff --git a/Source/WebCore/bindings/js/ScriptGlobalObject.cpp b/Source/WebCore/bindings/js/ScriptGlobalObject.cpp
deleted file mode 100644 (file)
index 7f066dc..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "ScriptGlobalObject.h"
-
-#include "JSDOMConvertInterface.h"
-#include "JSInspectorFrontendHost.h"
-#include <runtime/CatchScope.h>
-#include <runtime/IdentifierInlines.h>
-#include <runtime/JSObjectInlines.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-bool ScriptGlobalObject::set(ExecState& scriptState, const char* name, InspectorFrontendHost& value)
-{
-    auto& vm = scriptState.vm();
-    JSLockHolder lock(vm);
-    auto scope = DECLARE_CATCH_SCOPE(vm);
-    auto& globalObject = *jsCast<JSDOMGlobalObject*>(scriptState.lexicalGlobalObject());
-    globalObject.putDirect(vm, Identifier::fromString(&vm, name), toJS<IDLInterface<InspectorFrontendHost>>(scriptState, globalObject, value));
-    if (UNLIKELY(scope.exception())) {
-        reportException(&scriptState, scope.exception());
-        return false;
-    }
-    return true;
-}
-
-bool ScriptGlobalObject::get(ExecState& scriptState, const char* name, JSObject*& object)
-{
-    auto& vm = scriptState.vm();
-    JSLockHolder lock(vm);
-    JSValue value = scriptState.lexicalGlobalObject()->get(&scriptState, Identifier::fromString(&vm, name));
-    if (!value || !value.isObject())
-        return false;
-    object = asObject(value);
-    return true;
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/bindings/js/ScriptGlobalObject.h b/Source/WebCore/bindings/js/ScriptGlobalObject.h
deleted file mode 100644 (file)
index f879a02..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-namespace JSC {
-class ExecState;
-class JSObject;
-}
-
-namespace WebCore {
-
-class InspectorFrontendHost;
-
-class ScriptGlobalObject {
-public:
-    WEBCORE_EXPORT static bool set(JSC::ExecState&, const char* name, InspectorFrontendHost&);
-    static bool get(JSC::ExecState&, const char* name, JSC::JSObject*&);
-
-private:
-    ScriptGlobalObject() = delete;
-};
-
-} // namespace WebCore
index b108c10d00d51d2e65676f166952d7c3659225db..99424f459dfa9148ec891d376bc347e2497ad09c 100644 (file)
@@ -45,7 +45,6 @@
 #include "MainFrame.h"
 #include "Page.h"
 #include "ScriptController.h"
-#include "ScriptGlobalObject.h"
 #include "ScriptState.h"
 #include "Settings.h"
 #include "Timer.h"
@@ -152,7 +151,7 @@ void InspectorFrontendClientLocal::windowObjectCleared()
         m_frontendHost->disconnectClient();
     
     m_frontendHost = InspectorFrontendHost::create(this, m_frontendPage);
-    ScriptGlobalObject::set(*execStateFromPage(debuggerWorld(), m_frontendPage), "InspectorFrontendHost", *m_frontendHost);
+    m_frontendHost->addSelfToGlobalObjectInWorld(debuggerWorld());
 }
 
 void InspectorFrontendClientLocal::frontendLoaded()
index e05f67e8bf470bc7a20f5fdb13347c8a1f0926c2..42719a35fbfdbe3f6b587edefe392883d3057fc6 100644 (file)
 #include "HitTestResult.h"
 #include "InspectorController.h"
 #include "InspectorFrontendClient.h"
+#include "JSDOMConvertInterface.h"
+#include "JSDOMExceptionHandling.h"
+#include "JSInspectorFrontendHost.h"
 #include "JSMainThreadExecState.h"
 #include "MainFrame.h"
 #include "MouseEvent.h"
 #include "Node.h"
 #include "Page.h"
 #include "Pasteboard.h"
-#include "ScriptGlobalObject.h"
 #include "ScriptState.h"
 #include "UserGestureIndicator.h"
 #include <bindings/ScriptFunctionCall.h>
@@ -145,6 +147,19 @@ void InspectorFrontendHost::disconnectClient()
     m_frontendPage = nullptr;
 }
 
+void InspectorFrontendHost::addSelfToGlobalObjectInWorld(DOMWrapperWorld& world)
+{
+    auto& state = *execStateFromPage(world, m_frontendPage);
+    auto& vm = state.vm();
+    JSC::JSLockHolder lock(vm);
+    auto scope = DECLARE_CATCH_SCOPE(vm);
+
+    auto& globalObject = *JSC::jsCast<JSDOMGlobalObject*>(state.lexicalGlobalObject());
+    globalObject.putDirect(vm, JSC::Identifier::fromString(&vm, "InspectorFrontendHost"), toJS<IDLInterface<InspectorFrontendHost>>(state, globalObject, *this));
+    if (UNLIKELY(scope.exception()))
+        reportException(&state, scope.exception());
+}
+
 void InspectorFrontendHost::loaded()
 {
     if (m_client)
@@ -367,17 +382,17 @@ void InspectorFrontendHost::showContextMenu(Event& event, Vector<ContextMenuItem
 {
 #if ENABLE(CONTEXT_MENUS)
     ASSERT(m_frontendPage);
+
     auto& state = *execStateFromPage(debuggerWorld(), m_frontendPage);
-    JSC::JSObject* frontendApiObject;
-    if (!ScriptGlobalObject::get(state, "InspectorFrontendAPI", frontendApiObject)) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
+    auto value = state.lexicalGlobalObject()->get(&state, JSC::Identifier::fromString(&state.vm(), "InspectorFrontendHost"));
+    ASSERT(value);
+    ASSERT(value.isObject());
+    auto* frontendAPIObject = asObject(value);
     
     ContextMenu menu;
     populateContextMenu(WTFMove(items), menu);
 
-    auto menuProvider = FrontendMenuProvider::create(this, { &state, frontendApiObject }, menu.items());
+    auto menuProvider = FrontendMenuProvider::create(this, { &state, frontendAPIObject }, menu.items());
     m_menuProvider = menuProvider.ptr();
     m_frontendPage->contextMenuController().showContextMenu(event, menuProvider);
 #else
index c844e56bd98bf4ecafe9610fa59c7587091d20cf..654f060dd86ab5dfd14ce0f3bdecb9b5b3bd8acf 100644 (file)
@@ -36,6 +36,7 @@
 
 namespace WebCore {
 
+class DOMWrapperWorld;
 class Event;
 class FrontendMenuProvider;
 class InspectorFrontendClient;
@@ -51,6 +52,8 @@ public:
     WEBCORE_EXPORT ~InspectorFrontendHost();
     WEBCORE_EXPORT void disconnectClient();
 
+    WEBCORE_EXPORT void addSelfToGlobalObjectInWorld(DOMWrapperWorld&);
+
     void loaded();
     void requestSetDockSide(const String&);
     void closeWindow();
index f3edd016d54a5968ef5c7e6ca30da7eff2ff7c33..b0c9e9b02857696ef8a1c775d025947e1dfbc323 100644 (file)
@@ -1,3 +1,16 @@
+2017-08-03  Sam Weinig  <sam@webkit.org>
+
+        [Cleanup] Remove ScriptGlobalObject
+        https://bugs.webkit.org/show_bug.cgi?id=175173
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
+        (WebKit::RemoteWebInspectorUI::windowObjectCleared):
+        * WebProcess/WebPage/WebInspectorUI.cpp:
+        (WebKit::WebInspectorUI::windowObjectCleared):
+        Remove call to ScriptGlobalObject::set and use addSelfToGlobalObjectInWorld instead.
+
 2017-08-03  Brian Burg  <bburg@apple.com>
 
         [Cocoa] Web Automation: copy JavaScript atoms to WebKit.framework private headers
index 35e0450acf09bbdbf0bfc55655ae2439bd80f927..da8e900c035dce10e9dd1adf6ab59c6cb65d89b4 100644 (file)
@@ -33,8 +33,6 @@
 #include <WebCore/Chrome.h>
 #include <WebCore/DOMWrapperWorld.h>
 #include <WebCore/InspectorController.h>
-#include <WebCore/ScriptGlobalObject.h>
-#include <WebCore/ScriptState.h>
 
 using namespace WebCore;
 
@@ -88,7 +86,7 @@ void RemoteWebInspectorUI::windowObjectCleared()
         m_frontendHost->disconnectClient();
 
     m_frontendHost = InspectorFrontendHost::create(this, m_page.corePage());
-    ScriptGlobalObject::set(*execStateFromPage(mainThreadNormalWorld(), m_page.corePage()), ASCIILiteral("InspectorFrontendHost"), *m_frontendHost);
+    m_frontendHost->addSelfToGlobalObjectInWorld(mainThreadNormalWorld());
 }
 
 void RemoteWebInspectorUI::frontendLoaded()
index a01edb370ce271175a270d97c1bc5d995687129e..02490e7c2399d5adfe8f51c5befcba1a5b9db224 100644 (file)
@@ -34,8 +34,6 @@
 #include <WebCore/DOMWrapperWorld.h>
 #include <WebCore/InspectorController.h>
 #include <WebCore/NotImplemented.h>
-#include <WebCore/ScriptGlobalObject.h>
-#include <WebCore/ScriptState.h>
 
 using namespace WebCore;
 
@@ -84,7 +82,7 @@ void WebInspectorUI::windowObjectCleared()
         m_frontendHost->disconnectClient();
 
     m_frontendHost = InspectorFrontendHost::create(this, m_page.corePage());
-    ScriptGlobalObject::set(*execStateFromPage(mainThreadNormalWorld(), m_page.corePage()), ASCIILiteral("InspectorFrontendHost"), *m_frontendHost);
+    m_frontendHost->addSelfToGlobalObjectInWorld(mainThreadNormalWorld());
 }
 
 void WebInspectorUI::frontendLoaded()