Diff
Modified: trunk/Source/WebCore/ChangeLog (230830 => 230831)
--- trunk/Source/WebCore/ChangeLog 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/ChangeLog 2018-04-20 02:15:39 UTC (rev 230831)
@@ -1,3 +1,67 @@
+2018-04-19 Chris Dumez <cdu...@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 <k...@webbkit.org>
Introduce SVGGeometryElement interface
Modified: trunk/Source/WebCore/Sources.txt (230830 => 230831)
--- trunk/Source/WebCore/Sources.txt 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/Sources.txt 2018-04-20 02:15:39 UTC (rev 230831)
@@ -391,7 +391,6 @@
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/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
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (230830 => 230831)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-04-20 02:15:39 UTC (rev 230831)
@@ -3743,7 +3743,7 @@
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, ); }; };
@@ -12740,8 +12740,8 @@
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>"; };
@@ -23697,8 +23697,6 @@
BC6932720D7E293900AE44D1 /* JSDOMWindowBase.h */,
460CBF331D4BCCFE0092E88E /* JSDOMWindowProperties.cpp */,
460CBF341D4BCCFE0092E88E /* JSDOMWindowProperties.h */,
- BCBFB53A0DCD29CF0019B3E5 /* JSDOMWindowProxy.cpp */,
- BCBFB53B0DCD29CF0019B3E5 /* JSDOMWindowProxy.h */,
4170A2E91D8C0CC000318452 /* JSDOMWrapper.cpp */,
65E0E9431133C89F00B4CB10 /* JSDOMWrapper.h */,
7C45C9CB1E3E8E4900AAB558 /* JSDOMWrapperCache.cpp */,
@@ -23713,6 +23711,8 @@
46BCBBC12085008000710638 /* JSRemoteDOMWindowBase.cpp */,
46BCBBC02085007F00710638 /* JSRemoteDOMWindowBase.h */,
931AE3B81FB80EAE00F5EFB2 /* JSValueInWrappedObject.h */,
+ BCBFB53A0DCD29CF0019B3E5 /* JSWindowProxy.cpp */,
+ BCBFB53B0DCD29CF0019B3E5 /* JSWindowProxy.h */,
E1C36D320EB0A094007410BC /* JSWorkerGlobalScopeBase.cpp */,
E1C36D330EB0A094007410BC /* JSWorkerGlobalScopeBase.h */,
709A01FD1E3D0BCC006B0D4C /* ModuleFetchFailureKind.h */,
@@ -28322,7 +28322,6 @@
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 */,
@@ -28924,6 +28923,7 @@
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 */,
Modified: trunk/Source/WebCore/bindings/IDLTypes.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/IDLTypes.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/IDLTypes.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -51,7 +51,7 @@
class IDBKey;
class IDBKeyData;
class IDBValue;
-class JSDOMWindowProxy;
+class JSWindowProxy;
class DOMPromise;
class ScheduledAction;
@@ -274,7 +274,7 @@
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> { };
Modified: trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/JSBindingsAllInOne.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -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"
Modified: trunk/Source/WebCore/bindings/js/JSDOMConvertWindowProxy.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/JSDOMConvertWindowProxy.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/JSDOMConvertWindowProxy.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -27,7 +27,7 @@
#include "IDLTypes.h"
#include "JSDOMConvertBase.h"
-#include "JSDOMWindowProxy.h"
+#include "JSWindowProxy.h"
namespace WebCore {
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -78,7 +78,7 @@
&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 @@
{
}
-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 @@
setCurrentEvent(0);
}
-JSDOMWindowProxy* JSDOMWindowBase::proxy() const
+JSWindowProxy* JSDOMWindowBase::proxy() const
{
return m_proxy;
}
@@ -271,8 +271,8 @@
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;
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -44,13 +44,13 @@
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 @@
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 @@
void printErrorMessage(const String&) const;
- JSDOMWindowProxy* proxy() const;
+ JSWindowProxy* proxy() const;
static void fireFrameClearedWatchpointsForWindow(DOMWindow*);
@@ -97,11 +97,11 @@
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(); }
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -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 @@
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;
Deleted: trunk/Source/WebCore/bindings/js/JSDOMWindowProxy.cpp (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowProxy.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowProxy.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -1,153 +0,0 @@
-/*
- * Copyright (C) 2008-2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSDOMWindowProxy.h"
-
-#include "AbstractFrame.h"
-#include "CommonVM.h"
-#include "GCController.h"
-#include "JSDOMWindow.h"
-#include "JSDOMWindowProperties.h"
-#include "JSEventTarget.h"
-#include "ScriptController.h"
-#include <_javascript_Core/JSObject.h>
-#include <_javascript_Core/StrongInlines.h>
-
-namespace WebCore {
-
-const ClassInfo JSDOMWindowProxy::s_info = { "JSDOMWindowProxy", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDOMWindowProxy) };
-
-inline JSDOMWindowProxy::JSDOMWindowProxy(VM& vm, Structure& structure, DOMWrapperWorld& world)
- : Base(vm, &structure)
- , m_world(world)
-{
-}
-
-void JSDOMWindowProxy::finishCreation(VM& vm, AbstractDOMWindow& window)
-{
- Base::finishCreation(vm);
- ASSERT(inherits(vm, info()));
- setWindow(window);
-}
-
-JSDOMWindowProxy& JSDOMWindowProxy::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);
- proxy.finishCreation(vm, window);
- return proxy;
-}
-
-void JSDOMWindowProxy::destroy(JSCell* cell)
-{
- static_cast<JSDOMWindowProxy*>(cell)->JSDOMWindowProxy::~JSDOMWindowProxy();
-}
-
-void JSDOMWindowProxy::setWindow(VM& vm, JSDOMGlobalObject& window)
-{
- ASSERT(window.classInfo() == JSDOMWindow::info() || window.classInfo() == JSRemoteDOMWindow::info());
- setTarget(vm, &window);
- structure()->setGlobalObject(vm, &window);
- GCController::singleton().garbageCollectSoon();
-}
-
-void JSDOMWindowProxy::setWindow(AbstractDOMWindow& domWindow)
-{
- // Replacing JSDOMWindow via telling JSDOMWindowProxy to use the same DOMWindow it already uses makes no sense,
- // so we'd better never try to.
- ASSERT(!window() || &domWindow != &wrapped());
-
- bool isRemoteDOMWindow = is<RemoteDOMWindow>(domWindow);
-
- VM& vm = commonVM();
- auto& prototypeStructure = isRemoteDOMWindow ? *JSRemoteDOMWindowPrototype::createStructure(vm, nullptr, jsNull()) : *JSDOMWindowPrototype::createStructure(vm, nullptr, jsNull());
-
- // Explicitly protect the prototype so it isn't collected when we allocate the global object.
- // (Once the global object is fully constructed, it will mark its own prototype.)
- // FIXME: Why do we need to protect this when there's a pointer to it on the stack?
- // Perhaps the issue is that structure objects aren't seen when scanning the stack?
- Strong<JSNonFinalObject> prototype(vm, isRemoteDOMWindow ? static_cast<JSNonFinalObject*>(JSRemoteDOMWindowPrototype::create(vm, nullptr, &prototypeStructure)) : static_cast<JSNonFinalObject*>(JSDOMWindowPrototype::create(vm, nullptr, &prototypeStructure)));
-
- JSDOMGlobalObject* window = nullptr;
- if (isRemoteDOMWindow) {
- auto& windowStructure = *JSRemoteDOMWindow::createStructure(vm, nullptr, prototype.get());
- window = JSRemoteDOMWindow::create(vm, &windowStructure, downcast<RemoteDOMWindow>(domWindow), this);
- } else {
- auto& windowStructure = *JSDOMWindow::createStructure(vm, nullptr, prototype.get());
- window = JSDOMWindow::create(vm, &windowStructure, downcast<DOMWindow>(domWindow), this);
- }
-
- prototype->structure()->setGlobalObject(vm, window);
-
- auto& propertiesStructure = *JSDOMWindowProperties::createStructure(vm, window, JSEventTarget::prototype(vm, *window));
- auto& properties = *JSDOMWindowProperties::create(&propertiesStructure, *window);
- prototype->structure()->setPrototypeWithoutTransition(vm, &properties);
-
- setWindow(vm, *window);
-
- ASSERT(window->globalObject() == window);
- ASSERT(prototype->globalObject() == window);
-}
-
-void JSDOMWindowProxy::attachDebugger(JSC::Debugger* debugger)
-{
- auto* globalObject = window();
- JSLockHolder lock(globalObject->vm());
-
- if (debugger)
- debugger->attach(globalObject);
- else if (auto* currentDebugger = globalObject->debugger())
- currentDebugger->detach(globalObject, JSC::Debugger::TerminatingDebuggingSession);
-}
-
-AbstractDOMWindow& JSDOMWindowProxy::wrapped() const
-{
- auto* window = this->window();
- if (auto* jsWindow = jsDynamicCast<JSRemoteDOMWindowBase*>(window->vm(), window))
- return jsWindow->wrapped();
- return jsCast<JSDOMWindowBase*>(window)->wrapped();
-}
-
-AbstractDOMWindow* JSDOMWindowProxy::toWrapped(VM& vm, JSObject* value)
-{
- auto* wrapper = jsDynamicCast<JSDOMWindowProxy*>(vm, value);
- return wrapper ? &wrapper->wrapped() : nullptr;
-}
-
-JSValue toJS(ExecState* state, WindowProxy& windowProxy)
-{
- return &windowProxy.jsWindowProxy(currentWorld(*state));
-}
-
-JSDOMWindowProxy& toJSDOMWindowProxy(WindowProxy& windowProxy, DOMWrapperWorld& world)
-{
- return windowProxy.jsWindowProxy(world);
-}
-
-} // namespace WebCore
Deleted: trunk/Source/WebCore/bindings/js/JSDOMWindowProxy.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowProxy.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowProxy.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2008-2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "JSDOMWindow.h"
-#include <_javascript_Core/JSProxy.h>
-
-namespace JSC {
-class Debugger;
-}
-
-namespace WebCore {
-
-class AbstractDOMWindow;
-class AbstractFrame;
-class WindowProxy;
-
-class JSDOMWindowProxy final : public JSC::JSProxy {
- using Base = JSC::JSProxy;
-public:
- static JSDOMWindowProxy& create(JSC::VM&, AbstractDOMWindow&, DOMWrapperWorld&);
- static void destroy(JSCell*);
-
- DECLARE_INFO;
-
- JSDOMGlobalObject* window() const { return JSC::jsCast<JSDOMGlobalObject*>(target()); }
- void setWindow(JSC::VM&, JSDOMGlobalObject&);
- void setWindow(AbstractDOMWindow&);
-
- AbstractDOMWindow& wrapped() const;
- static WEBCORE_EXPORT AbstractDOMWindow* toWrapped(JSC::VM&, JSC::JSObject*);
-
- DOMWrapperWorld& world() { return m_world; }
-
- void attachDebugger(JSC::Debugger*);
-
-private:
- JSDOMWindowProxy(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.
-// 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; }
-
-
-} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/JSEventTargetCustom.cpp (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/JSEventTargetCustom.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/JSEventTargetCustom.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -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 @@
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)
Modified: trunk/Source/WebCore/bindings/js/JSRemoteDOMWindowBase.cpp (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/JSRemoteDOMWindowBase.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/JSRemoteDOMWindowBase.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -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 @@
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 @@
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;
Modified: trunk/Source/WebCore/bindings/js/JSRemoteDOMWindowBase.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/JSRemoteDOMWindowBase.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/JSRemoteDOMWindowBase.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -31,12 +31,12 @@
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*);
Copied: trunk/Source/WebCore/bindings/js/JSWindowProxy.cpp (from rev 230830, trunk/Source/WebCore/bindings/js/JSDOMWindowProxy.cpp) (0 => 230831)
--- trunk/Source/WebCore/bindings/js/JSWindowProxy.cpp (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSWindowProxy.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2008-2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JSWindowProxy.h"
+
+#include "AbstractFrame.h"
+#include "CommonVM.h"
+#include "GCController.h"
+#include "JSDOMWindow.h"
+#include "JSDOMWindowProperties.h"
+#include "JSEventTarget.h"
+#include "JSRemoteDOMWindow.h"
+#include "ScriptController.h"
+#include <_javascript_Core/Debugger.h>
+#include <_javascript_Core/JSObject.h>
+#include <_javascript_Core/StrongInlines.h>
+
+namespace WebCore {
+
+const ClassInfo JSWindowProxy::s_info = { "JSWindowProxy", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWindowProxy) };
+
+inline JSWindowProxy::JSWindowProxy(VM& vm, Structure& structure, DOMWrapperWorld& world)
+ : Base(vm, &structure)
+ , m_world(world)
+{
+}
+
+void JSWindowProxy::finishCreation(VM& vm, AbstractDOMWindow& window)
+{
+ Base::finishCreation(vm);
+ ASSERT(inherits(vm, info()));
+ setWindow(window);
+}
+
+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<JSWindowProxy>(vm.heap)) JSWindowProxy(vm, structure, world);
+ proxy.finishCreation(vm, window);
+ return proxy;
+}
+
+void JSWindowProxy::destroy(JSCell* cell)
+{
+ static_cast<JSWindowProxy*>(cell)->JSWindowProxy::~JSWindowProxy();
+}
+
+void JSWindowProxy::setWindow(VM& vm, JSDOMGlobalObject& window)
+{
+ ASSERT(window.classInfo() == JSDOMWindow::info() || window.classInfo() == JSRemoteDOMWindow::info());
+ setTarget(vm, &window);
+ structure()->setGlobalObject(vm, &window);
+ GCController::singleton().garbageCollectSoon();
+}
+
+void JSWindowProxy::setWindow(AbstractDOMWindow& domWindow)
+{
+ // 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());
+
+ bool isRemoteDOMWindow = is<RemoteDOMWindow>(domWindow);
+
+ VM& vm = commonVM();
+ auto& prototypeStructure = isRemoteDOMWindow ? *JSRemoteDOMWindowPrototype::createStructure(vm, nullptr, jsNull()) : *JSDOMWindowPrototype::createStructure(vm, nullptr, jsNull());
+
+ // Explicitly protect the prototype so it isn't collected when we allocate the global object.
+ // (Once the global object is fully constructed, it will mark its own prototype.)
+ // FIXME: Why do we need to protect this when there's a pointer to it on the stack?
+ // Perhaps the issue is that structure objects aren't seen when scanning the stack?
+ Strong<JSNonFinalObject> prototype(vm, isRemoteDOMWindow ? static_cast<JSNonFinalObject*>(JSRemoteDOMWindowPrototype::create(vm, nullptr, &prototypeStructure)) : static_cast<JSNonFinalObject*>(JSDOMWindowPrototype::create(vm, nullptr, &prototypeStructure)));
+
+ JSDOMGlobalObject* window = nullptr;
+ if (isRemoteDOMWindow) {
+ auto& windowStructure = *JSRemoteDOMWindow::createStructure(vm, nullptr, prototype.get());
+ window = JSRemoteDOMWindow::create(vm, &windowStructure, downcast<RemoteDOMWindow>(domWindow), this);
+ } else {
+ auto& windowStructure = *JSDOMWindow::createStructure(vm, nullptr, prototype.get());
+ window = JSDOMWindow::create(vm, &windowStructure, downcast<DOMWindow>(domWindow), this);
+ }
+
+ prototype->structure()->setGlobalObject(vm, window);
+
+ auto& propertiesStructure = *JSDOMWindowProperties::createStructure(vm, window, JSEventTarget::prototype(vm, *window));
+ auto& properties = *JSDOMWindowProperties::create(&propertiesStructure, *window);
+ prototype->structure()->setPrototypeWithoutTransition(vm, &properties);
+
+ setWindow(vm, *window);
+
+ ASSERT(window->globalObject() == window);
+ ASSERT(prototype->globalObject() == window);
+}
+
+void JSWindowProxy::attachDebugger(JSC::Debugger* debugger)
+{
+ auto* globalObject = window();
+ JSLockHolder lock(globalObject->vm());
+
+ if (debugger)
+ debugger->attach(globalObject);
+ else if (auto* currentDebugger = globalObject->debugger())
+ currentDebugger->detach(globalObject, JSC::Debugger::TerminatingDebuggingSession);
+}
+
+AbstractDOMWindow& JSWindowProxy::wrapped() const
+{
+ auto* window = this->window();
+ if (auto* jsWindow = jsDynamicCast<JSRemoteDOMWindowBase*>(window->vm(), window))
+ return jsWindow->wrapped();
+ return jsCast<JSDOMWindowBase*>(window)->wrapped();
+}
+
+AbstractDOMWindow* JSWindowProxy::toWrapped(VM& vm, JSObject* value)
+{
+ auto* wrapper = jsDynamicCast<JSWindowProxy*>(vm, value);
+ return wrapper ? &wrapper->wrapped() : nullptr;
+}
+
+JSValue toJS(ExecState* state, WindowProxy& windowProxy)
+{
+ return &windowProxy.jsWindowProxy(currentWorld(*state));
+}
+
+JSWindowProxy& toJSWindowProxy(WindowProxy& windowProxy, DOMWrapperWorld& world)
+{
+ return windowProxy.jsWindowProxy(world);
+}
+
+} // namespace WebCore
Copied: trunk/Source/WebCore/bindings/js/JSWindowProxy.h (from rev 230830, trunk/Source/WebCore/bindings/js/JSDOMWindowProxy.h) (0 => 230831)
--- trunk/Source/WebCore/bindings/js/JSWindowProxy.h (rev 0)
+++ trunk/Source/WebCore/bindings/js/JSWindowProxy.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2008-2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "JSDOMWindow.h"
+#include <_javascript_Core/JSProxy.h>
+
+namespace JSC {
+class Debugger;
+}
+
+namespace WebCore {
+
+class AbstractDOMWindow;
+class AbstractFrame;
+class WindowProxy;
+
+class JSWindowProxy final : public JSC::JSProxy {
+ using Base = JSC::JSProxy;
+public:
+ static JSWindowProxy& create(JSC::VM&, AbstractDOMWindow&, DOMWrapperWorld&);
+ static void destroy(JSCell*);
+
+ DECLARE_INFO;
+
+ JSDOMGlobalObject* window() const { return JSC::jsCast<JSDOMGlobalObject*>(target()); }
+ void setWindow(JSC::VM&, JSDOMGlobalObject&);
+ void setWindow(AbstractDOMWindow&);
+
+ AbstractDOMWindow& wrapped() const;
+ static WEBCORE_EXPORT AbstractDOMWindow* toWrapped(JSC::VM&, JSC::JSObject*);
+
+ DOMWrapperWorld& world() { return m_world; }
+
+ void attachDebugger(JSC::Debugger*);
+
+private:
+ JSWindowProxy(JSC::VM&, JSC::Structure&, DOMWrapperWorld&);
+ void finishCreation(JSC::VM&, AbstractDOMWindow&);
+
+ Ref<DOMWrapperWorld> m_world;
+};
+
+// 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(); }
+
+JSWindowProxy& toJSWindowProxy(WindowProxy&, DOMWrapperWorld&);
+inline JSWindowProxy* toJSWindowProxy(WindowProxy* windowProxy, DOMWrapperWorld& world) { return windowProxy ? &toJSWindowProxy(*windowProxy, world) : nullptr; }
+
+
+} // namespace WebCore
Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/ScriptController.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -240,7 +240,7 @@
static_cast<JSVMClientData*>(commonVM().clientData)->getAllWorlds(worlds);
}
-void ScriptController::initScriptForWindowProxy(JSDOMWindowProxy& windowProxy)
+void ScriptController::initScriptForWindowProxy(JSWindowProxy& windowProxy)
{
auto& world = windowProxy.world();
Modified: trunk/Source/WebCore/bindings/js/ScriptController.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/ScriptController.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/ScriptController.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -22,7 +22,7 @@
#pragma once
#include "FrameLoaderTypes.h"
-#include "JSDOMWindowProxy.h"
+#include "JSWindowProxy.h"
#include "WindowProxy.h"
#include <_javascript_Core/JSBase.h>
#include <_javascript_Core/Strong.h>
@@ -158,7 +158,7 @@
WEBCORE_EXPORT NPObject* windowScriptNPObject();
#endif
- void initScriptForWindowProxy(JSDOMWindowProxy&);
+ void initScriptForWindowProxy(JSWindowProxy&);
private:
void setupModuleScriptHandlers(LoadableModuleScript&, JSC::JSInternalPromise&, DOMWrapperWorld&);
Modified: trunk/Source/WebCore/bindings/js/WindowProxy.cpp (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/WindowProxy.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/WindowProxy.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -72,7 +72,7 @@
world.didDestroyWindowProxy(this);
}
-JSDOMWindowProxy& WindowProxy::createJSWindowProxy(DOMWrapperWorld& world)
+JSWindowProxy& WindowProxy::createJSWindowProxy(DOMWrapperWorld& world)
{
ASSERT(!m_jsWindowProxies.contains(&world));
ASSERT(m_frame.window());
@@ -79,19 +79,19 @@
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);
Modified: trunk/Source/WebCore/bindings/js/WindowProxy.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/js/WindowProxy.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/js/WindowProxy.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -20,7 +20,7 @@
#pragma once
-#include "JSDOMWindowProxy.h"
+#include "JSWindowProxy.h"
#include <_javascript_Core/Strong.h>
#include <wtf/HashMap.h>
@@ -35,7 +35,7 @@
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 @@
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 @@
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 @@
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;
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (230830 => 230831)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2018-04-20 02:15:39 UTC (rev 230831)
@@ -422,7 +422,7 @@
}
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 @@
}
}
- 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 @@
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 @@
# 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 @@
}
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 @@
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 @@
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 @@
# 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 @@
# 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")) {
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -20,6 +20,7 @@
#pragma once
+#include "JSDOMWrapper.h"
#include "JSNode.h"
#include "TestDOMJIT.h"
#include <_javascript_Core/DOMJITGetterSetter.h>
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -21,6 +21,7 @@
#pragma once
#include "JSDOMConvertDictionary.h"
+#include "JSDOMWrapper.h"
#include "JSEvent.h"
#include "TestEventConstructor.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -20,6 +20,7 @@
#pragma once
+#include "JSDOMWrapper.h"
#include "JSEventTarget.h"
#include "TestEventTarget.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestNode.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -20,6 +20,7 @@
#pragma once
+#include "JSDOMWrapper.h"
#include "JSNode.h"
#include "TestNode.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (230830 => 230831)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -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 @@
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);
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -21,6 +21,7 @@
#pragma once
#include "JSDOMConvertDictionary.h"
+#include "JSDOMWrapper.h"
#include "JSEvent.h"
#include "TestPromiseRejectionEvent.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -20,6 +20,7 @@
#pragma once
+#include "JSDOMWrapper.h"
#include "JSTestSerializationInherit.h"
#include "TestSerializationIndirectInheritance.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInherit.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -20,6 +20,7 @@
#pragma once
+#include "JSDOMWrapper.h"
#include "JSTestSerialization.h"
#include "TestSerializationInherit.h"
Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.h (230830 => 230831)
--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializationInheritFinal.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -20,6 +20,7 @@
#pragma once
+#include "JSDOMWrapper.h"
#include "JSTestSerializationInherit.h"
#include "TestSerializationInheritFinal.h"
Modified: trunk/Source/WebCore/page/Frame.cpp (230830 => 230831)
--- trunk/Source/WebCore/page/Frame.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/page/Frame.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -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"
Modified: trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp (230830 => 230831)
--- trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/page/csp/ContentSecurityPolicy.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -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 @@
return allow;
}
-void ContentSecurityPolicy::didCreateWindowProxy(JSDOMWindowProxy& windowProxy) const
+void ContentSecurityPolicy::didCreateWindowProxy(JSWindowProxy& windowProxy) const
{
auto* window = windowProxy.window();
ASSERT(window);
Modified: trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h (230830 => 230831)
--- trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebCore/page/csp/ContentSecurityPolicy.h 2018-04-20 02:15:39 UTC (rev 230831)
@@ -51,7 +51,7 @@
class ContentSecurityPolicySource;
class DOMStringList;
class Frame;
-class JSDOMWindowProxy;
+class JSWindowProxy;
class ResourceRequest;
class ScriptExecutionContext;
class SecurityOrigin;
@@ -71,7 +71,7 @@
void copyStateFrom(const ContentSecurityPolicy*);
void copyUpgradeInsecureRequestStateFrom(const ContentSecurityPolicy&);
- void didCreateWindowProxy(JSDOMWindowProxy&) const;
+ void didCreateWindowProxy(JSWindowProxy&) const;
enum class PolicyFrom {
API,
Modified: trunk/Source/WebInspectorUI/ChangeLog (230830 => 230831)
--- trunk/Source/WebInspectorUI/ChangeLog 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebInspectorUI/ChangeLog 2018-04-20 02:15:39 UTC (rev 230831)
@@ -1,3 +1,15 @@
+2018-04-19 Chris Dumez <cdu...@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 <ddkil...@apple.com>
Enable Objective-C weak references
Modified: trunk/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js (230830 => 230831)
--- trunk/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebInspectorUI/UserInterface/Workers/HeapSnapshot/HeapSnapshot.js 2018-04-20 02:15:39 UTC (rev 230831)
@@ -709,7 +709,7 @@
{
let className = this._nodeClassNamesTable[this._nodes[nodeIndex + nodeClassNameOffset]];
return className === "Window"
- || className === "JSDOMWindowProxy"
+ || className === "JSWindowProxy"
|| className === "GlobalObject";
}
Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (230830 => 230831)
--- trunk/Source/WebKitLegacy/mac/ChangeLog 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog 2018-04-20 02:15:39 UTC (rev 230831)
@@ -1,3 +1,17 @@
+2018-04-19 Chris Dumez <cdu...@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 <ddkil...@apple.com>
Enable Objective-C weak references
Modified: trunk/Source/WebKitLegacy/mac/DOM/DOMUtility.mm (230830 => 230831)
--- trunk/Source/WebKitLegacy/mac/DOM/DOMUtility.mm 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebKitLegacy/mac/DOM/DOMUtility.mm 2018-04-20 02:15:39 UTC (rev 230831)
@@ -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 @@
WRAP(DeprecatedCSSOMValue)
WRAP(DeprecatedCSSOMCounter)
WRAP(DOMImplementation)
- WRAP(DOMWindowProxy)
WRAP(Event)
WRAP(HTMLOptionsCollection)
WRAP(MediaList)
@@ -99,6 +98,7 @@
WRAP(StyleSheet)
WRAP(StyleSheetList)
WRAP(TreeWalker)
+ WRAP(WindowProxy)
WRAP(XPathExpression)
WRAP(XPathResult)
Modified: trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm (230830 => 230831)
--- trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebFrame.mm 2018-04-20 02:15:39 UTC (rev 230831)
@@ -2092,8 +2092,8 @@
// 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 @"";
Modified: trunk/Source/WebKitLegacy/win/ChangeLog (230830 => 230831)
--- trunk/Source/WebKitLegacy/win/ChangeLog 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebKitLegacy/win/ChangeLog 2018-04-20 02:15:39 UTC (rev 230831)
@@ -1,3 +1,15 @@
+2018-04-19 Chris Dumez <cdu...@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 <jbed...@apple.com>
Unreviewed rollout of r230632. Regression in memory usage.
Modified: trunk/Source/WebKitLegacy/win/WebFrame.cpp (230830 => 230831)
--- trunk/Source/WebKitLegacy/win/WebFrame.cpp 2018-04-20 01:45:21 UTC (rev 230830)
+++ trunk/Source/WebKitLegacy/win/WebFrame.cpp 2018-04-20 02:15:39 UTC (rev 230831)
@@ -2003,8 +2003,8 @@
// 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;