Title: [220278] trunk/Source
Revision
220278
Author
wei...@apple.com
Date
2017-08-04 10:59:54 -0700 (Fri, 04 Aug 2017)

Log Message

[Cleanup] Remove ScriptGlobalObject
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.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (220277 => 220278)


--- trunk/Source/WebCore/CMakeLists.txt	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-08-04 17:59:54 UTC (rev 220278)
@@ -1259,7 +1259,6 @@
     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

Modified: trunk/Source/WebCore/ChangeLog (220277 => 220278)


--- trunk/Source/WebCore/ChangeLog	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebCore/ChangeLog	2017-08-04 17:59:54 UTC (rev 220278)
@@ -1,3 +1,37 @@
+2017-08-03  Sam Weinig  <s...@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  <ryanhad...@apple.com>
 
         Unreviewed, rolling out r220268.

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (220277 => 220278)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-08-04 17:59:54 UTC (rev 220278)
@@ -1798,8 +1798,6 @@
 		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 */; };
@@ -9468,8 +9466,6 @@
 		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>"; };
@@ -23628,8 +23624,6 @@
 				93B70D5309EB0C7C009D8468 /* ScriptController.cpp */,
 				93B70D5409EB0C7C009D8468 /* ScriptController.h */,
 				A83E1C720E49042B00140B9C /* ScriptControllerMac.mm */,
-				41F066E30F64BCF600A07EAC /* ScriptGlobalObject.cpp */,
-				41F066E20F64BCF600A07EAC /* ScriptGlobalObject.h */,
 				E38838941BAD145F00D62EE3 /* ScriptModuleLoader.cpp */,
 				E38838951BAD145F00D62EE3 /* ScriptModuleLoader.h */,
 				934CC1090EDB223900A658F2 /* ScriptSourceCode.h */,
@@ -29354,7 +29348,6 @@
 				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 */,
@@ -33203,7 +33196,6 @@
 				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 */,

Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (220277 => 220278)


--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp	2017-08-04 17:59:54 UTC (rev 220278)
@@ -103,7 +103,6 @@
 #include "ScheduledAction.cpp"
 #include "ScriptCachedFrameData.cpp"
 #include "ScriptController.cpp"
-#include "ScriptGlobalObject.cpp"
 #include "ScriptModuleLoader.cpp"
 #include "ScriptState.cpp"
 #include "SerializedScriptValue.cpp"

Deleted: trunk/Source/WebCore/bindings/js/ScriptGlobalObject.cpp (220277 => 220278)


--- trunk/Source/WebCore/bindings/js/ScriptGlobalObject.cpp	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebCore/bindings/js/ScriptGlobalObject.cpp	2017-08-04 17:59:54 UTC (rev 220278)
@@ -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

Deleted: trunk/Source/WebCore/bindings/js/ScriptGlobalObject.h (220277 => 220278)


--- trunk/Source/WebCore/bindings/js/ScriptGlobalObject.h	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebCore/bindings/js/ScriptGlobalObject.h	2017-08-04 17:59:54 UTC (rev 220278)
@@ -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

Modified: trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp (220277 => 220278)


--- trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebCore/inspector/InspectorFrontendClientLocal.cpp	2017-08-04 17:59:54 UTC (rev 220278)
@@ -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 @@
         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()

Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp (220277 => 220278)


--- trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp	2017-08-04 17:59:54 UTC (rev 220278)
@@ -42,6 +42,9 @@
 #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"
@@ -48,7 +51,6 @@
 #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 @@
     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 @@
 {
 #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

Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.h (220277 => 220278)


--- trunk/Source/WebCore/inspector/InspectorFrontendHost.h	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.h	2017-08-04 17:59:54 UTC (rev 220278)
@@ -36,6 +36,7 @@
 
 namespace WebCore {
 
+class DOMWrapperWorld;
 class Event;
 class FrontendMenuProvider;
 class InspectorFrontendClient;
@@ -51,6 +52,8 @@
     WEBCORE_EXPORT ~InspectorFrontendHost();
     WEBCORE_EXPORT void disconnectClient();
 
+    WEBCORE_EXPORT void addSelfToGlobalObjectInWorld(DOMWrapperWorld&);
+
     void loaded();
     void requestSetDockSide(const String&);
     void closeWindow();

Modified: trunk/Source/WebKit/ChangeLog (220277 => 220278)


--- trunk/Source/WebKit/ChangeLog	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebKit/ChangeLog	2017-08-04 17:59:54 UTC (rev 220278)
@@ -1,3 +1,16 @@
+2017-08-03  Sam Weinig  <s...@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  <bb...@apple.com>
 
         [Cocoa] Web Automation: copy _javascript_ atoms to WebKit.framework private headers

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.cpp (220277 => 220278)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.cpp	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteWebInspectorUI.cpp	2017-08-04 17:59:54 UTC (rev 220278)
@@ -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 @@
         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()

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp (220277 => 220278)


--- trunk/Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp	2017-08-04 17:10:36 UTC (rev 220277)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebInspectorUI.cpp	2017-08-04 17:59:54 UTC (rev 220278)
@@ -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 @@
         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()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to