WebKit Bugzilla
Attachment 339051 Details for
Bug 185102
: Drop toJS() functions taking a DOMWindow parameter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185102-20180427193609.patch (text/plain), 7.85 KB, created by
Chris Dumez
on 2018-04-27 19:36:10 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-04-27 19:36:10 PDT
Size:
7.85 KB
patch
obsolete
>Subversion Revision: 231114 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 655d0a1e662ed86a3f1f7f41ed5b64a6c62b7ff5..49cc66c12d256b7540aa351a3bcca0492cabd7bc 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2018-04-27 Chris Dumez <cdumez@apple.com> >+ >+ Drop toJS() functions taking a DOMWindow parameter >+ https://bugs.webkit.org/show_bug.cgi?id=185102 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Drop toJS() functions taking a DOMWindow parameter as our implementation should always >+ be returning WindowProxy objects now. >+ >+ * bindings/js/JSDOMWindowBase.cpp: >+ * bindings/js/JSDOMWindowBase.h: >+ * bindings/js/JSDOMWindowCustom.cpp: >+ (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): >+ (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): >+ * bindings/js/JSDOMWindowProperties.cpp: >+ (WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter): >+ * bindings/js/JSDocumentCustom.cpp: >+ (WebCore::cachedDocumentWrapper): >+ * bindings/scripts/CodeGeneratorJS.pm: >+ (AddToIncludesForIDLType): >+ > 2018-04-27 Chris Dumez <cdumez@apple.com> > > Use WindowProxy instead of DOMWindow in our IDL >diff --git a/Source/WebCore/bindings/js/JSDOMWindowBase.cpp b/Source/WebCore/bindings/js/JSDOMWindowBase.cpp >index da35c16813b79259c2ebd4193a4dfe724e588d15..dd7a76c9de302a9438ca67b532d6d3a40673f78a 100644 >--- a/Source/WebCore/bindings/js/JSDOMWindowBase.cpp >+++ b/Source/WebCore/bindings/js/JSDOMWindowBase.cpp >@@ -248,14 +248,6 @@ JSWindowProxy* JSDOMWindowBase::proxy() const > return m_proxy; > } > >-JSValue toJS(ExecState* state, DOMWindow& domWindow) >-{ >- auto* frame = domWindow.frame(); >- if (!frame) >- return jsNull(); >- return toJS(state, frame->windowProxy()); >-} >- > JSDOMWindow* toJSDOMWindow(Frame& frame, DOMWrapperWorld& world) > { > return frame.script().globalObject(world); >diff --git a/Source/WebCore/bindings/js/JSDOMWindowBase.h b/Source/WebCore/bindings/js/JSDOMWindowBase.h >index f5709a9fca0951a04ad17f60fa53e5e3624bf6e0..5b05cb73dd8773f074dc2167b49ec040d27855b4 100644 >--- a/Source/WebCore/bindings/js/JSDOMWindowBase.h >+++ b/Source/WebCore/bindings/js/JSDOMWindowBase.h >@@ -100,13 +100,6 @@ private: > JSWindowProxy* m_proxy; > }; > >-WEBCORE_EXPORT JSC::JSValue toJS(JSC::ExecState*, DOMWindow&); >-// 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(); } >-inline JSC::JSValue toJS(JSC::ExecState* state, DOMWindow* window) { return window ? toJS(state, *window) : JSC::jsNull(); } >- > // The following return a JSDOMWindow or nullptr. > JSDOMWindow* toJSDOMWindow(Frame&, DOMWrapperWorld&); > inline JSDOMWindow* toJSDOMWindow(Frame* frame, DOMWrapperWorld& world) { return frame ? toJSDOMWindow(*frame, world) : nullptr; } >diff --git a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >index 281ea4e7004593eb6dea541c74b5bca4ae5dfa60..32121eadb071eb369a057f5f4fb6c84df433546b 100644 >--- a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >+++ b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp >@@ -148,7 +148,7 @@ bool jsDOMWindowGetOwnPropertySlotRestrictedAccess(JSDOMGlobalObject* thisObject > // FIXME: Add support to named attributes on RemoteFrames. > if (frame && is<Frame>(*frame)) { > if (auto* scopedChild = downcast<Frame>(*frame).tree().scopedChild(propertyNameToAtomicString(propertyName))) { >- slot.setValue(thisObject, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::DontEnum, toJS(exec, scopedChild->document()->domWindow())); >+ slot.setValue(thisObject, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::DontEnum, toJS(exec, scopedChild->windowProxy())); > return true; > } > } >@@ -221,7 +221,7 @@ bool JSDOMWindow::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, > // (1) First, indexed properties. > // These are also allowed cross-orgin, so come before the access check. > if (frame && index < frame->tree().scopedChildCount()) { >- slot.setValue(thisObject, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly), toJS(state, frame->tree().scopedChild(index)->document()->domWindow())); >+ slot.setValue(thisObject, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly), toJS(state, frame->tree().scopedChild(index)->windowProxy())); > return true; > } > >diff --git a/Source/WebCore/bindings/js/JSDOMWindowProperties.cpp b/Source/WebCore/bindings/js/JSDOMWindowProperties.cpp >index e9eedc82d9a6259c675a677763d65089a27993c4..e83f01baf5d7a5cb44ab0705487092f0de4bdfbd 100644 >--- a/Source/WebCore/bindings/js/JSDOMWindowProperties.cpp >+++ b/Source/WebCore/bindings/js/JSDOMWindowProperties.cpp >@@ -48,7 +48,7 @@ static bool jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter(JSDOMWindowPr > // properties that are in Moz but not IE. Since we have some of these, we have to do it > // the Moz way. > if (auto* scopedChild = frame.tree().scopedChild(propertyNameToAtomicString(propertyName))) { >- slot.setValue(thisObject, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::DontEnum, toJS(exec, scopedChild->document()->domWindow())); >+ slot.setValue(thisObject, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::DontEnum, toJS(exec, scopedChild->windowProxy())); > return true; > } > >diff --git a/Source/WebCore/bindings/js/JSDocumentCustom.cpp b/Source/WebCore/bindings/js/JSDocumentCustom.cpp >index 6605f1e7ff2f9576ff89fe70f1a348ee4c8bdf3c..4bd3b972ec5c0d1f18f1db155c18f23e86d604d4 100644 >--- a/Source/WebCore/bindings/js/JSDocumentCustom.cpp >+++ b/Source/WebCore/bindings/js/JSDocumentCustom.cpp >@@ -23,6 +23,7 @@ > #include "Frame.h" > #include "JSDOMWindowCustom.h" > #include "JSHTMLDocument.h" >+#include "JSWindowProxy.h" > #include "JSXMLDocument.h" > #include "NodeTraversal.h" > #include "SVGDocument.h" >@@ -52,12 +53,12 @@ JSObject* cachedDocumentWrapper(ExecState& state, JSDOMGlobalObject& globalObjec > if (auto* wrapper = getCachedWrapper(globalObject.world(), document)) > return wrapper; > >- auto* window = document.domWindow(); >- if (!window) >+ auto* windowProxy = document.windowProxy(); >+ if (!windowProxy) > return nullptr; > >- // Creating a wrapper for domWindow might have created a wrapper for document as well. >- return getCachedWrapper(toJSDOMWindow(state.vm(), toJS(&state, *window))->world(), document); >+ // Creating a wrapper for windowProxy might have created a wrapper for document as well. >+ return getCachedWrapper(toJSDOMWindow(state.vm(), toJS(&state, *windowProxy))->world(), document); > } > > void reportMemoryForDocumentIfFrameless(ExecState& state, Document& document) >diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >index 30a374c2824fa2608242aa38710984202b5d0ec0..0d307da776822e116fcfdd9fd4c9ac609902cdee 100644 >--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm >@@ -302,6 +302,8 @@ sub AddToImplIncludesForIDLType > sub AddToIncludesForIDLType > { > my ($type, $includesRef, $conditional) = @_; >+ >+ die "WindowProxy should be used instead of DOMWindow in the IDL" if $type->name eq "DOMWindow"; > > if ($type->isNullable) { > AddToIncludes("JSDOMConvertNullable.h", $includesRef, $conditional);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185102
: 339051 |
339054
|
339055
|
339057