Rename JSDOMWindowProxy to JSWindowProxy
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Apr 2018 02:15:39 +0000 (02:15 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Apr 2018 02:15:39 +0000 (02:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184797

Reviewed by Sam Weinig.

Rename JSDOMWindowProxy to JSWindowProxy for consistency with WindowProxy.

Source/WebCore:

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/IDLTypes.h:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMConvertWindowProxy.h:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::JSDOMWindowBase):
(WebCore::JSDOMWindowBase::finishCreation):
(WebCore::JSDOMWindowBase::proxy const):
(WebCore::toJSDOMWindow):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::toWrapped):
* bindings/js/JSEventTargetCustom.cpp:
(WebCore::JSEventTarget::toWrapped):
* bindings/js/JSRemoteDOMWindowBase.cpp:
(WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
(WebCore::toJSRemoteDOMWindow):
* bindings/js/JSRemoteDOMWindowBase.h:
* bindings/js/JSWindowProxy.cpp: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.cpp.
(WebCore::JSWindowProxy::JSWindowProxy):
(WebCore::JSWindowProxy::finishCreation):
(WebCore::JSWindowProxy::create):
(WebCore::JSWindowProxy::destroy):
(WebCore::JSWindowProxy::setWindow):
(WebCore::JSWindowProxy::attachDebugger):
(WebCore::JSWindowProxy::wrapped const):
(WebCore::JSWindowProxy::toWrapped):
(WebCore::toJS):
(WebCore::toJSWindowProxy):
* bindings/js/JSWindowProxy.h: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.h.
(WebCore::toJS):
(WebCore::toJSWindowProxy):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::initScriptForWindowProxy):
* bindings/js/ScriptController.h:
* bindings/js/WindowProxy.cpp:
(WebCore::WindowProxy::createJSWindowProxy):
(WebCore::WindowProxy::jsWindowProxiesAsVector const):
(WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
* bindings/js/WindowProxy.h:
(WebCore::WindowProxy::jsWindowProxy):
(WebCore::WindowProxy::existingJSWindowProxy const):
* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(GenerateHeader):
(GenerateOverloadDispatcher):
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
* page/Frame.cpp:
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::didCreateWindowProxy const):
* page/csp/ContentSecurityPolicy.h:

Source/WebInspectorUI:

* UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
(HeapSnapshot.prototype._isNodeGlobalObject):

Source/WebKitLegacy/mac:

* DOM/DOMUtility.mm:
(createDOMWrapper):
* WebView/WebFrame.mm:
(-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):

Source/WebKitLegacy/win:

* WebFrame.cpp:
(WebFrame::stringByEvaluatingJavaScriptInScriptWorld):

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

38 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/IDLTypes.h
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSDOMConvertWindowProxy.h
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.h
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSEventTargetCustom.cpp
Source/WebCore/bindings/js/JSRemoteDOMWindowBase.cpp
Source/WebCore/bindings/js/JSRemoteDOMWindowBase.h
Source/WebCore/bindings/js/JSWindowProxy.cpp [moved from Source/WebCore/bindings/js/JSDOMWindowProxy.cpp with 80% similarity]
Source/WebCore/bindings/js/JSWindowProxy.h [moved from Source/WebCore/bindings/js/JSDOMWindowProxy.h with 83% similarity]
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/js/ScriptController.h
Source/WebCore/bindings/js/WindowProxy.cpp
Source/WebCore/bindings/js/WindowProxy.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.h
Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h
Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h
Source/WebCore/bindings/scripts/test/JS/JSTestNode.h
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h
Source/WebCore/bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h
Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.h
Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.h
Source/WebCore/page/Frame.cpp
Source/WebCore/page/csp/ContentSecurityPolicy.cpp
Source/WebCore/page/csp/ContentSecurityPolicy.h
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/DOM/DOMUtility.mm
Source/WebKitLegacy/mac/WebView/WebFrame.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebFrame.cpp

index 7a03e30..6c961c5 100644 (file)
@@ -1,3 +1,67 @@
+2018-04-19  Chris Dumez  <cdumez@apple.com>
+
+        Rename JSDOMWindowProxy to JSWindowProxy
+        https://bugs.webkit.org/show_bug.cgi?id=184797
+
+        Reviewed by Sam Weinig.
+
+        Rename JSDOMWindowProxy to JSWindowProxy for consistency with WindowProxy.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/IDLTypes.h:
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * bindings/js/JSDOMConvertWindowProxy.h:
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::JSDOMWindowBase):
+        (WebCore::JSDOMWindowBase::finishCreation):
+        (WebCore::JSDOMWindowBase::proxy const):
+        (WebCore::toJSDOMWindow):
+        * bindings/js/JSDOMWindowBase.h:
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::toWrapped):
+        * bindings/js/JSEventTargetCustom.cpp:
+        (WebCore::JSEventTarget::toWrapped):
+        * bindings/js/JSRemoteDOMWindowBase.cpp:
+        (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
+        (WebCore::toJSRemoteDOMWindow):
+        * bindings/js/JSRemoteDOMWindowBase.h:
+        * bindings/js/JSWindowProxy.cpp: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.cpp.
+        (WebCore::JSWindowProxy::JSWindowProxy):
+        (WebCore::JSWindowProxy::finishCreation):
+        (WebCore::JSWindowProxy::create):
+        (WebCore::JSWindowProxy::destroy):
+        (WebCore::JSWindowProxy::setWindow):
+        (WebCore::JSWindowProxy::attachDebugger):
+        (WebCore::JSWindowProxy::wrapped const):
+        (WebCore::JSWindowProxy::toWrapped):
+        (WebCore::toJS):
+        (WebCore::toJSWindowProxy):
+        * bindings/js/JSWindowProxy.h: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.h.
+        (WebCore::toJS):
+        (WebCore::toJSWindowProxy):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::initScriptForWindowProxy):
+        * bindings/js/ScriptController.h:
+        * bindings/js/WindowProxy.cpp:
+        (WebCore::WindowProxy::createJSWindowProxy):
+        (WebCore::WindowProxy::jsWindowProxiesAsVector const):
+        (WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
+        * bindings/js/WindowProxy.h:
+        (WebCore::WindowProxy::jsWindowProxy):
+        (WebCore::WindowProxy::existingJSWindowProxy const):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (AddToIncludesForIDLType):
+        (GenerateHeader):
+        (GenerateOverloadDispatcher):
+        (GenerateImplementation):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
+        * page/Frame.cpp:
+        * page/csp/ContentSecurityPolicy.cpp:
+        (WebCore::ContentSecurityPolicy::didCreateWindowProxy const):
+        * page/csp/ContentSecurityPolicy.h:
+
 2018-04-19  Dirk Schulze  <krit@webbkit.org>
 
         Introduce SVGGeometryElement interface
index b18c2c1..5c74a61 100644 (file)
@@ -391,7 +391,6 @@ bindings/js/JSDOMPromiseDeferred.cpp
 bindings/js/JSDOMWindowBase.cpp
 bindings/js/JSDOMWindowCustom.cpp
 bindings/js/JSDOMWindowProperties.cpp
-bindings/js/JSDOMWindowProxy.cpp
 bindings/js/JSDOMWrapper.cpp
 bindings/js/JSDOMWrapperCache.cpp
 bindings/js/JSDocumentCustom.cpp
@@ -452,6 +451,7 @@ bindings/js/JSWebGL2RenderingContextCustom.cpp
 bindings/js/JSWebGLRenderingContextCustom.cpp
 bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp
 bindings/js/JSWebGPURenderingContextCustom.cpp
+bindings/js/JSWindowProxy.cpp
 bindings/js/JSWorkerGlobalScopeBase.cpp
 bindings/js/JSWorkerGlobalScopeCustom.cpp
 bindings/js/JSWorkerNavigatorCustom.cpp
index d1a45a6..395aff7 100644 (file)
                BCBB8ABA13F1AFB000734DF0 /* PODIntervalTree.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBB8AB613F1AFB000734DF0 /* PODIntervalTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCBB8ABB13F1AFB000734DF0 /* PODRedBlackTree.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBB8AB713F1AFB000734DF0 /* PODRedBlackTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCBD21AB0E417AD400A070F2 /* URLHash.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBD21AA0E417AD400A070F2 /* URLHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBFB53B0DCD29CF0019B3E5 /* JSDOMWindowProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               BCBFB53D0DCD29CF0019B3E5 /* JSWindowProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBFB53B0DCD29CF0019B3E5 /* JSWindowProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCC0E8761BFE70E9008F7F50 /* HTMLPictureElement.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC0E8741BFE70E9008F7F50 /* HTMLPictureElement.h */; };
                BCC5BE010C0E93110011C2DB /* JSCSSStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BCC5BDFF0C0E93110011C2DB /* JSCSSStyleSheet.h */; };
                BCCBAD410C18C14200CE890F /* JSHTMLCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = BCCBAD3F0C18C14200CE890F /* JSHTMLCollection.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BCBB8AB613F1AFB000734DF0 /* PODIntervalTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PODIntervalTree.h; sourceTree = "<group>"; };
                BCBB8AB713F1AFB000734DF0 /* PODRedBlackTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PODRedBlackTree.h; sourceTree = "<group>"; };
                BCBD21AA0E417AD400A070F2 /* URLHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = URLHash.h; sourceTree = "<group>"; };
-               BCBFB53A0DCD29CF0019B3E5 /* JSDOMWindowProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWindowProxy.cpp; sourceTree = "<group>"; };
-               BCBFB53B0DCD29CF0019B3E5 /* JSDOMWindowProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMWindowProxy.h; sourceTree = "<group>"; };
+               BCBFB53A0DCD29CF0019B3E5 /* JSWindowProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWindowProxy.cpp; sourceTree = "<group>"; };
+               BCBFB53B0DCD29CF0019B3E5 /* JSWindowProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWindowProxy.h; sourceTree = "<group>"; };
                BCC0E8731BFE70E9008F7F50 /* HTMLPictureElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPictureElement.cpp; sourceTree = "<group>"; };
                BCC0E8741BFE70E9008F7F50 /* HTMLPictureElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLPictureElement.h; sourceTree = "<group>"; };
                BCC5BDFE0C0E93110011C2DB /* JSCSSStyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSStyleSheet.cpp; sourceTree = "<group>"; };
                                BC6932720D7E293900AE44D1 /* JSDOMWindowBase.h */,
                                460CBF331D4BCCFE0092E88E /* JSDOMWindowProperties.cpp */,
                                460CBF341D4BCCFE0092E88E /* JSDOMWindowProperties.h */,
-                               BCBFB53A0DCD29CF0019B3E5 /* JSDOMWindowProxy.cpp */,
-                               BCBFB53B0DCD29CF0019B3E5 /* JSDOMWindowProxy.h */,
                                4170A2E91D8C0CC000318452 /* JSDOMWrapper.cpp */,
                                65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */,
                                7C45C9CB1E3E8E4900AAB558 /* JSDOMWrapperCache.cpp */,
                                46BCBBC12085008000710638 /* JSRemoteDOMWindowBase.cpp */,
                                46BCBBC02085007F00710638 /* JSRemoteDOMWindowBase.h */,
                                931AE3B81FB80EAE00F5EFB2 /* JSValueInWrappedObject.h */,
+                               BCBFB53A0DCD29CF0019B3E5 /* JSWindowProxy.cpp */,
+                               BCBFB53B0DCD29CF0019B3E5 /* JSWindowProxy.h */,
                                E1C36D320EB0A094007410BC /* JSWorkerGlobalScopeBase.cpp */,
                                E1C36D330EB0A094007410BC /* JSWorkerGlobalScopeBase.h */,
                                709A01FD1E3D0BCC006B0D4C /* ModuleFetchFailureKind.h */,
                                BC6932740D7E293900AE44D1 /* JSDOMWindowBase.h in Headers */,
                                652FBBBC0DE27CB60001D386 /* JSDOMWindowCustom.h in Headers */,
                                460CBF361D4BCD0E0092E88E /* JSDOMWindowProperties.h in Headers */,
-                               BCBFB53D0DCD29CF0019B3E5 /* JSDOMWindowProxy.h in Headers */,
                                65E0E9441133C89F00B4CB10 /* JSDOMWrapper.h in Headers */,
                                7C45C9D31E3FCBD700AAB558 /* JSDOMWrapperCache.h in Headers */,
                                93A8061E1E03B585008A1F26 /* JSDoubleRange.h in Headers */,
                                31C0FF400E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h in Headers */,
                                5DA5E0FD102B953800088CF9 /* JSWebSocket.h in Headers */,
                                65DF320609D1CC60000BE325 /* JSWheelEvent.h in Headers */,
+                               BCBFB53D0DCD29CF0019B3E5 /* JSWindowProxy.h in Headers */,
                                E1CAA5C60E8BD23600A73ECA /* JSWorker.h in Headers */,
                                E18256900EF2B02D00933242 /* JSWorkerGlobalScope.h in Headers */,
                                E1C36D350EB0A094007410BC /* JSWorkerGlobalScopeBase.h in Headers */,
index 23a3e38..5fe77e8 100644 (file)
@@ -51,7 +51,7 @@ namespace WebCore {
 class IDBKey;
 class IDBKeyData;
 class IDBValue;
-class JSDOMWindowProxy;
+class JSWindowProxy;
 class DOMPromise;
 class ScheduledAction;
 
@@ -274,7 +274,7 @@ struct IDLScheduledAction : IDLType<std::unique_ptr<ScheduledAction>> { };
 template<typename T> struct IDLSerializedScriptValue : IDLWrapper<T> { };
 template<typename T> struct IDLEventListener : IDLWrapper<T> { };
 template<typename T> struct IDLXPathNSResolver : IDLWrapper<T> { };
-struct IDLWindowProxy : IDLWrapper<JSDOMWindowProxy> { };
+struct IDLWindowProxy : IDLWrapper<JSWindowProxy> { };
 
 struct IDLIDBKey : IDLWrapper<IDBKey> { };
 struct IDLIDBKeyData : IDLWrapper<IDBKeyData> { };
index 0830bcf..8166c76 100644 (file)
@@ -52,7 +52,6 @@
 #include "JSDOMWindowBase.cpp"
 #include "JSDOMWindowCustom.cpp"
 #include "JSDOMWindowProperties.cpp"
-#include "JSDOMWindowProxy.cpp"
 #include "JSDOMWrapper.cpp"
 #include "JSDOMWrapperCache.cpp"
 #include "JSDeprecatedCSSOMValueCustom.cpp"
@@ -98,6 +97,7 @@
 #include "JSTreeWalkerCustom.cpp"
 #include "JSVideoTrackCustom.cpp"
 #include "JSVideoTrackListCustom.cpp"
+#include "JSWindowProxy.cpp"
 #include "JSWorkerGlobalScopeBase.cpp"
 #include "JSWorkerGlobalScopeCustom.cpp"
 #include "JSXMLDocumentCustom.cpp"
index 66148cb..82c1ff4 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "IDLTypes.h"
 #include "JSDOMConvertBase.h"
-#include "JSDOMWindowProxy.h"
+#include "JSWindowProxy.h"
 
 namespace WebCore {
 
index 589c940..da35c16 100644 (file)
@@ -78,7 +78,7 @@ const GlobalObjectMethodTable JSDOMWindowBase::s_globalObjectMethodTable = {
     &defaultLanguage
 };
 
-JSDOMWindowBase::JSDOMWindowBase(VM& vm, Structure* structure, RefPtr<DOMWindow>&& window, JSDOMWindowProxy* proxy)
+JSDOMWindowBase::JSDOMWindowBase(VM& vm, Structure* structure, RefPtr<DOMWindow>&& window, JSWindowProxy* proxy)
     : JSDOMGlobalObject(vm, structure, proxy->world(), &s_globalObjectMethodTable)
     , m_windowCloseWatchpoints((window && window->frame()) ? IsWatched : IsInvalidated)
     , m_wrapped(WTFMove(window))
@@ -86,7 +86,7 @@ JSDOMWindowBase::JSDOMWindowBase(VM& vm, Structure* structure, RefPtr<DOMWindow>
 {
 }
 
-void JSDOMWindowBase::finishCreation(VM& vm, JSDOMWindowProxy* proxy)
+void JSDOMWindowBase::finishCreation(VM& vm, JSWindowProxy* proxy)
 {
     Base::finishCreation(vm, proxy);
     ASSERT(inherits(vm, info()));
@@ -243,7 +243,7 @@ void JSDOMWindowBase::willRemoveFromWindowProxy()
     setCurrentEvent(0);
 }
 
-JSDOMWindowProxy* JSDOMWindowBase::proxy() const
+JSWindowProxy* JSDOMWindowBase::proxy() const
 {
     return m_proxy;
 }
@@ -271,8 +271,8 @@ JSDOMWindow* toJSDOMWindow(JSC::VM& vm, JSValue value)
         const ClassInfo* classInfo = object->classInfo(vm);
         if (classInfo == JSDOMWindow::info())
             return jsCast<JSDOMWindow*>(object);
-        if (classInfo == JSDOMWindowProxy::info())
-            return jsDynamicCast<JSDOMWindow*>(vm, jsCast<JSDOMWindowProxy*>(object)->window());
+        if (classInfo == JSWindowProxy::info())
+            return jsDynamicCast<JSDOMWindow*>(vm, jsCast<JSWindowProxy*>(object)->window());
         value = object->getPrototypeDirect(vm);
     }
     return nullptr;
index 8cdb94b..f5709a9 100644 (file)
@@ -44,13 +44,13 @@ class DOMWrapperWorld;
 class Frame;
 class JSDOMWindow;
 class JSDOMWindowBasePrivate;
-class JSDOMWindowProxy;
+class JSWindowProxy;
 
 class WEBCORE_EXPORT JSDOMWindowBase : public JSDOMGlobalObject {
     typedef JSDOMGlobalObject Base;
 protected:
-    JSDOMWindowBase(JSC::VM&, JSC::Structure*, RefPtr<DOMWindow>&&, JSDOMWindowProxy*);
-    void finishCreation(JSC::VM&, JSDOMWindowProxy*);
+    JSDOMWindowBase(JSC::VM&, JSC::Structure*, RefPtr<DOMWindow>&&, JSWindowProxy*);
+    void finishCreation(JSC::VM&, JSWindowProxy*);
 
     static void destroy(JSCell*);
 
@@ -60,7 +60,7 @@ public:
     DOMWindow& wrapped() const { return *m_wrapped; }
     ScriptExecutionContext* scriptExecutionContext() const;
 
-    // Called just before removing this window from the JSDOMWindowProxy.
+    // Called just before removing this window from the JSWindowProxy.
     void willRemoveFromWindowProxy();
 
     DECLARE_INFO;
@@ -80,7 +80,7 @@ public:
 
     void printErrorMessage(const String&) const;
 
-    JSDOMWindowProxy* proxy() const;
+    JSWindowProxy* proxy() const;
 
     static void fireFrameClearedWatchpointsForWindow(DOMWindow*);
 
@@ -97,11 +97,11 @@ private:
     static void promiseRejectionTracker(JSC::JSGlobalObject*, JSC::ExecState*, JSC::JSPromise*, JSC::JSPromiseRejectionOperation);
 
     RefPtr<DOMWindow> m_wrapped;
-    JSDOMWindowProxy* m_proxy;
+    JSWindowProxy* m_proxy;
 };
 
 WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, DOMWindow&);
-// The following return a JSDOMWindowProxy or jsNull()
+// The following return a JSWindowProxy or jsNull()
 // JSDOMGlobalObject* is ignored, accessing a window in any context will use that DOMWindow's prototype chain.
 inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject*, DOMWindow& window) { return toJS(state, window); }
 inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, DOMWindow* window) { return window ? toJS(state, globalObject, *window) : JSC::jsNull(); }
index a2f6847..90214ce 100644 (file)
@@ -30,7 +30,6 @@
 #include "JSDOMConvertNullable.h"
 #include "JSDOMConvertNumbers.h"
 #include "JSDOMConvertStrings.h"
-#include "JSDOMWindowProxy.h"
 #include "JSEvent.h"
 #include "JSEventListener.h"
 #include "JSHTMLAudioElement.h"
@@ -38,6 +37,7 @@
 #include "JSHTMLOptionElement.h"
 #include "JSIDBFactory.h"
 #include "JSRemoteDOMWindow.h"
+#include "JSWindowProxy.h"
 #include "JSWorker.h"
 #include "Location.h"
 #include "RuntimeEnabledFeatures.h"
@@ -467,8 +467,8 @@ DOMWindow* JSDOMWindow::toWrapped(VM& vm, JSValue value)
     JSObject* object = asObject(value);
     if (object->inherits<JSDOMWindow>(vm))
         return &jsCast<JSDOMWindow*>(object)->wrapped();
-    if (object->inherits<JSDOMWindowProxy>(vm)) {
-        if (auto* jsDOMWindow = jsDynamicCast<JSDOMWindow*>(vm, jsCast<JSDOMWindowProxy*>(object)->window()))
+    if (object->inherits<JSWindowProxy>(vm)) {
+        if (auto* jsDOMWindow = jsDynamicCast<JSDOMWindow*>(vm, jsCast<JSWindowProxy*>(object)->window()))
             return &jsDOMWindow->wrapped();
     }
     return nullptr;
index 89bdf1c..f5f737e 100644 (file)
@@ -31,8 +31,8 @@
 #include "EventTargetHeaders.h"
 #include "EventTargetInterfaces.h"
 #include "JSDOMWindow.h"
-#include "JSDOMWindowProxy.h"
 #include "JSEventListener.h"
+#include "JSWindowProxy.h"
 #include "JSWorkerGlobalScope.h"
 #include "OffscreenCanvas.h"
 #include "WorkerGlobalScope.h"
@@ -62,7 +62,7 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, EventTarget& targ
 
 EventTarget* JSEventTarget::toWrapped(VM& vm, JSValue value)
 {
-    TRY_TO_UNWRAP_WITH_INTERFACE(DOMWindowProxy)
+    TRY_TO_UNWRAP_WITH_INTERFACE(WindowProxy)
     TRY_TO_UNWRAP_WITH_INTERFACE(DOMWindow)
     TRY_TO_UNWRAP_WITH_INTERFACE(WorkerGlobalScope)
     TRY_TO_UNWRAP_WITH_INTERFACE(EventTarget)
index 8ee14f0..47e3401 100644 (file)
@@ -26,8 +26,8 @@
 #include "config.h"
 #include "JSRemoteDOMWindowBase.h"
 
-#include "JSDOMWindowProxy.h"
 #include "JSRemoteDOMWindow.h"
+#include "JSWindowProxy.h"
 
 using namespace JSC;
 
@@ -50,7 +50,7 @@ const GlobalObjectMethodTable JSRemoteDOMWindowBase::s_globalObjectMethodTable =
     nullptr, // defaultLanguage
 };
 
-JSRemoteDOMWindowBase::JSRemoteDOMWindowBase(VM& vm, Structure* structure, RefPtr<RemoteDOMWindow>&& window, JSDOMWindowProxy* proxy)
+JSRemoteDOMWindowBase::JSRemoteDOMWindowBase(VM& vm, Structure* structure, RefPtr<RemoteDOMWindow>&& window, JSWindowProxy* proxy)
     : JSDOMGlobalObject(vm, structure, proxy->world(), &s_globalObjectMethodTable)
     , m_wrapped(WTFMove(window))
 {
@@ -76,8 +76,8 @@ JSRemoteDOMWindow* toJSRemoteDOMWindow(JSC::VM& vm, JSValue value)
         const ClassInfo* classInfo = object->classInfo(vm);
         if (classInfo == JSRemoteDOMWindow::info())
             return jsCast<JSRemoteDOMWindow*>(object);
-        if (classInfo == JSDOMWindowProxy::info())
-            return jsDynamicCast<JSRemoteDOMWindow*>(vm, jsCast<JSDOMWindowProxy*>(object)->window());
+        if (classInfo == JSWindowProxy::info())
+            return jsDynamicCast<JSRemoteDOMWindow*>(vm, jsCast<JSWindowProxy*>(object)->window());
         value = object->getPrototypeDirect(vm);
     }
     return nullptr;
index 8b1825f..64dfcd3 100644 (file)
 
 namespace WebCore {
 
-class JSDOMWindowProxy;
+class JSWindowProxy;
 class JSRemoteDOMWindow;
 
 class WEBCORE_EXPORT JSRemoteDOMWindowBase : public JSDOMGlobalObject {
 protected:
-    JSRemoteDOMWindowBase(JSC::VM&, JSC::Structure*, RefPtr<RemoteDOMWindow>&&, JSDOMWindowProxy*);
+    JSRemoteDOMWindowBase(JSC::VM&, JSC::Structure*, RefPtr<RemoteDOMWindow>&&, JSWindowProxy*);
 
     static void destroy(JSCell*);
 
@@ -27,7 +27,7 @@
  */
 
 #include "config.h"
-#include "JSDOMWindowProxy.h"
+#include "JSWindowProxy.h"
 
 #include "AbstractFrame.h"
 #include "CommonVM.h"
 #include "JSDOMWindow.h"
 #include "JSDOMWindowProperties.h"
 #include "JSEventTarget.h"
+#include "JSRemoteDOMWindow.h"
 #include "ScriptController.h"
+#include <JavaScriptCore/Debugger.h>
 #include <JavaScriptCore/JSObject.h>
 #include <JavaScriptCore/StrongInlines.h>
 
 namespace WebCore {
 
-const ClassInfo JSDOMWindowProxy::s_info = { "JSDOMWindowProxy", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDOMWindowProxy) };
+const ClassInfo JSWindowProxy::s_info = { "JSWindowProxy", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWindowProxy) };
 
-inline JSDOMWindowProxy::JSDOMWindowProxy(VM& vm, Structure& structure, DOMWrapperWorld& world)
+inline JSWindowProxy::JSWindowProxy(VM& vm, Structure& structure, DOMWrapperWorld& world)
     : Base(vm, &structure)
     , m_world(world)
 {
 }
 
-void JSDOMWindowProxy::finishCreation(VM& vm, AbstractDOMWindow& window)
+void JSWindowProxy::finishCreation(VM& vm, AbstractDOMWindow& window)
 {
     Base::finishCreation(vm);
     ASSERT(inherits(vm, info()));
     setWindow(window);
 }
 
-JSDOMWindowProxy& JSDOMWindowProxy::create(JSC::VM& vm, AbstractDOMWindow& window, DOMWrapperWorld& world)
+JSWindowProxy& JSWindowProxy::create(JSC::VM& vm, AbstractDOMWindow& window, DOMWrapperWorld& world)
 {
     auto& structure = *JSC::Structure::create(vm, 0, jsNull(), JSC::TypeInfo(JSC::PureForwardingProxyType, StructureFlags), info());
-    auto& proxy = *new (NotNull, JSC::allocateCell<JSDOMWindowProxy>(vm.heap)) JSDOMWindowProxy(vm, structure, world);
+    auto& proxy = *new (NotNull, JSC::allocateCell<JSWindowProxy>(vm.heap)) JSWindowProxy(vm, structure, world);
     proxy.finishCreation(vm, window);
     return proxy;
 }
 
-void JSDOMWindowProxy::destroy(JSCell* cell)
+void JSWindowProxy::destroy(JSCell* cell)
 {
-    static_cast<JSDOMWindowProxy*>(cell)->JSDOMWindowProxy::~JSDOMWindowProxy();
+    static_cast<JSWindowProxy*>(cell)->JSWindowProxy::~JSWindowProxy();
 }
 
-void JSDOMWindowProxy::setWindow(VM& vm, JSDOMGlobalObject& window)
+void JSWindowProxy::setWindow(VM& vm, JSDOMGlobalObject& window)
 {
     ASSERT(window.classInfo() == JSDOMWindow::info() || window.classInfo() == JSRemoteDOMWindow::info());
     setTarget(vm, &window);
@@ -77,9 +79,9 @@ void JSDOMWindowProxy::setWindow(VM& vm, JSDOMGlobalObject& window)
     GCController::singleton().garbageCollectSoon();
 }
 
-void JSDOMWindowProxy::setWindow(AbstractDOMWindow& domWindow)
+void JSWindowProxy::setWindow(AbstractDOMWindow& domWindow)
 {
-    // Replacing JSDOMWindow via telling JSDOMWindowProxy to use the same DOMWindow it already uses makes no sense,
+    // Replacing JSDOMWindow via telling JSWindowProxy to use the same DOMWindow it already uses makes no sense,
     // so we'd better never try to.
     ASSERT(!window() || &domWindow != &wrapped());
 
@@ -115,7 +117,7 @@ void JSDOMWindowProxy::setWindow(AbstractDOMWindow& domWindow)
     ASSERT(prototype->globalObject() == window);
 }
 
-void JSDOMWindowProxy::attachDebugger(JSC::Debugger* debugger)
+void JSWindowProxy::attachDebugger(JSC::Debugger* debugger)
 {
     auto* globalObject = window();
     JSLockHolder lock(globalObject->vm());
@@ -126,7 +128,7 @@ void JSDOMWindowProxy::attachDebugger(JSC::Debugger* debugger)
         currentDebugger->detach(globalObject, JSC::Debugger::TerminatingDebuggingSession);
 }
 
-AbstractDOMWindow& JSDOMWindowProxy::wrapped() const
+AbstractDOMWindow& JSWindowProxy::wrapped() const
 {
     auto* window = this->window();
     if (auto* jsWindow = jsDynamicCast<JSRemoteDOMWindowBase*>(window->vm(), window))
@@ -134,9 +136,9 @@ AbstractDOMWindow& JSDOMWindowProxy::wrapped() const
     return jsCast<JSDOMWindowBase*>(window)->wrapped();
 }
 
-AbstractDOMWindow* JSDOMWindowProxy::toWrapped(VM& vm, JSObject* value)
+AbstractDOMWindow* JSWindowProxy::toWrapped(VM& vm, JSObject* value)
 {
-    auto* wrapper = jsDynamicCast<JSDOMWindowProxy*>(vm, value);
+    auto* wrapper = jsDynamicCast<JSWindowProxy*>(vm, value);
     return wrapper ? &wrapper->wrapped() : nullptr;
 }
 
@@ -145,7 +147,7 @@ JSValue toJS(ExecState* state, WindowProxy& windowProxy)
     return &windowProxy.jsWindowProxy(currentWorld(*state));
 }
 
-JSDOMWindowProxy& toJSDOMWindowProxy(WindowProxy& windowProxy, DOMWrapperWorld& world)
+JSWindowProxy& toJSWindowProxy(WindowProxy& windowProxy, DOMWrapperWorld& world)
 {
     return windowProxy.jsWindowProxy(world);
 }
similarity index 83%
rename from Source/WebCore/bindings/js/JSDOMWindowProxy.h
rename to Source/WebCore/bindings/js/JSWindowProxy.h
index 829c92e..d81615b 100644 (file)
@@ -41,10 +41,10 @@ class AbstractDOMWindow;
 class AbstractFrame;
 class WindowProxy;
 
-class JSDOMWindowProxy final : public JSC::JSProxy {
+class JSWindowProxy final : public JSC::JSProxy {
     using Base = JSC::JSProxy;
 public:
-    static JSDOMWindowProxy& create(JSC::VM&, AbstractDOMWindow&, DOMWrapperWorld&);
+    static JSWindowProxy& create(JSC::VM&, AbstractDOMWindow&, DOMWrapperWorld&);
     static void destroy(JSCell*);
 
     DECLARE_INFO;
@@ -61,19 +61,19 @@ public:
     void attachDebugger(JSC::Debugger*);
 
 private:
-    JSDOMWindowProxy(JSC::VM&, JSC::Structure&, DOMWrapperWorld&);
+    JSWindowProxy(JSC::VM&, JSC::Structure&, DOMWrapperWorld&);
     void finishCreation(JSC::VM&, AbstractDOMWindow&);
 
     Ref<DOMWrapperWorld> m_world;
 };
 
-// JSDOMWindowProxy is a little odd in that it's not a traditional wrapper and has no back pointer.
+// JSWindowProxy is a little odd in that it's not a traditional wrapper and has no back pointer.
 // It is, however, strongly owned by AbstractFrame via its WindowProxy, so we can get one from a WindowProxy.
 JSC::JSValue toJS(JSC::ExecState*, WindowProxy&);
 inline JSC::JSValue toJS(JSC::ExecState* state, WindowProxy* windowProxy) { return windowProxy ? toJS(state, *windowProxy) : JSC::jsNull(); }
 
-JSDOMWindowProxy& toJSDOMWindowProxy(WindowProxy&, DOMWrapperWorld&);
-inline JSDOMWindowProxy* toJSDOMWindowProxy(WindowProxy* windowProxy, DOMWrapperWorld& world) { return windowProxy ? &toJSDOMWindowProxy(*windowProxy, world) : nullptr; }
+JSWindowProxy& toJSWindowProxy(WindowProxy&, DOMWrapperWorld&);
+inline JSWindowProxy* toJSWindowProxy(WindowProxy* windowProxy, DOMWrapperWorld& world) { return windowProxy ? &toJSWindowProxy(*windowProxy, world) : nullptr; }
 
 
 } // namespace WebCore
index 8387bb3..6e2e408 100644 (file)
@@ -240,7 +240,7 @@ void ScriptController::getAllWorlds(Vector<Ref<DOMWrapperWorld>>& worlds)
     static_cast<JSVMClientData*>(commonVM().clientData)->getAllWorlds(worlds);
 }
 
-void ScriptController::initScriptForWindowProxy(JSDOMWindowProxy& windowProxy)
+void ScriptController::initScriptForWindowProxy(JSWindowProxy& windowProxy)
 {
     auto& world = windowProxy.world();
 
index 2bfad2a..d6e5900 100644 (file)
@@ -22,7 +22,7 @@
 #pragma once
 
 #include "FrameLoaderTypes.h"
-#include "JSDOMWindowProxy.h"
+#include "JSWindowProxy.h"
 #include "WindowProxy.h"
 #include <JavaScriptCore/JSBase.h>
 #include <JavaScriptCore/Strong.h>
@@ -158,7 +158,7 @@ public:
     WEBCORE_EXPORT NPObject* windowScriptNPObject();
 #endif
 
-    void initScriptForWindowProxy(JSDOMWindowProxy&);
+    void initScriptForWindowProxy(JSWindowProxy&);
 
 private:
     void setupModuleScriptHandlers(LoadableModuleScript&, JSC::JSInternalPromise&, DOMWrapperWorld&);
index 9d7a634..d31dfdb 100644 (file)
@@ -72,26 +72,26 @@ void WindowProxy::destroyJSWindowProxy(DOMWrapperWorld& world)
     world.didDestroyWindowProxy(this);
 }
 
-JSDOMWindowProxy& WindowProxy::createJSWindowProxy(DOMWrapperWorld& world)
+JSWindowProxy& WindowProxy::createJSWindowProxy(DOMWrapperWorld& world)
 {
     ASSERT(!m_jsWindowProxies.contains(&world));
     ASSERT(m_frame.window());
 
     VM& vm = world.vm();
 
-    Strong<JSDOMWindowProxy> jsWindowProxy(vm, &JSDOMWindowProxy::create(vm, *m_frame.window(), world));
-    Strong<JSDOMWindowProxy> jsWindowProxy2(jsWindowProxy);
+    Strong<JSWindowProxy> jsWindowProxy(vm, &JSWindowProxy::create(vm, *m_frame.window(), world));
+    Strong<JSWindowProxy> jsWindowProxy2(jsWindowProxy);
     m_jsWindowProxies.add(&world, jsWindowProxy);
     world.didCreateWindowProxy(this);
     return *jsWindowProxy.get();
 }
 
-Vector<JSC::Strong<JSDOMWindowProxy>> WindowProxy::jsWindowProxiesAsVector() const
+Vector<JSC::Strong<JSWindowProxy>> WindowProxy::jsWindowProxiesAsVector() const
 {
     return copyToVector(m_jsWindowProxies.values());
 }
 
-JSDOMWindowProxy& WindowProxy::createJSWindowProxyWithInitializedScript(DOMWrapperWorld& world)
+JSWindowProxy& WindowProxy::createJSWindowProxyWithInitializedScript(DOMWrapperWorld& world)
 {
     JSLockHolder lock(world.vm());
     auto& windowProxy = createJSWindowProxy(world);
index 94e3729..fc3ec01 100644 (file)
@@ -20,7 +20,7 @@
 
 #pragma once
 
-#include "JSDOMWindowProxy.h"
+#include "JSWindowProxy.h"
 #include <JavaScriptCore/Strong.h>
 #include <wtf/HashMap.h>
 
@@ -35,7 +35,7 @@ class AbstractFrame;
 class WindowProxy {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    using ProxyMap = HashMap<RefPtr<DOMWrapperWorld>, JSC::Strong<JSDOMWindowProxy>>;
+    using ProxyMap = HashMap<RefPtr<DOMWrapperWorld>, JSC::Strong<JSWindowProxy>>;
 
     explicit WindowProxy(AbstractFrame&);
     ~WindowProxy();
@@ -43,12 +43,12 @@ public:
     void destroyJSWindowProxy(DOMWrapperWorld&);
 
     ProxyMap::ValuesConstIteratorRange jsWindowProxies() const { return m_jsWindowProxies.values(); }
-    Vector<JSC::Strong<JSDOMWindowProxy>> jsWindowProxiesAsVector() const;
+    Vector<JSC::Strong<JSWindowProxy>> jsWindowProxiesAsVector() const;
 
     ProxyMap releaseJSWindowProxies() { return std::exchange(m_jsWindowProxies, ProxyMap()); }
     void setJSWindowProxies(ProxyMap&& windowProxies) { m_jsWindowProxies = WTFMove(windowProxies); }
 
-    JSDOMWindowProxy& jsWindowProxy(DOMWrapperWorld& world)
+    JSWindowProxy& jsWindowProxy(DOMWrapperWorld& world)
     {
         auto it = m_jsWindowProxies.find(&world);
         if (it != m_jsWindowProxies.end())
@@ -57,7 +57,7 @@ public:
         return createJSWindowProxyWithInitializedScript(world);
     }
 
-    JSDOMWindowProxy* existingJSWindowProxy(DOMWrapperWorld& world) const
+    JSWindowProxy* existingJSWindowProxy(DOMWrapperWorld& world) const
     {
         auto it = m_jsWindowProxies.find(&world);
         return (it != m_jsWindowProxies.end()) ? it->value.get() : nullptr;
@@ -76,8 +76,8 @@ public:
     void attachDebugger(JSC::Debugger*); // Attaches/detaches in all worlds/window proxies.
 
 private:
-    JSDOMWindowProxy& createJSWindowProxy(DOMWrapperWorld&);
-    WEBCORE_EXPORT JSDOMWindowProxy& createJSWindowProxyWithInitializedScript(DOMWrapperWorld&);
+    JSWindowProxy& createJSWindowProxy(DOMWrapperWorld&);
+    WEBCORE_EXPORT JSWindowProxy& createJSWindowProxyWithInitializedScript(DOMWrapperWorld&);
 
     AbstractFrame& m_frame;
     ProxyMap m_jsWindowProxies;
index a09c70e..7ea3895 100644 (file)
@@ -422,7 +422,7 @@ sub AddToIncludesForIDLType
     }
 
     if ($type->name eq "WindowProxy") {
-        AddToIncludes("JSDOMWindowProxy.h", $includesRef, $conditional);
+        AddToIncludes("JSWindowProxy.h", $includesRef, $conditional);
         AddToIncludes("JSDOMConvertWindowProxy.h", $includesRef, $conditional);
         return;
     }
@@ -2514,7 +2514,7 @@ sub GenerateHeader
         }
     }
 
-    push(@headerContent, "class JSDOMWindowProxy;\n\n") if $interfaceName eq "DOMWindow" or $interfaceName eq "RemoteDOMWindow";
+    push(@headerContent, "class JSWindowProxy;\n\n") if $interfaceName eq "DOMWindow" or $interfaceName eq "RemoteDOMWindow";
 
     my $exportMacro = GetExportMacroForJSClass($interface);
 
@@ -2527,7 +2527,7 @@ sub GenerateHeader
     push(@headerContent, "    using DOMWrapped = $implType;\n") if $hasParent;
 
     if ($interfaceName eq "DOMWindow" || $interfaceName eq "RemoteDOMWindow") {
-        push(@headerContent, "    static $className* create(JSC::VM& vm, JSC::Structure* structure, Ref<$implType>&& impl, JSDOMWindowProxy* proxy)\n");
+        push(@headerContent, "    static $className* create(JSC::VM& vm, JSC::Structure* structure, Ref<$implType>&& impl, JSWindowProxy* proxy)\n");
         push(@headerContent, "    {\n");
         push(@headerContent, "        $className* ptr = new (NotNull, JSC::allocateCell<$className>(vm.heap)) ${className}(vm, structure, WTFMove(impl), proxy);\n");
         push(@headerContent, "        ptr->finishCreation(vm, proxy);\n");
@@ -2836,7 +2836,7 @@ sub GenerateHeader
 
     # Constructor
     if ($interfaceName eq "DOMWindow" || $interfaceName eq "RemoteDOMWindow") {
-        push(@headerContent, "    $className(JSC::VM&, JSC::Structure*, Ref<$implType>&&, JSDOMWindowProxy*);\n");
+        push(@headerContent, "    $className(JSC::VM&, JSC::Structure*, Ref<$implType>&&, JSWindowProxy*);\n");
     } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
         push(@headerContent, "    $className(JSC::VM&, JSC::Structure*, Ref<$implType>&&);\n");
     } elsif (!NeedsImplementationClass($interface)) {
@@ -2846,7 +2846,7 @@ sub GenerateHeader
     }
 
     if ($interfaceName eq "DOMWindow" || $interfaceName eq "RemoteDOMWindow") {
-        push(@headerContent, "    void finishCreation(JSC::VM&, JSDOMWindowProxy*);\n");
+        push(@headerContent, "    void finishCreation(JSC::VM&, JSWindowProxy*);\n");
     } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
         push(@headerContent, "    void finishCreation(JSC::VM&, JSC::JSProxy*);\n");
     } else {
@@ -2976,7 +2976,8 @@ sub GenerateHeader
 
     if (NeedsImplementationClass($interface)) {
         my $toWrappedType = $interface->type->name eq "XPathNSResolver" ? "RefPtr<${implType}>" : "${implType}*";
-    
+        $headerIncludes{"JSDOMWrapper.h"} = 1;
+
         push(@headerContent, "template<> struct JSDOMWrapperConverterTraits<${implType}> {\n");
         push(@headerContent, "    using WrapperClass = ${className};\n");
         push(@headerContent, "    using ToWrappedReturnType = ${toWrappedType};\n");
@@ -3405,11 +3406,11 @@ sub GenerateOverloadDispatcher
                 for my $subtype (@subtypes) {
                     if ($codeGenerator->IsWrapperType($subtype) || $codeGenerator->IsBufferSourceType($subtype)) {
                         if ($subtype->name eq "DOMWindow") {
-                            AddToImplIncludes("JSDOMWindowProxy.h");
-                            &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && (asObject(distinguishingArg)->inherits<JSDOMWindowProxy>(vm) || asObject(distinguishingArg)->inherits<JSDOMWindow>(vm))");
+                            AddToImplIncludes("JSWindowProxy.h");
+                            &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && (asObject(distinguishingArg)->inherits<JSWindowProxy>(vm) || asObject(distinguishingArg)->inherits<JSDOMWindow>(vm))");
                         } elsif ($subtype->name eq "RemoteDOMWindow") {
-                            AddToImplIncludes("JSDOMWindowProxy.h");
-                            &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && (asObject(distinguishingArg)->inherits<JSDOMWindowProxy>(vm) || asObject(distinguishingArg)->inherits<JSRemoteDOMWindow>(vm))");
+                            AddToImplIncludes("JSWindowProxy.h");
+                            &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && (asObject(distinguishingArg)->inherits<JSWindowProxy>(vm) || asObject(distinguishingArg)->inherits<JSRemoteDOMWindow>(vm))");
                         } else {
                             &$generateOverloadCallIfNecessary($overload, "distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JS" . $subtype->name . ">(vm)");
                         }
@@ -4220,8 +4221,8 @@ sub GenerateImplementation
 
     # Constructor
     if ($interfaceName eq "DOMWindow" || $interfaceName eq "RemoteDOMWindow") {
-        AddIncludesForImplementationTypeInImpl("JSDOMWindowProxy");
-        push(@implContent, "${className}::$className(VM& vm, Structure* structure, Ref<$implType>&& impl, JSDOMWindowProxy* proxy)\n");
+        AddIncludesForImplementationTypeInImpl("JSWindowProxy");
+        push(@implContent, "${className}::$className(VM& vm, Structure* structure, Ref<$implType>&& impl, JSWindowProxy* proxy)\n");
         push(@implContent, "    : $parentClassName(vm, structure, WTFMove(impl), proxy)\n");
         push(@implContent, "{\n");
         push(@implContent, "}\n\n");
@@ -4243,7 +4244,7 @@ sub GenerateImplementation
 
     # Finish Creation
     if ($interfaceName eq "DOMWindow" || $interfaceName eq "RemoteDOMWindow") {
-        push(@implContent, "void ${className}::finishCreation(VM& vm, JSDOMWindowProxy* proxy)\n");
+        push(@implContent, "void ${className}::finishCreation(VM& vm, JSWindowProxy* proxy)\n");
         push(@implContent, "{\n");
         push(@implContent, "    Base::finishCreation(vm, proxy);\n\n");
     } elsif ($codeGenerator->InheritsInterface($interface, "WorkerGlobalScope")) {
index 81329a4..0b781e6 100644 (file)
@@ -20,6 +20,7 @@
 
 #pragma once
 
+#include "JSDOMWrapper.h"
 #include "JSNode.h"
 #include "TestDOMJIT.h"
 #include <JavaScriptCore/DOMJITGetterSetter.h>
index 1cbb7ae..e104ced 100644 (file)
@@ -21,6 +21,7 @@
 #pragma once
 
 #include "JSDOMConvertDictionary.h"
+#include "JSDOMWrapper.h"
 #include "JSEvent.h"
 #include "TestEventConstructor.h"
 
index 0e36989..8f8d2c3 100644 (file)
@@ -20,6 +20,7 @@
 
 #pragma once
 
+#include "JSDOMWrapper.h"
 #include "JSNode.h"
 #include "TestNode.h"
 
index d5ff1c0..ba45bb9 100644 (file)
@@ -57,7 +57,6 @@
 #include "JSDOMStringList.h"
 #include "JSDOMWindow.h"
 #include "JSDOMWindowBase.h"
-#include "JSDOMWindowProxy.h"
 #include "JSDOMWrapperCache.h"
 #include "JSDocument.h"
 #include "JSElement.h"
@@ -74,6 +73,7 @@
 #include "JSTestStandaloneDictionary.h"
 #include "JSTestStandaloneEnumeration.h"
 #include "JSTestSubObj.h"
+#include "JSWindowProxy.h"
 #include "JSXPathNSResolver.h"
 #include "RuntimeEnabledFeatures.h"
 #include "ScriptExecutionContext.h"
@@ -7029,7 +7029,7 @@ static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionOverloadedMethodOver
             return jsTestObjPrototypeFunctionOverloadedMethod6Body(state, castedThis, throwScope);
         if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JSTestObj>(vm))
             return jsTestObjPrototypeFunctionOverloadedMethod8Body(state, castedThis, throwScope);
-        if (distinguishingArg.isObject() && (asObject(distinguishingArg)->inherits<JSDOMWindowProxy>(vm) || asObject(distinguishingArg)->inherits<JSDOMWindow>(vm)))
+        if (distinguishingArg.isObject() && (asObject(distinguishingArg)->inherits<JSWindowProxy>(vm) || asObject(distinguishingArg)->inherits<JSDOMWindow>(vm)))
             return jsTestObjPrototypeFunctionOverloadedMethod9Body(state, castedThis, throwScope);
         if (distinguishingArg.isObject() && asObject(distinguishingArg)->inherits<JSBlob>(vm))
             return jsTestObjPrototypeFunctionOverloadedMethod13Body(state, castedThis, throwScope);
index f158422..4426824 100644 (file)
@@ -21,6 +21,7 @@
 #pragma once
 
 #include "JSDOMConvertDictionary.h"
+#include "JSDOMWrapper.h"
 #include "JSEvent.h"
 #include "TestPromiseRejectionEvent.h"
 
index 2c6c0dd..a84265a 100644 (file)
@@ -67,7 +67,7 @@
 #include "HitTestResult.h"
 #include "ImageBuffer.h"
 #include "InspectorInstrumentation.h"
-#include "JSDOMWindowProxy.h"
+#include "JSWindowProxy.h"
 #include "Logging.h"
 #include "MathMLNames.h"
 #include "MediaFeatureNames.h"
index 0c2036f..fc2fd12 100644 (file)
@@ -41,8 +41,8 @@
 #include "Frame.h"
 #include "HTMLParserIdioms.h"
 #include "InspectorInstrumentation.h"
-#include "JSDOMWindowProxy.h"
 #include "JSMainThreadExecState.h"
+#include "JSWindowProxy.h"
 #include "ParsingUtilities.h"
 #include "PingLoader.h"
 #include "ResourceRequest.h"
@@ -145,7 +145,7 @@ bool ContentSecurityPolicy::allowRunningOrDisplayingInsecureContent(const URL& u
     return allow;
 }
 
-void ContentSecurityPolicy::didCreateWindowProxy(JSDOMWindowProxy& windowProxy) const
+void ContentSecurityPolicy::didCreateWindowProxy(JSWindowProxy& windowProxy) const
 {
     auto* window = windowProxy.window();
     ASSERT(window);
index d0e35bb..293d756 100644 (file)
@@ -51,7 +51,7 @@ class ContentSecurityPolicyDirectiveList;
 class ContentSecurityPolicySource;
 class DOMStringList;
 class Frame;
-class JSDOMWindowProxy;
+class JSWindowProxy;
 class ResourceRequest;
 class ScriptExecutionContext;
 class SecurityOrigin;
@@ -71,7 +71,7 @@ public:
     void copyStateFrom(const ContentSecurityPolicy*);
     void copyUpgradeInsecureRequestStateFrom(const ContentSecurityPolicy&);
 
-    void didCreateWindowProxy(JSDOMWindowProxy&) const;
+    void didCreateWindowProxy(JSWindowProxy&) const;
 
     enum class PolicyFrom {
         API,
index ddd9eff..619d9c6 100644 (file)
@@ -1,3 +1,15 @@
+2018-04-19  Chris Dumez  <cdumez@apple.com>
+
+        Rename JSDOMWindowProxy to JSWindowProxy
+        https://bugs.webkit.org/show_bug.cgi?id=184797
+
+        Reviewed by Sam Weinig.
+
+        Rename JSDOMWindowProxy to JSWindowProxy for consistency with WindowProxy.
+
+        * UserInterface/Workers/HeapSnapshot/HeapSnapshot.js:
+        (HeapSnapshot.prototype._isNodeGlobalObject):
+
 2018-04-19  David Kilzer  <ddkilzer@apple.com>
 
         Enable Objective-C weak references
index 1f2f7a1..a8f2c33 100644 (file)
@@ -709,7 +709,7 @@ HeapSnapshot = class HeapSnapshot
     {
         let className = this._nodeClassNamesTable[this._nodes[nodeIndex + nodeClassNameOffset]];
         return className === "Window"
-            || className === "JSDOMWindowProxy"
+            || className === "JSWindowProxy"
             || className === "GlobalObject";
     }
 
index 5aed0e5..b4e483c 100644 (file)
@@ -1,3 +1,17 @@
+2018-04-19  Chris Dumez  <cdumez@apple.com>
+
+        Rename JSDOMWindowProxy to JSWindowProxy
+        https://bugs.webkit.org/show_bug.cgi?id=184797
+
+        Reviewed by Sam Weinig.
+
+        Rename JSDOMWindowProxy to JSWindowProxy for consistency with WindowProxy.
+
+        * DOM/DOMUtility.mm:
+        (createDOMWrapper):
+        * WebView/WebFrame.mm:
+        (-[WebFrame _stringByEvaluatingJavaScriptFromString:withGlobalObject:inScriptWorld:]):
+
 2018-04-19  David Kilzer  <ddkilzer@apple.com>
 
         Enable Objective-C weak references
index 9791266..bb63543 100644 (file)
@@ -51,7 +51,6 @@
 #import <WebCore/JSCSSRuleList.h>
 #import <WebCore/JSCSSStyleDeclaration.h>
 #import <WebCore/JSDOMImplementation.h>
-#import <WebCore/JSDOMWindowProxy.h>
 #import <WebCore/JSDeprecatedCSSOMCounter.h>
 #import <WebCore/JSDeprecatedCSSOMRGBColor.h>
 #import <WebCore/JSDeprecatedCSSOMRect.h>
@@ -68,6 +67,7 @@
 #import <WebCore/JSStyleSheet.h>
 #import <WebCore/JSStyleSheetList.h>
 #import <WebCore/JSTreeWalker.h>
+#import <WebCore/JSWindowProxy.h>
 #import <WebCore/JSXPathExpression.h>
 #import <WebCore/JSXPathResult.h>
 #import <WebCore/WebScriptObjectPrivate.h>
@@ -85,7 +85,6 @@ static WebScriptObject *createDOMWrapper(JSC::JSObject& jsWrapper)
     WRAP(DeprecatedCSSOMValue)
     WRAP(DeprecatedCSSOMCounter)
     WRAP(DOMImplementation)
-    WRAP(DOMWindowProxy)
     WRAP(Event)
     WRAP(HTMLOptionsCollection)
     WRAP(MediaList)
@@ -99,6 +98,7 @@ static WebScriptObject *createDOMWrapper(JSC::JSObject& jsWrapper)
     WRAP(StyleSheet)
     WRAP(StyleSheetList)
     WRAP(TreeWalker)
+    WRAP(WindowProxy)
     WRAP(XPathExpression)
     WRAP(XPathResult)
 
index 033851c..fd92453 100644 (file)
@@ -2092,8 +2092,8 @@ static WebFrameLoadType toWebFrameLoadType(FrameLoadType frameLoadType)
     // The global object is probably a proxy object? - if so, we know how to use this!
     JSC::JSObject* globalObjectObj = toJS(globalObjectRef);
     JSC::VM& vm = *globalObjectObj->vm();
-    if (!strcmp(globalObjectObj->classInfo(vm)->className, "JSDOMWindowProxy"))
-        anyWorldGlobalObject = JSC::jsDynamicCast<JSDOMWindow*>(vm, static_cast<JSDOMWindowProxy*>(globalObjectObj)->window());
+    if (!strcmp(globalObjectObj->classInfo(vm)->className, "JSWindowProxy"))
+        anyWorldGlobalObject = JSC::jsDynamicCast<JSDOMWindow*>(vm, static_cast<JSWindowProxy*>(globalObjectObj)->window());
 
     if (!anyWorldGlobalObject)
         return @"";
index 580cbf6..ec020ba 100644 (file)
@@ -1,3 +1,15 @@
+2018-04-19  Chris Dumez  <cdumez@apple.com>
+
+        Rename JSDOMWindowProxy to JSWindowProxy
+        https://bugs.webkit.org/show_bug.cgi?id=184797
+
+        Reviewed by Sam Weinig.
+
+        Rename JSDOMWindowProxy to JSWindowProxy for consistency with WindowProxy.
+
+        * WebFrame.cpp:
+        (WebFrame::stringByEvaluatingJavaScriptInScriptWorld):
+
 2018-04-17  Jonathan Bedard  <jbedard@apple.com>
 
         Unreviewed rollout of r230632. Regression in memory usage.
index 682ad01..ab2f69e 100644 (file)
@@ -2003,8 +2003,8 @@ HRESULT WebFrame::stringByEvaluatingJavaScriptInScriptWorld(IWebScriptWorld* iWo
     // The global object is probably a proxy object? - if so, we know how to use this!
     JSC::JSObject* globalObjectObj = toJS(globalObjectRef);
     auto& vm = *globalObjectObj->vm();
-    if (globalObjectObj->inherits<JSDOMWindowProxy>(vm))
-        anyWorldGlobalObject = JSC::jsDynamicCast<JSDOMWindow*>(vm, static_cast<JSDOMWindowProxy*>(globalObjectObj)->window());
+    if (globalObjectObj->inherits<JSWindowProxy>(vm))
+        anyWorldGlobalObject = JSC::jsDynamicCast<JSDOMWindow*>(vm, static_cast<JSWindowProxy*>(globalObjectObj)->window());
 
     if (!anyWorldGlobalObject)
         return E_INVALIDARG;