Rename WindowProxyController to WindowProxy
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Apr 2018 04:02:30 +0000 (04:02 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 19 Apr 2018 04:02:30 +0000 (04:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=184756

Reviewed by Sam Weinig.

Rename WindowProxyController to WindowProxy for clarity. When the IDL uses WindowProxy, the implementation
needed use WindowProxyController type, which was a bit confusing.

Source/WebCore:

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMWrapperWorld.cpp:
(WebCore::DOMWrapperWorld::~DOMWrapperWorld):
(WebCore::DOMWrapperWorld::clearWrappers):
* bindings/js/DOMWrapperWorld.h:
(WebCore::DOMWrapperWorld::didCreateWindowProxy):
(WebCore::DOMWrapperWorld::didDestroyWindowProxy):
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::toJS):
* bindings/js/JSDOMWindowProxy.cpp:
(WebCore::toJS):
(WebCore::toJSDOMWindowProxy):
* bindings/js/JSDOMWindowProxy.h:
(WebCore::toJS):
(WebCore::toJSDOMWindowProxy):
* bindings/js/ScriptCachedFrameData.cpp:
(WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
(WebCore::ScriptCachedFrameData::restore):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::loadModuleScriptInWorld):
(WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
(WebCore::ScriptController::evaluateModule):
(WebCore::ScriptController::setupModuleScriptHandlers):
(WebCore::ScriptController::windowProxy):
(WebCore::ScriptController::enableEval):
(WebCore::ScriptController::enableWebAssembly):
(WebCore::ScriptController::disableEval):
(WebCore::ScriptController::disableWebAssembly):
(WebCore::ScriptController::updateDocument):
(WebCore::ScriptController::collectIsolatedContexts):
(WebCore::ScriptController::windowScriptNPObject):
(WebCore::ScriptController::executeIfJavaScriptURL):
* bindings/js/ScriptController.h:
(WebCore::ScriptController::globalObject):
* bindings/js/ScriptControllerMac.mm:
(WebCore::ScriptController::windowScriptObject):
* bindings/js/ScriptState.cpp:
(WebCore::mainWorldExecState):
* bindings/js/WindowProxy.cpp: Renamed from Source/WebCore/bindings/js/WindowProxyController.cpp.
(WebCore::WindowProxy::WindowProxy):
(WebCore::WindowProxy::~WindowProxy):
(WebCore::WindowProxy::destroyJSWindowProxy):
(WebCore::WindowProxy::createJSWindowProxy):
(WebCore::WindowProxy::jsWindowProxiesAsVector const):
(WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
(WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
(WebCore::WindowProxy::setDOMWindow):
(WebCore::WindowProxy::attachDebugger):
* bindings/js/WindowProxy.h: Renamed from Source/WebCore/bindings/js/WindowProxyController.h.
(WebCore::WindowProxy::jsWindowProxies const):
(WebCore::WindowProxy::releaseJSWindowProxies):
(WebCore::WindowProxy::setJSWindowProxies):
(WebCore::WindowProxy::jsWindowProxy):
(WebCore::WindowProxy::existingJSWindowProxy const):
(WebCore::WindowProxy::globalObject):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::clear):
(WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
* page/AbstractFrame.cpp:
(WebCore::AbstractFrame::AbstractFrame):
* page/AbstractFrame.h:
(WebCore::AbstractFrame::windowProxy):
(WebCore::AbstractFrame::windowProxy const):
* page/Page.cpp:
(WebCore::Page::setDebugger):
* page/RemoteDOMWindow.cpp:
(WebCore::RemoteDOMWindow::self const):
(WebCore::RemoteDOMWindow::top const):
(WebCore::RemoteDOMWindow::opener const):
(WebCore::RemoteDOMWindow::parent const):
* page/RemoteDOMWindow.h:

Source/WebKit:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::windowScriptNPObject):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::frameBecameRemote):

Source/WebKitLegacy/mac:

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
* WebView/WebFrame.mm:
(-[WebFrame _attachScriptDebugger]):

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

28 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/DOMWrapperWorld.cpp
Source/WebCore/bindings/js/DOMWrapperWorld.h
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSDOMWindowBase.cpp
Source/WebCore/bindings/js/JSDOMWindowProxy.cpp
Source/WebCore/bindings/js/JSDOMWindowProxy.h
Source/WebCore/bindings/js/ScriptCachedFrameData.cpp
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/js/ScriptController.h
Source/WebCore/bindings/js/ScriptControllerMac.mm
Source/WebCore/bindings/js/ScriptState.cpp
Source/WebCore/bindings/js/WindowProxy.cpp [moved from Source/WebCore/bindings/js/WindowProxyController.cpp with 71% similarity]
Source/WebCore/bindings/js/WindowProxy.h [moved from Source/WebCore/bindings/js/WindowProxyController.h with 54% similarity]
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/page/AbstractFrame.cpp
Source/WebCore/page/AbstractFrame.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/RemoteDOMWindow.cpp
Source/WebCore/page/RemoteDOMWindow.h
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/Plugins/PluginView.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Source/WebKitLegacy/mac/WebView/WebFrame.mm

index 8c0bc87..d212b27 100644 (file)
@@ -1,5 +1,90 @@
 2018-04-18  Chris Dumez  <cdumez@apple.com>
 
+        Rename WindowProxyController to WindowProxy
+        https://bugs.webkit.org/show_bug.cgi?id=184756
+
+        Reviewed by Sam Weinig.
+
+        Rename WindowProxyController to WindowProxy for clarity. When the IDL uses WindowProxy, the implementation
+        needed use WindowProxyController type, which was a bit confusing.
+
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/DOMWrapperWorld.cpp:
+        (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
+        (WebCore::DOMWrapperWorld::clearWrappers):
+        * bindings/js/DOMWrapperWorld.h:
+        (WebCore::DOMWrapperWorld::didCreateWindowProxy):
+        (WebCore::DOMWrapperWorld::didDestroyWindowProxy):
+        * bindings/js/JSBindingsAllInOne.cpp:
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::toJS):
+        * bindings/js/JSDOMWindowProxy.cpp:
+        (WebCore::toJS):
+        (WebCore::toJSDOMWindowProxy):
+        * bindings/js/JSDOMWindowProxy.h:
+        (WebCore::toJS):
+        (WebCore::toJSDOMWindowProxy):
+        * bindings/js/ScriptCachedFrameData.cpp:
+        (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
+        (WebCore::ScriptCachedFrameData::restore):
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::evaluateInWorld):
+        (WebCore::ScriptController::loadModuleScriptInWorld):
+        (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
+        (WebCore::ScriptController::evaluateModule):
+        (WebCore::ScriptController::setupModuleScriptHandlers):
+        (WebCore::ScriptController::windowProxy):
+        (WebCore::ScriptController::enableEval):
+        (WebCore::ScriptController::enableWebAssembly):
+        (WebCore::ScriptController::disableEval):
+        (WebCore::ScriptController::disableWebAssembly):
+        (WebCore::ScriptController::updateDocument):
+        (WebCore::ScriptController::collectIsolatedContexts):
+        (WebCore::ScriptController::windowScriptNPObject):
+        (WebCore::ScriptController::executeIfJavaScriptURL):
+        * bindings/js/ScriptController.h:
+        (WebCore::ScriptController::globalObject):
+        * bindings/js/ScriptControllerMac.mm:
+        (WebCore::ScriptController::windowScriptObject):
+        * bindings/js/ScriptState.cpp:
+        (WebCore::mainWorldExecState):
+        * bindings/js/WindowProxy.cpp: Renamed from Source/WebCore/bindings/js/WindowProxyController.cpp.
+        (WebCore::WindowProxy::WindowProxy):
+        (WebCore::WindowProxy::~WindowProxy):
+        (WebCore::WindowProxy::destroyJSWindowProxy):
+        (WebCore::WindowProxy::createJSWindowProxy):
+        (WebCore::WindowProxy::jsWindowProxiesAsVector const):
+        (WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
+        (WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
+        (WebCore::WindowProxy::setDOMWindow):
+        (WebCore::WindowProxy::attachDebugger):
+        * bindings/js/WindowProxy.h: Renamed from Source/WebCore/bindings/js/WindowProxyController.h.
+        (WebCore::WindowProxy::jsWindowProxies const):
+        (WebCore::WindowProxy::releaseJSWindowProxies):
+        (WebCore::WindowProxy::setJSWindowProxies):
+        (WebCore::WindowProxy::jsWindowProxy):
+        (WebCore::WindowProxy::existingJSWindowProxy const):
+        (WebCore::WindowProxy::globalObject):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::clear):
+        (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
+        * page/AbstractFrame.cpp:
+        (WebCore::AbstractFrame::AbstractFrame):
+        * page/AbstractFrame.h:
+        (WebCore::AbstractFrame::windowProxy):
+        (WebCore::AbstractFrame::windowProxy const):
+        * page/Page.cpp:
+        (WebCore::Page::setDebugger):
+        * page/RemoteDOMWindow.cpp:
+        (WebCore::RemoteDOMWindow::self const):
+        (WebCore::RemoteDOMWindow::top const):
+        (WebCore::RemoteDOMWindow::opener const):
+        (WebCore::RemoteDOMWindow::parent const):
+        * page/RemoteDOMWindow.h:
+
+2018-04-18  Chris Dumez  <cdumez@apple.com>
+
         Set RemoteDOMWindow's initial opener
         https://bugs.webkit.org/show_bug.cgi?id=184716
 
index 12650d6..3f8f998 100644 (file)
@@ -470,7 +470,7 @@ bindings/js/StructuredClone.cpp
 bindings/js/SerializedScriptValue.cpp
 bindings/js/WebCoreJSClientData.cpp
 bindings/js/WebCoreTypedArrayController.cpp
-bindings/js/WindowProxyController.cpp
+bindings/js/WindowProxy.cpp
 bindings/js/WorkerScriptController.cpp
 
 bridge/IdentifierRep.cpp
index 01dcd3e..6662e67 100644 (file)
                460BB6161D0A1BF000221812 /* Base64Utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 460BB6141D0A1BEC00221812 /* Base64Utilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
                460CBF361D4BCD0E0092E88E /* JSDOMWindowProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 460CBF341D4BCCFE0092E88E /* JSDOMWindowProperties.h */; };
                46218ACB1F72D64E00574FBE /* DOMHighResTimeStamp.h in Headers */ = {isa = PBXBuildFile; fileRef = 46E016AD1F72D61E00282B2C /* DOMHighResTimeStamp.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               463521AD2081092A00C28922 /* WindowProxyController.h in Headers */ = {isa = PBXBuildFile; fileRef = 463521AA2081090B00C28922 /* WindowProxyController.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               463521AD2081092A00C28922 /* WindowProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 463521AA2081090B00C28922 /* WindowProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
                463EB6231B8789E00096ED51 /* TagCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 463EB6211B8789CB0096ED51 /* TagCollection.h */; };
                465307D01DB6EE4800E4137C /* JSUIEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E045EF1DAA104F00B0D8B9 /* JSUIEventInit.h */; };
                46658DC91FA24B8700F7DD54 /* SWContextManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 4672413B1FA24B140088BD6D /* SWContextManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
                460CBF341D4BCCFE0092E88E /* JSDOMWindowProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMWindowProperties.h; sourceTree = "<group>"; };
                460D19441FCE21DD00C3DB85 /* JSServiceWorkerGlobalScopeCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerGlobalScopeCustom.cpp; sourceTree = "<group>"; };
                4634592B1AC2271000ECB71C /* PowerObserverMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PowerObserverMac.cpp; sourceTree = "<group>"; };
-               463521AA2081090B00C28922 /* WindowProxyController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowProxyController.h; sourceTree = "<group>"; };
-               463521AC2081090E00C28922 /* WindowProxyController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowProxyController.cpp; sourceTree = "<group>"; };
+               463521AA2081090B00C28922 /* WindowProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowProxy.h; sourceTree = "<group>"; };
+               463521AC2081090E00C28922 /* WindowProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowProxy.cpp; sourceTree = "<group>"; };
                463EB6201B8789CB0096ED51 /* TagCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TagCollection.cpp; sourceTree = "<group>"; };
                463EB6211B8789CB0096ED51 /* TagCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TagCollection.h; sourceTree = "<group>"; };
                465A8E781C8A24CE00E7D3E4 /* RuntimeApplicationChecksCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RuntimeApplicationChecksCocoa.mm; sourceTree = "<group>"; };
                                BC53D910114310CC000D817E /* WebCoreJSClientData.h */,
                                0F099D0617B968A100FF84B9 /* WebCoreTypedArrayController.cpp */,
                                0F099D0717B968A100FF84B9 /* WebCoreTypedArrayController.h */,
-                               463521AC2081090E00C28922 /* WindowProxyController.cpp */,
-                               463521AA2081090B00C28922 /* WindowProxyController.h */,
+                               463521AC2081090E00C28922 /* WindowProxy.cpp */,
+                               463521AA2081090B00C28922 /* WindowProxy.h */,
                                E1A643FC0EC097A000779668 /* WorkerScriptController.cpp */,
                                E1A643F10EC0972500779668 /* WorkerScriptController.h */,
                        );
                                0F15ED5C1B7EC7C500EDDFEB /* WillChangeData.h in Headers */,
                                BC8243E90D0CFD7500460C8F /* WindowFeatures.h in Headers */,
                                7E99AF530B13846468FB01A5 /* WindowFocusAllowedIndicator.h in Headers */,
-                               463521AD2081092A00C28922 /* WindowProxyController.h in Headers */,
+                               463521AD2081092A00C28922 /* WindowProxy.h in Headers */,
                                E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */,
                                501BAAA913950E2C00F7ACEB /* WindRule.h in Headers */,
                                A14832BE187F64CC00DA63A6 /* WKContentObservation.h in Headers */,
index c03e309..abb5191 100644 (file)
@@ -24,7 +24,7 @@
 #include "CommonVM.h"
 #include "JSDOMWindow.h"
 #include "WebCoreJSClientData.h"
-#include "WindowProxyController.h"
+#include "WindowProxy.h"
 #include <wtf/MainThread.h>
 
 
@@ -47,8 +47,8 @@ DOMWrapperWorld::~DOMWrapperWorld()
     static_cast<JSVMClientData*>(clientData)->forgetWorld(*this);
 
     // These items are created lazily.
-    while (!m_windowProxyControllers.isEmpty())
-        (*m_windowProxyControllers.begin())->destroyWindowProxy(*this);
+    while (!m_jsWindowProxies.isEmpty())
+        (*m_jsWindowProxies.begin())->destroyJSWindowProxy(*this);
 }
 
 void DOMWrapperWorld::clearWrappers()
@@ -56,8 +56,8 @@ void DOMWrapperWorld::clearWrappers()
     m_wrappers.clear();
 
     // These items are created lazily.
-    while (!m_windowProxyControllers.isEmpty())
-        (*m_windowProxyControllers.begin())->destroyWindowProxy(*this);
+    while (!m_jsWindowProxies.isEmpty())
+        (*m_jsWindowProxies.begin())->destroyJSWindowProxy(*this);
 }
 
 DOMWrapperWorld& normalWorld(JSC::VM& vm)
index 3c62aa9..cbd7e6e 100644 (file)
@@ -26,7 +26,7 @@
 
 namespace WebCore {
 
-class WindowProxyController;
+class WindowProxy;
 
 typedef HashMap<void*, JSC::Weak<JSC::JSObject>> DOMObjectWrapperMap;
 
@@ -41,8 +41,8 @@ public:
     // Free as much memory held onto by this world as possible.
     WEBCORE_EXPORT void clearWrappers();
 
-    void didCreateWindowProxy(WindowProxyController* controller) { m_windowProxyControllers.add(controller); }
-    void didDestroyWindowProxy(WindowProxyController* controller) { m_windowProxyControllers.remove(controller); }
+    void didCreateWindowProxy(WindowProxy* controller) { m_jsWindowProxies.add(controller); }
+    void didDestroyWindowProxy(WindowProxy* controller) { m_jsWindowProxies.remove(controller); }
 
     void setShadowRootIsAlwaysOpen() { m_shadowRootIsAlwaysOpen = true; }
     bool shadowRootIsAlwaysOpen() const { return m_shadowRootIsAlwaysOpen; }
@@ -61,7 +61,7 @@ protected:
 
 private:
     JSC::VM& m_vm;
-    HashSet<WindowProxyController*> m_windowProxyControllers;
+    HashSet<WindowProxy*> m_jsWindowProxies;
     DOMObjectWrapperMap m_wrappers;
 
     bool m_isNormal;
index a85cde1..0830bcf 100644 (file)
 #include "ScriptState.cpp"
 #include "SerializedScriptValue.cpp"
 #include "WebCoreTypedArrayController.cpp"
-#include "WindowProxyController.cpp"
+#include "WindowProxy.cpp"
 #include "WorkerScriptController.cpp"
index be4be15..589c940 100644 (file)
@@ -253,7 +253,7 @@ JSValue toJS(ExecState* state, DOMWindow& domWindow)
     auto* frame = domWindow.frame();
     if (!frame)
         return jsNull();
-    return toJS(state, frame->windowProxyController());
+    return toJS(state, frame->windowProxy());
 }
 
 JSDOMWindow* toJSDOMWindow(Frame& frame, DOMWrapperWorld& world)
index 9372dc9..5898273 100644 (file)
@@ -140,14 +140,14 @@ AbstractDOMWindow* JSDOMWindowProxy::toWrapped(VM& vm, JSObject* value)
     return wrapper ? &wrapper->wrapped() : nullptr;
 }
 
-JSValue toJS(ExecState* state, WindowProxyController& windowProxyController)
+JSValue toJS(ExecState* state, WindowProxy& windowProxy)
 {
-    return &windowProxyController.windowProxy(currentWorld(*state));
+    return &windowProxy.jsWindowProxy(currentWorld(*state));
 }
 
-JSDOMWindowProxy& toJSDOMWindowProxy(WindowProxyController& windowProxyController, DOMWrapperWorld& world)
+JSDOMWindowProxy& toJSDOMWindowProxy(WindowProxy& windowProxy, DOMWrapperWorld& world)
 {
-    return windowProxyController.windowProxy(world);
+    return windowProxy.jsWindowProxy(world);
 }
 
 } // namespace WebCore
index 3ddd05b..829c92e 100644 (file)
@@ -39,7 +39,7 @@ namespace WebCore {
 
 class AbstractDOMWindow;
 class AbstractFrame;
-class WindowProxyController;
+class WindowProxy;
 
 class JSDOMWindowProxy final : public JSC::JSProxy {
     using Base = JSC::JSProxy;
@@ -68,12 +68,12 @@ private:
 };
 
 // JSDOMWindowProxy 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 WindowProxyController, so we can get one from a WindowProxyController.
-JSC::JSValue toJS(JSC::ExecState*, WindowProxyController&);
-inline JSC::JSValue toJS(JSC::ExecState* state, WindowProxyController* windowProxyController) { return windowProxyController ? toJS(state, *windowProxyController) : JSC::jsNull(); }
+// 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(WindowProxyController&, DOMWrapperWorld&);
-inline JSDOMWindowProxy* toJSDOMWindowProxy(WindowProxyController* windowProxyController, DOMWrapperWorld& world) { return windowProxyController ? &toJSDOMWindowProxy(*windowProxyController, world) : nullptr; }
+JSDOMWindowProxy& toJSDOMWindowProxy(WindowProxy&, DOMWrapperWorld&);
+inline JSDOMWindowProxy* toJSDOMWindowProxy(WindowProxy* windowProxy, DOMWrapperWorld& world) { return windowProxy ? &toJSDOMWindowProxy(*windowProxy, world) : nullptr; }
 
 
 } // namespace WebCore
index 4a7c988..e4eadfd 100644 (file)
@@ -51,13 +51,13 @@ ScriptCachedFrameData::ScriptCachedFrameData(Frame& frame)
 {
     JSLockHolder lock(commonVM());
 
-    for (auto windowProxy : frame.windowProxyController().windowProxiesAsVector()) {
+    for (auto windowProxy : frame.windowProxy().jsWindowProxiesAsVector()) {
         auto* window = jsCast<JSDOMWindow*>(windowProxy->window());
         m_windows.add(&windowProxy->world(), Strong<JSDOMWindow>(window->vm(), window));
         window->setConsoleClient(nullptr);
     }
 
-    frame.windowProxyController().attachDebugger(nullptr);
+    frame.windowProxy().attachDebugger(nullptr);
 }
 
 ScriptCachedFrameData::~ScriptCachedFrameData()
@@ -71,7 +71,7 @@ void ScriptCachedFrameData::restore(Frame& frame)
 
     Page* page = frame.page();
 
-    for (auto windowProxy : frame.windowProxyController().windowProxiesAsVector()) {
+    for (auto windowProxy : frame.windowProxy().jsWindowProxiesAsVector()) {
         auto* world = &windowProxy->world();
 
         if (auto* window = m_windows.get(world).get())
index ef65c9d..5f34caf 100644 (file)
@@ -117,7 +117,7 @@ JSValue ScriptController::evaluateInWorld(const ScriptSourceCode& sourceCode, DO
     // and false for <script>doSomething()</script>. Check if it has the
     // expected value in all cases.
     // See smart window.open policy for where this is used.
-    auto& proxy = windowProxyController().windowProxy(world);
+    auto& proxy = windowProxy().jsWindowProxy(world);
     auto& exec = *proxy.window()->globalExec();
     const String* savedSourceURL = m_sourceURL;
     m_sourceURL = &sourceURL;
@@ -150,7 +150,7 @@ void ScriptController::loadModuleScriptInWorld(LoadableModuleScript& moduleScrip
 {
     JSLockHolder lock(world.vm());
 
-    auto& proxy = windowProxyController().windowProxy(world);
+    auto& proxy = windowProxy().jsWindowProxy(world);
     auto& state = *proxy.window()->globalExec();
 
     auto& promise = JSMainThreadExecState::loadModule(state, moduleName, JSC::JSScriptFetchParameters::create(state.vm(), WTFMove(topLevelFetchParameters)), JSC::JSScriptFetcher::create(state.vm(), { &moduleScript }));
@@ -166,7 +166,7 @@ void ScriptController::loadModuleScriptInWorld(LoadableModuleScript& moduleScrip
 {
     JSLockHolder lock(world.vm());
 
-    auto& proxy = windowProxyController().windowProxy(world);
+    auto& proxy = windowProxy().jsWindowProxy(world);
     auto& state = *proxy.window()->globalExec();
 
     auto& promise = JSMainThreadExecState::loadModule(state, sourceCode.jsSourceCode(), JSC::JSScriptFetcher::create(state.vm(), { &moduleScript }));
@@ -182,7 +182,7 @@ JSC::JSValue ScriptController::linkAndEvaluateModuleScriptInWorld(LoadableModule
 {
     JSLockHolder lock(world.vm());
 
-    auto& proxy = windowProxyController().windowProxy(world);
+    auto& proxy = windowProxy().jsWindowProxy(world);
     auto& state = *proxy.window()->globalExec();
 
     // FIXME: Preventing Frame from being destroyed is essentially unnecessary.
@@ -211,7 +211,7 @@ JSC::JSValue ScriptController::evaluateModule(const URL& sourceURL, JSModuleReco
 
     const auto& jsSourceCode = moduleRecord.sourceCode();
 
-    auto& proxy = windowProxyController().windowProxy(world);
+    auto& proxy = windowProxy().jsWindowProxy(world);
     auto& state = *proxy.window()->globalExec();
     SetForScope<const String*> sourceURLScope(m_sourceURL, &sourceURL.string());
 
@@ -268,7 +268,7 @@ static Identifier jsValueToModuleKey(ExecState* exec, JSValue value)
 
 void ScriptController::setupModuleScriptHandlers(LoadableModuleScript& moduleScriptRef, JSInternalPromise& promise, DOMWrapperWorld& world)
 {
-    auto& proxy = windowProxyController().windowProxy(world);
+    auto& proxy = windowProxy().jsWindowProxy(world);
     auto& state = *proxy.window()->globalExec();
 
     // It is not guaranteed that either fulfillHandler or rejectHandler is eventually called.
@@ -320,9 +320,9 @@ void ScriptController::setupModuleScriptHandlers(LoadableModuleScript& moduleScr
     promise.then(&state, &fulfillHandler, &rejectHandler);
 }
 
-WindowProxyController& ScriptController::windowProxyController()
+WindowProxy& ScriptController::windowProxy()
 {
-    return m_frame.windowProxyController();
+    return m_frame.windowProxy();
 }
 
 TextPosition ScriptController::eventHandlerPosition() const
@@ -340,34 +340,34 @@ TextPosition ScriptController::eventHandlerPosition() const
 
 void ScriptController::enableEval()
 {
-    auto* windowProxy = windowProxyController().existingWindowProxy(mainThreadNormalWorld());
-    if (!windowProxy)
+    auto* jsWindowProxy = windowProxy().existingJSWindowProxy(mainThreadNormalWorld());
+    if (!jsWindowProxy)
         return;
-    windowProxy->window()->setEvalEnabled(true);
+    jsWindowProxy->window()->setEvalEnabled(true);
 }
 
 void ScriptController::enableWebAssembly()
 {
-    auto* windowProxy = windowProxyController().existingWindowProxy(mainThreadNormalWorld());
-    if (!windowProxy)
+    auto* jsWindowProxy = windowProxy().existingJSWindowProxy(mainThreadNormalWorld());
+    if (!jsWindowProxy)
         return;
-    windowProxy->window()->setWebAssemblyEnabled(true);
+    jsWindowProxy->window()->setWebAssemblyEnabled(true);
 }
 
 void ScriptController::disableEval(const String& errorMessage)
 {
-    auto* windowProxy = windowProxyController().existingWindowProxy(mainThreadNormalWorld());
-    if (!windowProxy)
+    auto* jsWindowProxy = windowProxy().existingJSWindowProxy(mainThreadNormalWorld());
+    if (!jsWindowProxy)
         return;
-    windowProxy->window()->setEvalEnabled(false, errorMessage);
+    jsWindowProxy->window()->setEvalEnabled(false, errorMessage);
 }
 
 void ScriptController::disableWebAssembly(const String& errorMessage)
 {
-    auto* windowProxy = windowProxyController().existingWindowProxy(mainThreadNormalWorld());
-    if (!windowProxy)
+    auto* jsWindowProxy = windowProxy().existingJSWindowProxy(mainThreadNormalWorld());
+    if (!jsWindowProxy)
         return;
-    windowProxy->window()->setWebAssemblyEnabled(false, errorMessage);
+    jsWindowProxy->window()->setWebAssemblyEnabled(false, errorMessage);
 }
 
 bool ScriptController::canAccessFromCurrentOrigin(Frame* frame)
@@ -383,7 +383,7 @@ bool ScriptController::canAccessFromCurrentOrigin(Frame* frame)
 
 void ScriptController::updateDocument()
 {
-    for (auto& windowProxy : windowProxyController().windowProxiesAsVector()) {
+    for (auto& windowProxy : windowProxy().jsWindowProxiesAsVector()) {
         JSLockHolder lock(windowProxy->world().vm());
         jsCast<JSDOMWindow*>(windowProxy->window())->updateDocument();
     }
@@ -427,7 +427,7 @@ Ref<Bindings::RootObject> ScriptController::createRootObject(void* nativeHandle)
 
 void ScriptController::collectIsolatedContexts(Vector<std::pair<JSC::ExecState*, SecurityOrigin*>>& result)
 {
-    for (auto& windowProxy : windowProxyController().windowProxiesAsVector()) {
+    for (auto& windowProxy : windowProxy().jsWindowProxiesAsVector()) {
         auto* exec = windowProxy->window()->globalExec();
         auto* origin = &downcast<DOMWindow>(windowProxy->wrapped()).document()->securityOrigin();
         result.append(std::make_pair(exec, origin));
@@ -442,7 +442,7 @@ NPObject* ScriptController::windowScriptNPObject()
         if (canExecuteScripts(NotAboutToExecuteScript)) {
             // JavaScript is enabled, so there is a JavaScript window object.
             // Return an NPObject bound to the window object.
-            auto* window = windowProxyController().windowProxy(pluginWorld()).window();
+            auto* window = windowProxy().jsWindowProxy(pluginWorld()).window();
             ASSERT(window);
             Bindings::RootObject* root = bindingRootObject();
             m_windowScriptNPObject = _NPN_CreateScriptObject(0, window, root);
@@ -603,7 +603,7 @@ bool ScriptController::executeIfJavaScriptURL(const URL& url, ShouldReplaceDocum
         return true;
 
     String scriptResult;
-    if (!result || !result.getString(windowProxyController().windowProxy(mainThreadNormalWorld()).window()->globalExec(), scriptResult))
+    if (!result || !result.getString(windowProxy().jsWindowProxy(mainThreadNormalWorld()).window()->globalExec(), scriptResult))
         return true;
 
     // FIXME: We should always replace the document, but doing so
index ac9d2d0..2bfad2a 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "FrameLoaderTypes.h"
 #include "JSDOMWindowProxy.h"
-#include "WindowProxyController.h"
+#include "WindowProxy.h"
 #include <JavaScriptCore/JSBase.h>
 #include <JavaScriptCore/Strong.h>
 #include <wtf/Forward.h>
@@ -83,7 +83,7 @@ public:
 
     JSDOMWindow* globalObject(DOMWrapperWorld& world)
     {
-        return JSC::jsCast<JSDOMWindow*>(windowProxyController().windowProxy(world).window());
+        return JSC::jsCast<JSDOMWindow*>(windowProxy().jsWindowProxy(world).window());
     }
 
     static void getAllWorlds(Vector<Ref<DOMWrapperWorld>>&);
@@ -165,7 +165,7 @@ private:
 
     void disconnectPlatformScriptObjects();
 
-    WEBCORE_EXPORT WindowProxyController& windowProxyController();
+    WEBCORE_EXPORT WindowProxy& windowProxy();
 
     Frame& m_frame;
     const String* m_sourceURL;
index b26e177..3ec4165 100644 (file)
@@ -103,7 +103,7 @@ WebScriptObject *ScriptController::windowScriptObject()
     if (!m_windowScriptObject) {
         JSC::JSLockHolder lock(commonVM());
         JSC::Bindings::RootObject* root = bindingRootObject();
-        m_windowScriptObject = [WebScriptObject scriptObjectForJSObject:toRef(&windowProxyController().windowProxy(pluginWorld())) originRootObject:root rootObject:root];
+        m_windowScriptObject = [WebScriptObject scriptObjectForJSObject:toRef(&windowProxy().jsWindowProxy(pluginWorld())) originRootObject:root rootObject:root];
     }
 
     return m_windowScriptObject.get();
index 865b1e1..31b6e78 100644 (file)
@@ -75,7 +75,7 @@ JSC::ExecState* mainWorldExecState(Frame* frame)
 {
     if (!frame)
         return nullptr;
-    return frame->windowProxyController().windowProxy(mainThreadNormalWorld()).window()->globalExec();
+    return frame->windowProxy().jsWindowProxy(mainThreadNormalWorld()).window()->globalExec();
 }
 
 JSC::ExecState* execStateFromNode(DOMWrapperWorld& world, Node* node)
@@ -19,7 +19,7 @@
  */
 
 #include "config.h"
-#include "WindowProxyController.h"
+#include "WindowProxy.h"
 
 #include "CommonVM.h"
 #include "Frame.h"
@@ -47,67 +47,67 @@ static void collectGarbageAfterWindowProxyDestruction()
         GCController::singleton().garbageCollectSoon();
 }
 
-WindowProxyController::WindowProxyController(AbstractFrame& frame)
+WindowProxy::WindowProxy(AbstractFrame& frame)
     : m_frame(frame)
 {
 }
 
-WindowProxyController::~WindowProxyController()
+WindowProxy::~WindowProxy()
 {
     // It's likely that destroying windowProxies will create a lot of garbage.
-    if (!m_windowProxies.isEmpty()) {
-        while (!m_windowProxies.isEmpty()) {
-            auto it = m_windowProxies.begin();
+    if (!m_jsWindowProxies.isEmpty()) {
+        while (!m_jsWindowProxies.isEmpty()) {
+            auto it = m_jsWindowProxies.begin();
             it->value->window()->setConsoleClient(nullptr);
-            destroyWindowProxy(*it->key);
+            destroyJSWindowProxy(*it->key);
         }
         collectGarbageAfterWindowProxyDestruction();
     }
 }
 
-void WindowProxyController::destroyWindowProxy(DOMWrapperWorld& world)
+void WindowProxy::destroyJSWindowProxy(DOMWrapperWorld& world)
 {
-    ASSERT(m_windowProxies.contains(&world));
-    m_windowProxies.remove(&world);
+    ASSERT(m_jsWindowProxies.contains(&world));
+    m_jsWindowProxies.remove(&world);
     world.didDestroyWindowProxy(this);
 }
 
-JSDOMWindowProxy& WindowProxyController::createWindowProxy(DOMWrapperWorld& world)
+JSDOMWindowProxy& WindowProxy::createJSWindowProxy(DOMWrapperWorld& world)
 {
-    ASSERT(!m_windowProxies.contains(&world));
+    ASSERT(!m_jsWindowProxies.contains(&world));
     ASSERT(m_frame.window());
 
     VM& vm = world.vm();
 
-    Strong<JSDOMWindowProxy> windowProxy(vm, &JSDOMWindowProxy::create(vm, *m_frame.window(), world));
-    Strong<JSDOMWindowProxy> windowProxy2(windowProxy);
-    m_windowProxies.add(&world, windowProxy);
+    Strong<JSDOMWindowProxy> jsWindowProxy(vm, &JSDOMWindowProxy::create(vm, *m_frame.window(), world));
+    Strong<JSDOMWindowProxy> jsWindowProxy2(jsWindowProxy);
+    m_jsWindowProxies.add(&world, jsWindowProxy);
     world.didCreateWindowProxy(this);
-    return *windowProxy.get();
+    return *jsWindowProxy.get();
 }
 
-Vector<JSC::Strong<JSDOMWindowProxy>> WindowProxyController::windowProxiesAsVector() const
+Vector<JSC::Strong<JSDOMWindowProxy>> WindowProxy::jsWindowProxiesAsVector() const
 {
-    return copyToVector(m_windowProxies.values());
+    return copyToVector(m_jsWindowProxies.values());
 }
 
-JSDOMWindowProxy& WindowProxyController::createWindowProxyWithInitializedScript(DOMWrapperWorld& world)
+JSDOMWindowProxy& WindowProxy::createJSWindowProxyWithInitializedScript(DOMWrapperWorld& world)
 {
     JSLockHolder lock(world.vm());
-    auto& windowProxy = createWindowProxy(world);
+    auto& windowProxy = createJSWindowProxy(world);
     if (is<Frame>(m_frame))
         downcast<Frame>(m_frame).script().initScriptForWindowProxy(windowProxy);
     return windowProxy;
 }
 
-void WindowProxyController::clearWindowProxiesNotMatchingDOMWindow(AbstractDOMWindow* newDOMWindow, bool goingIntoPageCache)
+void WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow(AbstractDOMWindow* newDOMWindow, bool goingIntoPageCache)
 {
-    if (m_windowProxies.isEmpty())
+    if (m_jsWindowProxies.isEmpty())
         return;
 
     JSLockHolder lock(commonVM());
 
-    for (auto& windowProxy : windowProxiesAsVector()) {
+    for (auto& windowProxy : jsWindowProxiesAsVector()) {
         if (&windowProxy->wrapped() == newDOMWindow)
             continue;
 
@@ -124,16 +124,16 @@ void WindowProxyController::clearWindowProxiesNotMatchingDOMWindow(AbstractDOMWi
         collectGarbageAfterWindowProxyDestruction();
 }
 
-void WindowProxyController::setDOMWindowForWindowProxy(AbstractDOMWindow* newDOMWindow)
+void WindowProxy::setDOMWindow(AbstractDOMWindow* newDOMWindow)
 {
     ASSERT(newDOMWindow);
 
-    if (m_windowProxies.isEmpty())
+    if (m_jsWindowProxies.isEmpty())
         return;
 
     JSLockHolder lock(commonVM());
 
-    for (auto& windowProxy : windowProxiesAsVector()) {
+    for (auto& windowProxy : jsWindowProxiesAsVector()) {
         if (&windowProxy->wrapped() == newDOMWindow)
             continue;
 
@@ -159,9 +159,9 @@ void WindowProxyController::setDOMWindowForWindowProxy(AbstractDOMWindow* newDOM
     }
 }
 
-void WindowProxyController::attachDebugger(JSC::Debugger* debugger)
+void WindowProxy::attachDebugger(JSC::Debugger* debugger)
 {
-    for (auto& windowProxy : m_windowProxies.values())
+    for (auto& windowProxy : m_jsWindowProxies.values())
         windowProxy->attachDebugger(debugger);
 }
 
@@ -32,55 +32,55 @@ namespace WebCore {
 
 class AbstractFrame;
 
-class WindowProxyController {
+class WindowProxy {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     using ProxyMap = HashMap<RefPtr<DOMWrapperWorld>, JSC::Strong<JSDOMWindowProxy>>;
 
-    explicit WindowProxyController(AbstractFrame&);
-    ~WindowProxyController();
+    explicit WindowProxy(AbstractFrame&);
+    ~WindowProxy();
 
-    void destroyWindowProxy(DOMWrapperWorld&);
+    void destroyJSWindowProxy(DOMWrapperWorld&);
 
-    ProxyMap::ValuesConstIteratorRange windowProxies() const { return m_windowProxies.values(); }
-    Vector<JSC::Strong<JSDOMWindowProxy>> windowProxiesAsVector() const;
+    ProxyMap::ValuesConstIteratorRange jsWindowProxies() const { return m_jsWindowProxies.values(); }
+    Vector<JSC::Strong<JSDOMWindowProxy>> jsWindowProxiesAsVector() const;
 
-    ProxyMap releaseWindowProxies() { return std::exchange(m_windowProxies, ProxyMap()); }
-    void setWindowProxies(ProxyMap&& windowProxies) { m_windowProxies = WTFMove(windowProxies); }
+    ProxyMap releaseJSWindowProxies() { return std::exchange(m_jsWindowProxies, ProxyMap()); }
+    void setJSWindowProxies(ProxyMap&& windowProxies) { m_jsWindowProxies = WTFMove(windowProxies); }
 
-    JSDOMWindowProxy& windowProxy(DOMWrapperWorld& world)
+    JSDOMWindowProxy& jsWindowProxy(DOMWrapperWorld& world)
     {
-        auto it = m_windowProxies.find(&world);
-        if (it != m_windowProxies.end())
+        auto it = m_jsWindowProxies.find(&world);
+        if (it != m_jsWindowProxies.end())
             return *it->value.get();
 
-        return createWindowProxyWithInitializedScript(world);
+        return createJSWindowProxyWithInitializedScript(world);
     }
 
-    JSDOMWindowProxy* existingWindowProxy(DOMWrapperWorld& world) const
+    JSDOMWindowProxy* existingJSWindowProxy(DOMWrapperWorld& world) const
     {
-        auto it = m_windowProxies.find(&world);
-        return (it != m_windowProxies.end()) ? it->value.get() : nullptr;
+        auto it = m_jsWindowProxies.find(&world);
+        return (it != m_jsWindowProxies.end()) ? it->value.get() : nullptr;
     }
 
     JSDOMGlobalObject* globalObject(DOMWrapperWorld& world)
     {
-        return windowProxy(world).window();
+        return jsWindowProxy(world).window();
     }
 
-    void clearWindowProxiesNotMatchingDOMWindow(AbstractDOMWindow*, bool goingIntoPageCache);
+    void clearJSWindowProxiesNotMatchingDOMWindow(AbstractDOMWindow*, bool goingIntoPageCache);
 
-    WEBCORE_EXPORT void setDOMWindowForWindowProxy(AbstractDOMWindow*);
+    WEBCORE_EXPORT void setDOMWindow(AbstractDOMWindow*);
 
     // Debugger can be nullptr to detach any existing Debugger.
     void attachDebugger(JSC::Debugger*); // Attaches/detaches in all worlds/window proxies.
 
 private:
-    JSDOMWindowProxy& createWindowProxy(DOMWrapperWorld&);
-    WEBCORE_EXPORT JSDOMWindowProxy& createWindowProxyWithInitializedScript(DOMWrapperWorld&);
+    JSDOMWindowProxy& createJSWindowProxy(DOMWrapperWorld&);
+    WEBCORE_EXPORT JSDOMWindowProxy& createJSWindowProxyWithInitializedScript(DOMWrapperWorld&);
 
     AbstractFrame& m_frame;
-    ProxyMap m_windowProxies;
+    ProxyMap m_jsWindowProxies;
 };
 
 } // namespace WebCore
index a454dd9..8799da6 100644 (file)
@@ -629,7 +629,7 @@ void FrameLoader::clear(Document* newDocument, bool clearWindowProperties, bool
     if (clearWindowProperties) {
         InspectorInstrumentation::frameWindowDiscarded(m_frame, m_frame.document()->domWindow());
         m_frame.document()->domWindow()->resetUnlessSuspendedForDocumentSuspension();
-        m_frame.windowProxyController().clearWindowProxiesNotMatchingDOMWindow(newDocument->domWindow(), m_frame.document()->pageCacheState() == Document::AboutToEnterPageCache);
+        m_frame.windowProxy().clearJSWindowProxiesNotMatchingDOMWindow(newDocument->domWindow(), m_frame.document()->pageCacheState() == Document::AboutToEnterPageCache);
 
         if (shouldClearWindowName(m_frame, *newDocument))
             m_frame.tree().setName(nullAtom());
@@ -648,7 +648,7 @@ void FrameLoader::clear(Document* newDocument, bool clearWindowProperties, bool
     subframeLoader().clear();
 
     if (clearWindowProperties)
-        m_frame.windowProxyController().setDOMWindowForWindowProxy(newDocument->domWindow());
+        m_frame.windowProxy().setDOMWindow(newDocument->domWindow());
 
     if (clearScriptObjects)
         m_frame.script().clearScriptObjects();
@@ -3645,7 +3645,7 @@ void FrameLoader::dispatchDidClearWindowObjectsInAllWorlds()
 
 void FrameLoader::dispatchDidClearWindowObjectInWorld(DOMWrapperWorld& world)
 {
-    if (!m_frame.script().canExecuteScripts(NotAboutToExecuteScript) || !m_frame.windowProxyController().existingWindowProxy(world))
+    if (!m_frame.script().canExecuteScripts(NotAboutToExecuteScript) || !m_frame.windowProxy().existingJSWindowProxy(world))
         return;
 
     m_client.dispatchDidClearWindowObjectInWorld(world);
index 07db506..1fded40 100644 (file)
 #include "config.h"
 #include "AbstractFrame.h"
 
-#include "WindowProxyController.h"
+#include "WindowProxy.h"
 
 namespace WebCore {
 
 AbstractFrame::AbstractFrame()
-    : m_windowProxyController(makeUniqueRef<WindowProxyController>(*this))
+    : m_windowProxy(makeUniqueRef<WindowProxy>(*this))
 {
 }
 
index 334c9ec..c65b3ac 100644 (file)
@@ -31,7 +31,7 @@
 namespace WebCore {
 
 class AbstractDOMWindow;
-class WindowProxyController;
+class WindowProxy;
 
 // FIXME: Rename Frame to LocalFrame and AbstractFrame to Frame.
 class AbstractFrame : public ThreadSafeRefCounted<AbstractFrame> {
@@ -41,8 +41,8 @@ public:
     virtual bool isLocalFrame() const = 0;
     virtual bool isRemoteFrame() const = 0;
 
-    WindowProxyController& windowProxyController() { return m_windowProxyController; }
-    const WindowProxyController& windowProxyController() const { return m_windowProxyController; }
+    WindowProxy& windowProxy() { return m_windowProxy; }
+    const WindowProxy& windowProxy() const { return m_windowProxy; }
 
     AbstractDOMWindow* window() const { return virtualWindow(); }
 
@@ -52,7 +52,7 @@ protected:
 private:
     virtual AbstractDOMWindow* virtualWindow() const = 0;
 
-    UniqueRef<WindowProxyController> m_windowProxyController;
+    UniqueRef<WindowProxy> m_windowProxy;
 };
 
 } // namespace WebCore
index 3624876..b3458f5 100644 (file)
@@ -1257,7 +1257,7 @@ void Page::setDebugger(JSC::Debugger* debugger)
     m_debugger = debugger;
 
     for (Frame* frame = &m_mainFrame.get(); frame; frame = frame->tree().traverseNext())
-        frame->windowProxyController().attachDebugger(m_debugger);
+        frame->windowProxy().attachDebugger(m_debugger);
 }
 
 StorageNamespace* Page::sessionStorage(bool optionalCreate)
index d5b46f3..825348d 100644 (file)
@@ -45,11 +45,11 @@ RemoteDOMWindow::~RemoteDOMWindow()
         m_frame->setWindow(nullptr);
 }
 
-WindowProxyController* RemoteDOMWindow::self() const
+WindowProxy* RemoteDOMWindow::self() const
 {
     if (!m_frame)
         return nullptr;
-    return &m_frame->windowProxyController();
+    return &m_frame->windowProxy();
 }
 
 Location* RemoteDOMWindow::location() const
@@ -85,16 +85,16 @@ unsigned RemoteDOMWindow::length() const
     return 0;
 }
 
-WindowProxyController* RemoteDOMWindow::top() const
+WindowProxy* RemoteDOMWindow::top() const
 {
     if (!m_frame)
         return nullptr;
 
     // FIXME: Implemented this.
-    return &m_frame->windowProxyController();
+    return &m_frame->windowProxy();
 }
 
-WindowProxyController* RemoteDOMWindow::opener() const
+WindowProxy* RemoteDOMWindow::opener() const
 {
     if (!m_frame)
         return nullptr;
@@ -103,16 +103,16 @@ WindowProxyController* RemoteDOMWindow::opener() const
     if (!openerFrame)
         return nullptr;
 
-    return &openerFrame->windowProxyController();
+    return &openerFrame->windowProxy();
 }
 
-WindowProxyController* RemoteDOMWindow::parent() const
+WindowProxy* RemoteDOMWindow::parent() const
 {
     if (!m_frame)
         return nullptr;
 
     // FIXME: Implemented this.
-    return &m_frame->windowProxyController();
+    return &m_frame->windowProxy();
 }
 
 ExceptionOr<void> RemoteDOMWindow::postMessage(JSC::ExecState&, DOMWindow& incumbentWindow, JSC::JSValue message, const String& targetOrigin, Vector<JSC::Strong<JSC::JSObject>>&&)
index 3a71511..bd0c052 100644 (file)
@@ -55,16 +55,16 @@ public:
     ScriptExecutionContext* scriptExecutionContext() const final { return nullptr; }
 
     // DOM API exposed cross-origin.
-    WindowProxyController* self() const;
+    WindowProxy* self() const;
     Location* location() const;
     void close(Document&);
     bool closed() const;
     void focus(DOMWindow& incumbentWindow);
     void blur();
     unsigned length() const;
-    WindowProxyController* top() const;
-    WindowProxyController* opener() const;
-    WindowProxyController* parent() const;
+    WindowProxy* top() const;
+    WindowProxy* opener() const;
+    WindowProxy* parent() const;
     ExceptionOr<void> postMessage(JSC::ExecState&, DOMWindow& incumbentWindow, JSC::JSValue message, const String& targetOrigin, Vector<JSC::Strong<JSC::JSObject>>&&);
 
 private:
index 5b2122d..704da36 100644 (file)
@@ -1,3 +1,18 @@
+2018-04-18  Chris Dumez  <cdumez@apple.com>
+
+        Rename WindowProxyController to WindowProxy
+        https://bugs.webkit.org/show_bug.cgi?id=184756
+
+        Reviewed by Sam Weinig.
+
+        Rename WindowProxyController to WindowProxy for clarity. When the IDL uses WindowProxy, the implementation
+        needed use WindowProxyController type, which was a bit confusing.
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::windowScriptNPObject):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::frameBecameRemote):
+
 2018-04-18  Youenn Fablet  <youenn@apple.com>
 
         Allow SameOrigin credentials handling for synchronous XHR
index 0ed6624..a7fcace 100644 (file)
@@ -1448,7 +1448,7 @@ NPObject* PluginView::windowScriptNPObject()
         return nullptr;
     }
 
-    return m_npRuntimeObjectMap.getOrCreateNPObject(pluginWorld().vm(), frame()->windowProxyController().windowProxy(pluginWorld()).window());
+    return m_npRuntimeObjectMap.getOrCreateNPObject(pluginWorld().vm(), frame()->windowProxy().jsWindowProxy(pluginWorld()).window());
 }
 
 NPObject* PluginView::pluginElementNPObject()
index 9e91c3b..00bc17d 100644 (file)
@@ -5888,9 +5888,9 @@ void WebPage::frameBecameRemote(uint64_t frameID, GlobalFrameIdentifier&& remote
 
     remoteFrame->setOpener(frame->coreFrame()->loader().opener());
 
-    auto windowProxies = frame->coreFrame()->windowProxyController().releaseWindowProxies();
-    remoteFrame->windowProxyController().setWindowProxies(WTFMove(windowProxies));
-    remoteFrame->windowProxyController().setDOMWindowForWindowProxy(remoteWindow.ptr());
+    auto jsWindowProxies = frame->coreFrame()->windowProxy().releaseJSWindowProxies();
+    remoteFrame->windowProxy().setJSWindowProxies(WTFMove(jsWindowProxies));
+    remoteFrame->windowProxy().setDOMWindow(remoteWindow.ptr());
 
     auto* coreFrame = frame->coreFrame();
     coreFrame->setView(nullptr);
index ba92804..f071169 100644 (file)
@@ -1,3 +1,18 @@
+2018-04-18  Chris Dumez  <cdumez@apple.com>
+
+        Rename WindowProxyController to WindowProxy
+        https://bugs.webkit.org/show_bug.cgi?id=184756
+
+        Reviewed by Sam Weinig.
+
+        Rename WindowProxyController to WindowProxy for clarity. When the IDL uses WindowProxy, the implementation
+        needed use WindowProxyController type, which was a bit confusing.
+
+        * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+        (WebKit::NetscapePluginInstanceProxy::getWindowNPObject):
+        * WebView/WebFrame.mm:
+        (-[WebFrame _attachScriptDebugger]):
+
 2018-04-17  Jonathan Bedard  <jbedard@apple.com>
 
         Unreviewed rollout of r230632. Regression in memory usage.
index b30ed22..bb89cbb 100644 (file)
@@ -839,7 +839,7 @@ bool NetscapePluginInstanceProxy::getWindowNPObject(uint32_t& objectID)
     if (!frame->script().canExecuteScripts(NotAboutToExecuteScript))
         objectID = 0;
     else
-        objectID = m_localObjects.idForObject(pluginWorld().vm(), frame->windowProxyController().windowProxy(pluginWorld()).window());
+        objectID = m_localObjects.idForObject(pluginWorld().vm(), frame->windowProxy().jsWindowProxy(pluginWorld()).window());
         
     return true;
 }
index b6b7957..033851c 100644 (file)
@@ -360,15 +360,15 @@ static NSURL *createUniqueWebDataURL();
 
 - (void)_attachScriptDebugger
 {
-    auto& windowProxyController = _private->coreFrame->windowProxyController();
+    auto& windowProxy = _private->coreFrame->windowProxy();
 
     // Calling ScriptController::globalObject() would create a window proxy, and dispatch corresponding callbacks, which may be premature
     // if the script debugger is attached before a document is created.  These calls use the debuggerWorld(), we will need to pass a world
     // to be able to debug isolated worlds.
-    if (!windowProxyController.existingWindowProxy(debuggerWorld()))
+    if (!windowProxy.existingJSWindowProxy(debuggerWorld()))
         return;
 
-    auto* globalObject = windowProxyController.globalObject(debuggerWorld());
+    auto* globalObject = windowProxy.globalObject(debuggerWorld());
     if (!globalObject)
         return;