Changeset 285639 in webkit
- Timestamp:
- Nov 11, 2021, 10:29:14 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 44 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/Geolocation/callback-to-deleted-context-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/Geolocation/callback-to-deleted-context.html (modified) (2 diffs)
-
LayoutTests/fast/dom/Geolocation/resources/callback-to-deleted-context-inner1.html (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/dom/traversal/support/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context-subframe.html (added)
-
LayoutTests/imported/w3c/web-platform-tests/dom/traversal/support/TreeWalker-acceptNode-filter-cross-realm-subframe.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/geolocation/PositionErrorCallback.idl (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp (modified) (3 diffs)
-
Source/WebCore/Modules/webaudio/AudioWorkletProcessor.cpp (modified) (4 diffs)
-
Source/WebCore/Modules/webaudio/AudioWorkletProcessor.h (modified) (2 diffs)
-
Source/WebCore/bindings/js/JSAudioWorkletProcessorCustom.cpp (modified) (1 diff)
-
Source/WebCore/bindings/js/JSCallbackData.cpp (modified) (1 diff)
-
Source/WebCore/bindings/js/JSCallbackData.h (modified) (6 diffs)
-
Source/WebCore/bindings/js/JSDOMConvertCallbacks.h (modified) (4 diffs)
-
Source/WebCore/bindings/js/JSDOMConvertXPathNSResolver.h (modified) (1 diff)
-
Source/WebCore/bindings/js/JSDOMGlobalObject.cpp (modified) (1 diff)
-
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (modified) (1 diff)
-
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (modified) (8 diffs)
-
Source/WebCore/bindings/scripts/IDLAttributes.json (modified) (1 diff)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp (modified) (3 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h (modified) (2 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp (modified) (3 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h (modified) (2 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionSkipCallbackInvokeCheck.cpp (added)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionSkipCallbackInvokeCheck.h (added)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp (modified) (3 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h (modified) (2 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp (modified) (3 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h (modified) (2 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp (modified) (17 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h (modified) (2 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary.cpp (modified) (2 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary2.cpp (modified) (3 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary.cpp (modified) (2 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary2.cpp (modified) (1 diff)
-
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (modified) (15 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp (modified) (2 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp (modified) (1 diff)
-
Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp (modified) (3 diffs)
-
Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.h (modified) (2 diffs)
-
Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep (modified) (1 diff)
-
Source/WebCore/bindings/scripts/test/TestCallbackFunctionSkipCallbackInvokeCheck.idl (added)
-
Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl (modified) (1 diff)
-
Source/WebCore/dom/NodeFilter.idl (modified) (2 diffs)
-
Source/WebCore/workers/WorkerOrWorkletGlobalScope.h (modified) (2 diffs)
-
Source/WebCore/worklets/PaintWorkletGlobalScope.cpp (modified) (1 diff)
-
Source/WebCore/xml/CustomXPathNSResolver.idl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r285638 r285639 1 2021-11-11 Alexey Shvayka <ashvayka@apple.com> 2 3 JSCallbackData should use lexical global object for errors and lifecycle 4 https://bugs.webkit.org/show_bug.cgi?id=232387 5 6 Reviewed by Geoff Garen. 7 8 * fast/dom/Geolocation/callback-to-deleted-context-expected.txt: 9 * fast/dom/Geolocation/callback-to-deleted-context.html: 10 * fast/dom/Geolocation/resources/callback-to-deleted-context-inner1.html: 11 1 12 2021-11-11 Tim Nguyen <ntim@apple.com> 2 13 -
trunk/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context-expected.txt
r281520 r285639 1 1 frame "<!--frame1-->" - has 1 onunload handler(s) 2 Tests that when a Geolocation request is made from a remote frame, and that frame's script context goes away before the Geolocation callback is made, the callback is not made. If the callback is attempted, a crash will occur.2 Tests that when a Geolocation request is made from a remote frame, callbacks are made as usual even if that frame's browsing context is already null. 3 3 4 4 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 5 5 6 6 7 PASS No callbacksinvoked7 PASS Success callback invoked 8 8 PASS successfullyParsed is true 9 9 -
trunk/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context.html
r281520 r285639 6 6 <body> 7 7 <script> 8 description("Tests that when a Geolocation request is made from a remote frame, and that frame's script context goes away before the Geolocation callback is made, the callback is not made. If the callback is attempted, a crash will occur.");8 description("Tests that when a Geolocation request is made from a remote frame, callbacks are made as usual even if that frame's browsing context is already null."); 9 9 10 10 function onFirstIframeLoaded() { … … 14 14 function onSecondIframeLoaded() { 15 15 window.setTimeout(function() { 16 test Passed('No callbacks invoked');16 testFailed('No callbacks invoked'); 17 17 finishJSTest(); 18 18 }, 500); -
trunk/LayoutTests/fast/dom/Geolocation/resources/callback-to-deleted-context-inner1.html
r281520 r285639 14 14 // object attempts to invoke the callback. 15 15 window.parent.navigator.geolocation.getCurrentPosition(function() { 16 parent.test Failed('Success callback invoked unexpectedly');16 parent.testPassed('Success callback invoked'); 17 17 parent.finishJSTest(); 18 18 }, function() { -
trunk/LayoutTests/imported/w3c/ChangeLog
r285638 r285639 1 2021-11-11 Alexey Shvayka <ashvayka@apple.com> 2 3 JSCallbackData should use lexical global object for errors and lifecycle 4 https://bugs.webkit.org/show_bug.cgi?id=232387 5 6 Reviewed by Geoff Garen. 7 8 * web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-expected.txt: Added. 9 * web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context-expected.txt: Added. 10 * web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context.html: Added. 11 * web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm.html: Added. 12 * web-platform-tests/dom/traversal/support/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context-subframe.html: Added. 13 * web-platform-tests/dom/traversal/support/TreeWalker-acceptNode-filter-cross-realm-subframe.html: Added. 14 1 15 2021-11-11 Tim Nguyen <ntim@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r285638 r285639 1 2021-11-11 Alexey Shvayka <ashvayka@apple.com> 2 3 JSCallbackData should use lexical global object for errors and lifecycle 4 https://bugs.webkit.org/show_bug.cgi?id=232387 5 6 Reviewed by Geoff Garen. 7 8 Currently, JSCallbackData uses incumbent [1] global object pretty much for everything, 9 which causes a few issues: 10 11 1) TypeErrors are constructed in incorrect realm; 12 2) NodeFilter / XPathNSResolver crash if their incumbent window gets disconnected; 13 3) other callbacks, originated in detached frame, were not invoked at all. 14 15 Since not all handleEvent() callers have ScriptExecutionContext, and to avoid a large 16 code diff, this patch utilizes callback wrapper's ScriptExecutionContext to fix all 17 the above-mentioned problems. 18 19 To accomodate NodeFilter and XPathNSResolver of detached frames without growing `sizeof` 20 of all other other callbacks, m_globalObject member is introduced only for them. 21 22 AudioWorklet changes are unobservable as worklets can't acquire a cross-realm method. 23 24 [1] https://html.spec.whatwg.org/multipage/webappapis.html#incumbent 25 26 Tests: fast/dom/Geolocation/callback-to-deleted-context.html 27 imported/w3c/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context.html 28 imported/w3c/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm.html 29 30 * Modules/geolocation/PositionErrorCallback.idl: 31 * Modules/webaudio/AudioWorkletGlobalScope.cpp: 32 (WebCore::AudioWorkletGlobalScope::registerProcessor): 33 (WebCore::AudioWorkletGlobalScope::createProcessor): 34 * Modules/webaudio/AudioWorkletProcessor.cpp: 35 (WebCore::AudioWorkletProcessor::create): 36 (WebCore::AudioWorkletProcessor::AudioWorkletProcessor): 37 (WebCore::AudioWorkletProcessor::process): 38 (WebCore::AudioWorkletProcessor::setProcessCallback): 39 * Modules/webaudio/AudioWorkletProcessor.h: 40 (WebCore::AudioWorkletProcessor::processCallbackWrapper): 41 * bindings/js/JSAudioWorkletProcessorCustom.cpp: 42 (WebCore::JSAudioWorkletProcessor::visitAdditionalChildren): 43 * bindings/js/JSCallbackData.cpp: 44 (WebCore::JSCallbackData::invokeCallback): 45 * bindings/js/JSCallbackData.h: 46 (WebCore::JSCallbackData::JSCallbackData): 47 (WebCore::JSCallbackData::~JSCallbackData): 48 (WebCore::JSCallbackDataStrong::JSCallbackDataStrong): 49 (WebCore::JSCallbackDataStrong::invokeCallback): 50 (WebCore::JSCallbackDataWeak::JSCallbackDataWeak): 51 (WebCore::JSCallbackDataWeak::invokeCallback): 52 (WebCore::JSCallbackData::globalObject): Deleted. 53 * bindings/js/JSDOMConvertCallbacks.h: 54 (WebCore::Converter<IDLCallbackFunction<T>>::convert): 55 (WebCore::Converter<IDLCallbackInterface<T>>::convert): 56 * bindings/js/JSDOMConvertXPathNSResolver.h: 57 (WebCore::Converter<IDLInterface<XPathNSResolver>>::convert): 58 * bindings/js/JSDOMGlobalObject.cpp: 59 (WebCore::JSC_DEFINE_HOST_FUNCTION): 60 * bindings/js/JSDOMWindowCustom.cpp: 61 (WebCore::jsDOMWindowInstanceFunction_openDatabaseBody): 62 * bindings/scripts/CodeGeneratorJS.pm: 63 (GenerateCallbackHeaderContent): 64 (GenerateCallbackImplementationContent): 65 (JSValueToNativeDOMConvertNeedsGlobalObject): 66 * bindings/scripts/IDLAttributes.json: 67 * bindings/scripts/test/JS/*: Updated. 68 * bindings/scripts/test/TestCallbackFunctionSkipCallbackInvokeCheck.idl: Added. 69 * bindings/scripts/test/TestCallbackInterface.idl: 70 * dom/NodeFilter.idl: 71 * workers/WorkerOrWorkletGlobalScope.h: 72 * worklets/PaintWorkletGlobalScope.cpp: 73 (WebCore::PaintWorkletGlobalScope::registerPaint): 74 * xml/CustomXPathNSResolver.idl: 75 1 76 2021-11-11 Tim Nguyen <ntim@apple.com> 2 77 -
trunk/Source/WebCore/Modules/geolocation/PositionErrorCallback.idl
r266311 r285639 25 25 [ 26 26 Conditional=GEOLOCATION, 27 SkipCallbackInvokeCheck, 27 28 ] callback PositionErrorCallback = undefined (GeolocationPositionError error); -
trunk/Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp
r278185 r285639 78 78 79 79 JSC::JSObject* jsConstructor = processorContructor->callbackData()->callback(); 80 auto* globalObject = jsConstructor->globalObject();80 auto* globalObject = scriptExecutionContext()->globalObject(); 81 81 auto& vm = globalObject->vm(); 82 82 auto scope = DECLARE_THROW_SCOPE(vm); … … 134 134 135 135 JSC::JSObject* jsConstructor = constructor->callbackData()->callback(); 136 auto* globalObject = constructor->callbackData()->globalObject();136 auto* globalObject = scriptExecutionContext()->globalObject(); 137 137 JSC::VM& vm = globalObject->vm(); 138 138 auto scope = DECLARE_THROW_SCOPE(vm); … … 155 155 return nullptr; 156 156 157 jsProcessor->wrapped().setProcessCallback( makeUnique<JSCallbackDataStrong>(jsProcessor, globalObject));157 jsProcessor->wrapped().setProcessCallback(jsProcessor); 158 158 159 159 return &jsProcessor->wrapped(); -
trunk/Source/WebCore/Modules/webaudio/AudioWorkletProcessor.cpp
r282707 r285639 202 202 return Exception { TypeError, "No pending construction data for this worklet processor"_s }; 203 203 204 return adoptRef(*new AudioWorkletProcessor( *constructionData));204 return adoptRef(*new AudioWorkletProcessor(context, *constructionData)); 205 205 } 206 206 207 207 AudioWorkletProcessor::~AudioWorkletProcessor() = default; 208 208 209 AudioWorkletProcessor::AudioWorkletProcessor(const AudioWorkletProcessorConstructionData& constructionData) 210 : m_name(constructionData.name()) 209 AudioWorkletProcessor::AudioWorkletProcessor(ScriptExecutionContext& context, const AudioWorkletProcessorConstructionData& constructionData) 210 : m_scriptExecutionContext(context) 211 , m_name(constructionData.name()) 211 212 , m_port(constructionData.port()) 212 213 { … … 237 238 238 239 ASSERT(m_processCallback); 239 auto& globalObject = * m_processCallback->globalObject();240 auto& globalObject = *jsCast<JSDOMGlobalObject*>(m_scriptExecutionContext.globalObject()); 240 241 ASSERT(globalObject.scriptExecutionContext()); 241 242 ASSERT(globalObject.scriptExecutionContext()->isContextThread()); … … 248 249 249 250 NakedPtr<JSC::Exception> returnedException; 250 auto result = m_processCallback->invokeCallback(jsUndefined(), args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "process"), returnedException);251 auto result = JSCallbackData::invokeCallback(globalObject, nullptr, asObject(m_processCallback), jsUndefined(), args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "process"), returnedException); 251 252 if (returnedException) { 252 253 reportException(&globalObject, returnedException); … … 260 261 } 261 262 262 void AudioWorkletProcessor::setProcessCallback( std::unique_ptr<JSCallbackDataStrong>&&processCallback)263 { 264 m_processCallback = WTFMove(processCallback);263 void AudioWorkletProcessor::setProcessCallback(JSObject* processCallback) 264 { 265 m_processCallback = { processCallback }; 265 266 } 266 267 -
trunk/Source/WebCore/Modules/webaudio/AudioWorkletProcessor.h
r282707 r285639 60 60 bool process(const Vector<RefPtr<AudioBus>>& inputs, Vector<Ref<AudioBus>>& outputs, const HashMap<String, std::unique_ptr<AudioFloatArray>>& paramValuesMap, bool& threwException); 61 61 62 void setProcessCallback( std::unique_ptr<JSCallbackDataStrong>&&);62 void setProcessCallback(JSC::JSObject*); 63 63 64 JSValueInWrappedObject& processCallbackWrapper() { return m_processCallback; } 64 65 JSValueInWrappedObject& jsInputsWrapper() { return m_jsInputs; } 65 66 JSValueInWrappedObject& jsOutputsWrapper() { return m_jsOutputs; } … … 67 68 68 69 private: 69 explicit AudioWorkletProcessor( const AudioWorkletProcessorConstructionData&);70 explicit AudioWorkletProcessor(ScriptExecutionContext&, const AudioWorkletProcessorConstructionData&); 70 71 void buildJSArguments(JSC::VM&, JSC::JSGlobalObject&, JSC::MarkedArgumentBufferBase&, const Vector<RefPtr<AudioBus>>& inputs, Vector<Ref<AudioBus>>& outputs, const HashMap<String, std::unique_ptr<AudioFloatArray>>& paramValuesMap); 71 72 73 ScriptExecutionContext& m_scriptExecutionContext; 72 74 String m_name; 73 75 Ref<MessagePort> m_port; 74 std::unique_ptr<JSCallbackDataStrong>m_processCallback;76 JSValueInWrappedObject m_processCallback; 75 77 JSValueInWrappedObject m_jsInputs; 76 78 JSValueInWrappedObject m_jsOutputs; -
trunk/Source/WebCore/bindings/js/JSAudioWorkletProcessorCustom.cpp
r273138 r285639 36 36 { 37 37 auto& processor = wrapped(); 38 processor.processCallbackWrapper().visit(visitor); 38 39 processor.jsInputsWrapper().visit(visitor); 39 40 processor.jsOutputsWrapper().visit(visitor); -
trunk/Source/WebCore/bindings/js/JSCallbackData.cpp
r285098 r285639 40 40 41 41 // https://webidl.spec.whatwg.org/#call-a-user-objects-operation 42 JSValue JSCallbackData::invokeCallback(JSDOMGlobalObject& globalObject, JS Object* callback, JSValue thisValue, MarkedArgumentBuffer& args, CallbackType method, PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)42 JSValue JSCallbackData::invokeCallback(JSDOMGlobalObject& globalObject, JSDOMGlobalObject*, JSObject* callback, JSValue thisValue, MarkedArgumentBuffer& args, CallbackType method, PropertyName functionName, NakedPtr<JSC::Exception>& returnedException) 43 43 { 44 44 ASSERT(callback); -
trunk/Source/WebCore/bindings/js/JSCallbackData.h
r273138 r285639 48 48 enum class CallbackType { Function, Object, FunctionOrObject }; 49 49 50 JSDOMGlobalObject* globalObject() { return m_globalObject.get(); } 51 50 WEBCORE_EXPORT static JSC::JSValue invokeCallback(JSDOMGlobalObject&, JSDOMGlobalObject* incumbentGlobalObject, JSC::JSObject* callback, JSC::JSValue thisValue, JSC::MarkedArgumentBuffer&, CallbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException); 52 51 protected: 53 explicit JSCallbackData(JSDOMGlobalObject* globalObject)54 : m_ globalObject(globalObject)52 explicit JSCallbackData(JSDOMGlobalObject* incumbentGlobalObject) 53 : m_incumbentGlobalObject(incumbentGlobalObject) 55 54 { 56 55 } … … 62 61 #endif 63 62 } 64 65 WEBCORE_EXPORT static JSC::JSValue invokeCallback(JSDOMGlobalObject&, JSC::JSObject* callback, JSC::JSValue thisValue, JSC::MarkedArgumentBuffer&, CallbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException);66 63 64 JSC::Weak<JSDOMGlobalObject> m_incumbentGlobalObject; 67 65 private: 68 JSC::Weak<JSDOMGlobalObject> m_globalObject;69 66 #if ASSERT_ENABLED 70 67 Ref<Thread> m_thread { Thread::current() }; … … 74 71 class JSCallbackDataStrong : public JSCallbackData { 75 72 public: 76 JSCallbackDataStrong(JSC::JSObject* callback, JSDOMGlobalObject* globalObject, void* = nullptr)77 : JSCallbackData( globalObject)78 , m_callback( globalObject->vm(), callback)73 JSCallbackDataStrong(JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject, void* = nullptr) 74 : JSCallbackData(incumbentGlobalObject) 75 , m_callback(incumbentGlobalObject->vm(), callback) 79 76 { 80 77 } … … 82 79 JSC::JSObject* callback() { return m_callback.get(); } 83 80 84 JSC::JSValue invokeCallback(JS C::JSValue thisValue, JSC::MarkedArgumentBuffer& args, CallbackType callbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)81 JSC::JSValue invokeCallback(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSValue thisValue, JSC::MarkedArgumentBuffer& args, CallbackType callbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException) 85 82 { 86 auto* globalObject = this->globalObject(); 87 if (!globalObject) 88 return { }; 89 90 return JSCallbackData::invokeCallback(*globalObject, callback(), thisValue, args, callbackType, functionName, returnedException); 83 return JSCallbackData::invokeCallback(lexicalGlobalObject, m_incumbentGlobalObject.get(), callback(), thisValue, args, callbackType, functionName, returnedException); 91 84 } 92 85 … … 97 90 class JSCallbackDataWeak : public JSCallbackData { 98 91 public: 99 JSCallbackDataWeak(JSC::JSObject* callback, JSDOMGlobalObject* globalObject, void* owner)100 : JSCallbackData( globalObject)92 JSCallbackDataWeak(JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject, void* owner) 93 : JSCallbackData(incumbentGlobalObject) 101 94 , m_callback(callback, &m_weakOwner, owner) 102 95 { … … 105 98 JSC::JSObject* callback() { return m_callback.get(); } 106 99 107 JSC::JSValue invokeCallback(JS C::JSValue thisValue, JSC::MarkedArgumentBuffer& args, CallbackType callbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)100 JSC::JSValue invokeCallback(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSValue thisValue, JSC::MarkedArgumentBuffer& args, CallbackType callbackType, JSC::PropertyName functionName, NakedPtr<JSC::Exception>& returnedException) 108 101 { 109 auto* globalObject = this->globalObject(); 110 if (!globalObject) 111 return { }; 112 113 return JSCallbackData::invokeCallback(*globalObject, callback(), thisValue, args, callbackType, functionName, returnedException); 102 return JSCallbackData::invokeCallback(lexicalGlobalObject, m_incumbentGlobalObject.get(), callback(), thisValue, args, callbackType, functionName, returnedException); 114 103 } 115 104 -
trunk/Source/WebCore/bindings/js/JSDOMConvertCallbacks.h
r283410 r285639 36 36 37 37 template<typename ExceptionThrower = DefaultExceptionThrower> 38 static RefPtr<T> convert(JSC::JSGlobalObject& lexicalGlobalObject, JSC::JSValue value, JSDOMGlobalObject& globalObject,ExceptionThrower&& exceptionThrower = ExceptionThrower())38 static RefPtr<T> convert(JSC::JSGlobalObject& lexicalGlobalObject, JSC::JSValue value, ExceptionThrower&& exceptionThrower = ExceptionThrower()) 39 39 { 40 40 JSC::VM& vm = JSC::getVM(&lexicalGlobalObject); … … 46 46 } 47 47 48 return T::create(JSC::asObject(value), &callerGlobalObject(globalObject, vm.topCallFrame)); 48 auto& jsDOMGlobalObject = *JSC::jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject); 49 return T::create(jsDOMGlobalObject, JSC::asObject(value), &callerGlobalObject(jsDOMGlobalObject, vm.topCallFrame)); 49 50 } 50 51 }; … … 70 71 template<typename T> struct Converter<IDLCallbackInterface<T>> : DefaultConverter<IDLCallbackInterface<T>> { 71 72 template<typename ExceptionThrower = DefaultExceptionThrower> 72 static RefPtr<T> convert(JSC::JSGlobalObject& lexicalGlobalObject, JSC::JSValue value, JSDOMGlobalObject& globalObject,ExceptionThrower&& exceptionThrower = ExceptionThrower())73 static RefPtr<T> convert(JSC::JSGlobalObject& lexicalGlobalObject, JSC::JSValue value, ExceptionThrower&& exceptionThrower = ExceptionThrower()) 73 74 { 74 75 JSC::VM& vm = JSC::getVM(&lexicalGlobalObject); … … 80 81 } 81 82 82 return T::create(JSC::asObject(value), &callerGlobalObject(globalObject, vm.topCallFrame)); 83 auto& jsDOMGlobalObject = *JSC::jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject); 84 return T::create(jsDOMGlobalObject, JSC::asObject(value), &callerGlobalObject(jsDOMGlobalObject, vm.topCallFrame)); 83 85 } 84 86 }; -
trunk/Source/WebCore/bindings/js/JSDOMConvertXPathNSResolver.h
r265387 r285639 49 49 return &JSC::jsCast<JSXPathNSResolver*>(object)->wrapped(); 50 50 51 return JSCustomXPathNSResolver::create(object, JSC::jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject)); 51 auto& jsDOMGlobalObject = *JSC::jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject); 52 return JSCustomXPathNSResolver::create(jsDOMGlobalObject, object, &callerGlobalObject(jsDOMGlobalObject, vm.topCallFrame)); 52 53 } 53 54 }; -
trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
r285636 r285639 196 196 197 197 auto* jsDOMGlobalObject = JSC::jsCast<JSDOMGlobalObject*>(globalObject); 198 Ref<AbortAlgorithm> abortAlgorithm = JSAbortAlgorithm::create( callFrame->uncheckedArgument(1).getObject(), jsDOMGlobalObject);198 Ref<AbortAlgorithm> abortAlgorithm = JSAbortAlgorithm::create(*jsDOMGlobalObject, callFrame->uncheckedArgument(1).getObject(), jsDOMGlobalObject); 199 199 200 200 bool result = AbortSignal::whenSignalAborted(abortSignal->wrapped(), WTFMove(abortAlgorithm)); -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r284664 r285639 607 607 } 608 608 609 auto creationCallback = convert<IDLNullable<IDLCallbackFunction<JSDatabaseCallback>>>(*lexicalGlobalObject, callFrame->argument(4), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) {609 auto creationCallback = convert<IDLNullable<IDLCallbackFunction<JSDatabaseCallback>>>(*lexicalGlobalObject, callFrame->argument(4), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { 610 610 throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 4, "creationCallback", "Window", "openDatabase"); 611 611 }); -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r285252 r285639 6345 6345 6346 6346 # The static create() method. 6347 push(@$contentRef, " static Ref<$className> create(JS C::JSObject* callback, JSDOMGlobalObject* globalObject)\n");6347 push(@$contentRef, " static Ref<$className> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)\n"); 6348 6348 push(@$contentRef, " {\n"); 6349 push(@$contentRef, " return adoptRef(*new ${className}( callback, globalObject));\n");6349 push(@$contentRef, " return adoptRef(*new ${className}(globalObject, callback, incumbentGlobalObject));\n"); 6350 6350 push(@$contentRef, " }\n\n"); 6351 6352 push(@$contentRef, " ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }\n\n");6353 6351 6354 6352 push(@$contentRef, " ~$className() final;\n"); … … 6388 6386 push(@$contentRef, "\nprivate:\n"); 6389 6387 6390 push(@$contentRef, " ${className}(JS C::JSObject*, JSDOMGlobalObject*);\n\n");6388 push(@$contentRef, " ${className}(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject);\n\n"); 6391 6389 6392 6390 if ($interfaceOrCallback->extendedAttributes->{IsWeakCallback}) { … … 6397 6395 push(@$contentRef, " void visitJSFunction(JSC::SlotVisitor&) override;\n\n") if $interfaceOrCallback->extendedAttributes->{IsWeakCallback}; 6398 6396 6397 if ($interfaceOrCallback->extendedAttributes->{SkipCallbackInvokeCheck}) { 6398 push(@$contentRef, " JSDOMGlobalObject& globalObject() const { return *m_globalObject.get(); }\n\n"); 6399 } else { 6400 push(@$contentRef, " JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); }\n\n"); 6401 } 6402 6403 push(@$contentRef, " JSC::Strong<JSDOMGlobalObject> m_globalObject;\n") if $interfaceOrCallback->extendedAttributes->{SkipCallbackInvokeCheck}; 6399 6404 push(@$contentRef, " ${callbackDataType}* m_data;\n"); 6400 6405 push(@$contentRef, "};\n\n"); … … 6417 6422 6418 6423 # Constructor 6419 push(@$contentRef, "${className}::${className}(JSObject* callback, JSDOMGlobalObject* globalObject)\n"); 6420 push(@$contentRef, " : ${name}(globalObject->scriptExecutionContext())\n"); 6421 push(@$contentRef, " , m_data(new ${callbackDataType}(callback, globalObject, this))\n"); 6424 push(@$contentRef, "${className}::${className}(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)\n"); 6425 push(@$contentRef, " : ${name}(globalObject.scriptExecutionContext())\n"); 6426 push(@$contentRef, " , m_globalObject(globalObject.vm(), &globalObject)\n") if $interfaceOrCallback->extendedAttributes->{SkipCallbackInvokeCheck}; 6427 push(@$contentRef, " , m_data(new ${callbackDataType}(callback, incumbentGlobalObject, this))\n"); 6422 6428 push(@$contentRef, "{\n"); 6423 6429 push(@$contentRef, "}\n\n"); … … 6524 6530 # FIXME: This is needed for NodeFilter, which works even for disconnected iframes. We should investigate 6525 6531 # if that behavior is needed for other callbacks. 6526 if (!$ operation->extendedAttributes->{SkipCallbackInvokeCheck}) {6532 if (!$interfaceOrCallback->extendedAttributes->{SkipCallbackInvokeCheck}) { 6527 6533 push(@$contentRef, " if (!canInvokeCallback())\n"); 6528 6534 push(@$contentRef, " return CallbackResultType::UnableToExecute;\n\n"); … … 6530 6536 6531 6537 push(@$contentRef, " Ref<$className> protectedThis(*this);\n\n"); 6532 push(@$contentRef, " auto& globalObject = *m_data->globalObject();\n");6538 push(@$contentRef, " auto& globalObject = this->globalObject();\n"); 6533 6539 push(@$contentRef, " auto& vm = globalObject.vm();\n\n"); 6534 6540 push(@$contentRef, " JSLockHolder lock(vm);\n"); … … 6548 6554 my $callbackInvocation; 6549 6555 if (ref($interfaceOrCallback) eq "IDLCallbackFunction") { 6550 $callbackInvocation = "m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException)";6556 $callbackInvocation = "m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException)"; 6551 6557 } else { 6552 6558 my $callbackType = $numOperations > 1 ? "Object" : "FunctionOrObject"; 6553 $callbackInvocation = "m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::${callbackType}, Identifier::fromString(vm, \"${functionName}\"), returnedException)";6559 $callbackInvocation = "m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::${callbackType}, Identifier::fromString(vm, \"${functionName}\"), returnedException)"; 6554 6560 } 6555 6561 … … 7002 7008 my $type = shift; 7003 7009 7004 return 1 if $codeGenerator->IsCallbackInterface($type);7005 return 1 if $codeGenerator->IsCallbackFunction($type);7006 7010 return JSValueToNativeDOMConvertNeedsGlobalObject(@{$type->subtypes}[1]) if $codeGenerator->IsRecordType($type); 7007 7011 return 1 if $type->name eq "ScheduledAction"; -
trunk/Source/WebCore/bindings/scripts/IDLAttributes.json
r285098 r285639 479 479 }, 480 480 "SkipCallbackInvokeCheck": { 481 "contextsAllowed": [" operation", "callback-function"]481 "contextsAllowed": ["interface", "callback-function"] 482 482 }, 483 483 "SkipVTableValidation": { -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp
r267891 r285639 31 31 using namespace JSC; 32 32 33 JSTestCallbackFunction::JSTestCallbackFunction(JS Object* callback, JSDOMGlobalObject* globalObject)34 : TestCallbackFunction(globalObject ->scriptExecutionContext())35 , m_data(new JSCallbackDataStrong(callback, globalObject, this))33 JSTestCallbackFunction::JSTestCallbackFunction(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 34 : TestCallbackFunction(globalObject.scriptExecutionContext()) 35 , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this)) 36 36 { 37 37 } … … 58 58 Ref<JSTestCallbackFunction> protectedThis(*this); 59 59 60 auto& globalObject = *m_data->globalObject();60 auto& globalObject = this->globalObject(); 61 61 auto& vm = globalObject.vm(); 62 62 … … 69 69 70 70 NakedPtr<JSC::Exception> returnedException; 71 auto jsResult = m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);71 auto jsResult = m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException); 72 72 if (returnedException) { 73 73 reportException(&lexicalGlobalObject, returnedException); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h
r270115 r285639 30 30 class JSTestCallbackFunction final : public TestCallbackFunction { 31 31 public: 32 static Ref<JSTestCallbackFunction> create(JS C::JSObject* callback, JSDOMGlobalObject* globalObject)32 static Ref<JSTestCallbackFunction> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 33 33 { 34 return adoptRef(*new JSTestCallbackFunction( callback, globalObject));34 return adoptRef(*new JSTestCallbackFunction(globalObject, callback, incumbentGlobalObject)); 35 35 } 36 37 ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }38 36 39 37 ~JSTestCallbackFunction() final; … … 44 42 45 43 private: 46 JSTestCallbackFunction(JSC::JSObject*, JSDOMGlobalObject*); 44 JSTestCallbackFunction(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject); 45 46 JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); } 47 47 48 48 JSCallbackDataStrong* m_data; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp
r267891 r285639 34 34 using namespace JSC; 35 35 36 JSTestCallbackFunctionRethrow::JSTestCallbackFunctionRethrow(JS Object* callback, JSDOMGlobalObject* globalObject)37 : TestCallbackFunctionRethrow(globalObject ->scriptExecutionContext())38 , m_data(new JSCallbackDataStrong(callback, globalObject, this))36 JSTestCallbackFunctionRethrow::JSTestCallbackFunctionRethrow(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 37 : TestCallbackFunctionRethrow(globalObject.scriptExecutionContext()) 38 , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this)) 39 39 { 40 40 } … … 61 61 Ref<JSTestCallbackFunctionRethrow> protectedThis(*this); 62 62 63 auto& globalObject = *m_data->globalObject();63 auto& globalObject = this->globalObject(); 64 64 auto& vm = globalObject.vm(); 65 65 … … 72 72 73 73 NakedPtr<JSC::Exception> returnedException; 74 auto jsResult = m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);74 auto jsResult = m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException); 75 75 if (returnedException) { 76 76 auto throwScope = DECLARE_THROW_SCOPE(vm); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h
r270115 r285639 30 30 class JSTestCallbackFunctionRethrow final : public TestCallbackFunctionRethrow { 31 31 public: 32 static Ref<JSTestCallbackFunctionRethrow> create(JS C::JSObject* callback, JSDOMGlobalObject* globalObject)32 static Ref<JSTestCallbackFunctionRethrow> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 33 33 { 34 return adoptRef(*new JSTestCallbackFunctionRethrow( callback, globalObject));34 return adoptRef(*new JSTestCallbackFunctionRethrow(globalObject, callback, incumbentGlobalObject)); 35 35 } 36 37 ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }38 36 39 37 ~JSTestCallbackFunctionRethrow() final; … … 44 42 45 43 private: 46 JSTestCallbackFunctionRethrow(JSC::JSObject*, JSDOMGlobalObject*); 44 JSTestCallbackFunctionRethrow(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject); 45 46 JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); } 47 47 48 48 JSCallbackDataStrong* m_data; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp
r275422 r285639 35 35 using namespace JSC; 36 36 37 JSTestCallbackFunctionWithThisObject::JSTestCallbackFunctionWithThisObject(JS Object* callback, JSDOMGlobalObject* globalObject)38 : TestCallbackFunctionWithThisObject(globalObject ->scriptExecutionContext())39 , m_data(new JSCallbackDataStrong(callback, globalObject, this))37 JSTestCallbackFunctionWithThisObject::JSTestCallbackFunctionWithThisObject(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 38 : TestCallbackFunctionWithThisObject(globalObject.scriptExecutionContext()) 39 , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this)) 40 40 { 41 41 } … … 62 62 Ref<JSTestCallbackFunctionWithThisObject> protectedThis(*this); 63 63 64 auto& globalObject = *m_data->globalObject();64 auto& globalObject = this->globalObject(); 65 65 auto& vm = globalObject.vm(); 66 66 … … 73 73 74 74 NakedPtr<JSC::Exception> returnedException; 75 m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);75 m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException); 76 76 if (returnedException) { 77 77 reportException(&lexicalGlobalObject, returnedException); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h
r270115 r285639 30 30 class JSTestCallbackFunctionWithThisObject final : public TestCallbackFunctionWithThisObject { 31 31 public: 32 static Ref<JSTestCallbackFunctionWithThisObject> create(JS C::JSObject* callback, JSDOMGlobalObject* globalObject)32 static Ref<JSTestCallbackFunctionWithThisObject> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 33 33 { 34 return adoptRef(*new JSTestCallbackFunctionWithThisObject( callback, globalObject));34 return adoptRef(*new JSTestCallbackFunctionWithThisObject(globalObject, callback, incumbentGlobalObject)); 35 35 } 36 37 ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }38 36 39 37 ~JSTestCallbackFunctionWithThisObject() final; … … 44 42 45 43 private: 46 JSTestCallbackFunctionWithThisObject(JSC::JSObject*, JSDOMGlobalObject*); 44 JSTestCallbackFunctionWithThisObject(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject); 45 46 JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); } 47 47 48 48 JSCallbackDataStrong* m_data; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp
r275422 r285639 35 35 using namespace JSC; 36 36 37 JSTestCallbackFunctionWithTypedefs::JSTestCallbackFunctionWithTypedefs(JS Object* callback, JSDOMGlobalObject* globalObject)38 : TestCallbackFunctionWithTypedefs(globalObject ->scriptExecutionContext())39 , m_data(new JSCallbackDataStrong(callback, globalObject, this))37 JSTestCallbackFunctionWithTypedefs::JSTestCallbackFunctionWithTypedefs(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 38 : TestCallbackFunctionWithTypedefs(globalObject.scriptExecutionContext()) 39 , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this)) 40 40 { 41 41 } … … 62 62 Ref<JSTestCallbackFunctionWithTypedefs> protectedThis(*this); 63 63 64 auto& globalObject = *m_data->globalObject();64 auto& globalObject = this->globalObject(); 65 65 auto& vm = globalObject.vm(); 66 66 … … 74 74 75 75 NakedPtr<JSC::Exception> returnedException; 76 m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);76 m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException); 77 77 if (returnedException) { 78 78 reportException(&lexicalGlobalObject, returnedException); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h
r270115 r285639 30 30 class JSTestCallbackFunctionWithTypedefs final : public TestCallbackFunctionWithTypedefs { 31 31 public: 32 static Ref<JSTestCallbackFunctionWithTypedefs> create(JS C::JSObject* callback, JSDOMGlobalObject* globalObject)32 static Ref<JSTestCallbackFunctionWithTypedefs> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 33 33 { 34 return adoptRef(*new JSTestCallbackFunctionWithTypedefs( callback, globalObject));34 return adoptRef(*new JSTestCallbackFunctionWithTypedefs(globalObject, callback, incumbentGlobalObject)); 35 35 } 36 37 ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }38 36 39 37 ~JSTestCallbackFunctionWithTypedefs() final; … … 44 42 45 43 private: 46 JSTestCallbackFunctionWithTypedefs(JSC::JSObject*, JSDOMGlobalObject*); 44 JSTestCallbackFunctionWithTypedefs(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject); 45 46 JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); } 47 47 48 48 JSCallbackDataStrong* m_data; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp
r283233 r285639 121 121 } 122 122 123 JSTestCallbackInterface::JSTestCallbackInterface(JS Object* callback, JSDOMGlobalObject* globalObject)124 : TestCallbackInterface(globalObject ->scriptExecutionContext())125 , m_data(new JSCallbackDataStrong(callback, globalObject, this))123 JSTestCallbackInterface::JSTestCallbackInterface(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 124 : TestCallbackInterface(globalObject.scriptExecutionContext()) 125 , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this)) 126 126 { 127 127 } … … 184 184 Ref<JSTestCallbackInterface> protectedThis(*this); 185 185 186 auto& globalObject = *m_data->globalObject();187 auto& vm = globalObject.vm(); 188 189 JSLockHolder lock(vm); 190 auto& lexicalGlobalObject = globalObject; 191 JSValue thisValue = jsUndefined(); 192 MarkedArgumentBuffer args; 193 ASSERT(!args.hasOverflowed()); 194 195 NakedPtr<JSC::Exception> returnedException; 196 m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithNoParam"), returnedException);186 auto& globalObject = this->globalObject(); 187 auto& vm = globalObject.vm(); 188 189 JSLockHolder lock(vm); 190 auto& lexicalGlobalObject = globalObject; 191 JSValue thisValue = jsUndefined(); 192 MarkedArgumentBuffer args; 193 ASSERT(!args.hasOverflowed()); 194 195 NakedPtr<JSC::Exception> returnedException; 196 m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithNoParam"), returnedException); 197 197 if (returnedException) { 198 198 reportException(&lexicalGlobalObject, returnedException); … … 210 210 Ref<JSTestCallbackInterface> protectedThis(*this); 211 211 212 auto& globalObject = *m_data->globalObject();212 auto& globalObject = this->globalObject(); 213 213 auto& vm = globalObject.vm(); 214 214 … … 221 221 222 222 NakedPtr<JSC::Exception> returnedException; 223 m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithArrayParam"), returnedException);223 m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithArrayParam"), returnedException); 224 224 if (returnedException) { 225 225 reportException(&lexicalGlobalObject, returnedException); … … 237 237 Ref<JSTestCallbackInterface> protectedThis(*this); 238 238 239 auto& globalObject = *m_data->globalObject();239 auto& globalObject = this->globalObject(); 240 240 auto& vm = globalObject.vm(); 241 241 … … 249 249 250 250 NakedPtr<JSC::Exception> returnedException; 251 m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithSerializedScriptValueParam"), returnedException);251 m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithSerializedScriptValueParam"), returnedException); 252 252 if (returnedException) { 253 253 reportException(&lexicalGlobalObject, returnedException); … … 265 265 Ref<JSTestCallbackInterface> protectedThis(*this); 266 266 267 auto& globalObject = *m_data->globalObject();267 auto& globalObject = this->globalObject(); 268 268 auto& vm = globalObject.vm(); 269 269 … … 276 276 277 277 NakedPtr<JSC::Exception> returnedException; 278 m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithStringList"), returnedException);278 m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithStringList"), returnedException); 279 279 if (returnedException) { 280 280 reportException(&lexicalGlobalObject, returnedException); … … 292 292 Ref<JSTestCallbackInterface> protectedThis(*this); 293 293 294 auto& globalObject = *m_data->globalObject();294 auto& globalObject = this->globalObject(); 295 295 auto& vm = globalObject.vm(); 296 296 … … 303 303 304 304 NakedPtr<JSC::Exception> returnedException; 305 m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithBoolean"), returnedException);305 m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithBoolean"), returnedException); 306 306 if (returnedException) { 307 307 reportException(&lexicalGlobalObject, returnedException); … … 319 319 Ref<JSTestCallbackInterface> protectedThis(*this); 320 320 321 auto& globalObject = *m_data->globalObject();321 auto& globalObject = this->globalObject(); 322 322 auto& vm = globalObject.vm(); 323 323 … … 331 331 332 332 NakedPtr<JSC::Exception> returnedException; 333 m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackRequiresThisToPass"), returnedException);333 m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackRequiresThisToPass"), returnedException); 334 334 if (returnedException) { 335 335 reportException(&lexicalGlobalObject, returnedException); … … 347 347 Ref<JSTestCallbackInterface> protectedThis(*this); 348 348 349 auto& globalObject = *m_data->globalObject();350 auto& vm = globalObject.vm(); 351 352 JSLockHolder lock(vm); 353 auto& lexicalGlobalObject = globalObject; 354 JSValue thisValue = jsUndefined(); 355 MarkedArgumentBuffer args; 356 ASSERT(!args.hasOverflowed()); 357 358 NakedPtr<JSC::Exception> returnedException; 359 auto jsResult = m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithAReturnValue"), returnedException);349 auto& globalObject = this->globalObject(); 350 auto& vm = globalObject.vm(); 351 352 JSLockHolder lock(vm); 353 auto& lexicalGlobalObject = globalObject; 354 JSValue thisValue = jsUndefined(); 355 MarkedArgumentBuffer args; 356 ASSERT(!args.hasOverflowed()); 357 358 NakedPtr<JSC::Exception> returnedException; 359 auto jsResult = m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithAReturnValue"), returnedException); 360 360 if (returnedException) { 361 361 reportException(&lexicalGlobalObject, returnedException); … … 376 376 Ref<JSTestCallbackInterface> protectedThis(*this); 377 377 378 auto& globalObject = *m_data->globalObject();378 auto& globalObject = this->globalObject(); 379 379 auto& vm = globalObject.vm(); 380 380 … … 387 387 388 388 NakedPtr<JSC::Exception> returnedException; 389 auto jsResult = m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackThatRethrowsExceptions"), returnedException);389 auto jsResult = m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackThatRethrowsExceptions"), returnedException); 390 390 if (returnedException) { 391 391 auto throwScope = DECLARE_THROW_SCOPE(vm); … … 400 400 } 401 401 402 CallbackResult<typename IDLDOMString::ImplementationType> JSTestCallbackInterface::callbackThatSkipsInvokeCheck(typename IDLDictionary<TestCallbackInterface::Dictionary>::ParameterType dictionaryParam) 403 { 404 Ref<JSTestCallbackInterface> protectedThis(*this); 405 406 auto& globalObject = *m_data->globalObject(); 407 auto& vm = globalObject.vm(); 408 409 JSLockHolder lock(vm); 410 auto& lexicalGlobalObject = globalObject; 411 JSValue thisValue = jsUndefined(); 412 MarkedArgumentBuffer args; 413 args.append(toJS<IDLDictionary<TestCallbackInterface::Dictionary>>(lexicalGlobalObject, globalObject, dictionaryParam)); 414 ASSERT(!args.hasOverflowed()); 415 416 NakedPtr<JSC::Exception> returnedException; 417 auto jsResult = m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackThatSkipsInvokeCheck"), returnedException); 402 CallbackResult<typename IDLDOMString::ImplementationType> JSTestCallbackInterface::callbackWithThisObject(typename IDLInterface<TestNode>::ParameterType thisObject, typename IDLInterface<TestObj>::ParameterType testObjParam) 403 { 404 if (!canInvokeCallback()) 405 return CallbackResultType::UnableToExecute; 406 407 Ref<JSTestCallbackInterface> protectedThis(*this); 408 409 auto& globalObject = this->globalObject(); 410 auto& vm = globalObject.vm(); 411 412 JSLockHolder lock(vm); 413 auto& lexicalGlobalObject = globalObject; 414 JSValue thisValue = toJS<IDLInterface<TestNode>>(lexicalGlobalObject, globalObject, thisObject); 415 MarkedArgumentBuffer args; 416 args.append(toJS<IDLInterface<TestObj>>(lexicalGlobalObject, globalObject, testObjParam)); 417 ASSERT(!args.hasOverflowed()); 418 419 NakedPtr<JSC::Exception> returnedException; 420 auto jsResult = m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithThisObject"), returnedException); 418 421 if (returnedException) { 419 422 reportException(&lexicalGlobalObject, returnedException); … … 427 430 } 428 431 429 CallbackResult<typename IDLDOMString::ImplementationType> JSTestCallbackInterface::callbackWithThisObject(typename IDLInterface<TestNode>::ParameterType thisObject, typename IDLInterface<TestObj>::ParameterType testObjParam)430 {431 if (!canInvokeCallback())432 return CallbackResultType::UnableToExecute;433 434 Ref<JSTestCallbackInterface> protectedThis(*this);435 436 auto& globalObject = *m_data->globalObject();437 auto& vm = globalObject.vm();438 439 JSLockHolder lock(vm);440 auto& lexicalGlobalObject = globalObject;441 JSValue thisValue = toJS<IDLInterface<TestNode>>(lexicalGlobalObject, globalObject, thisObject);442 MarkedArgumentBuffer args;443 args.append(toJS<IDLInterface<TestObj>>(lexicalGlobalObject, globalObject, testObjParam));444 ASSERT(!args.hasOverflowed());445 446 NakedPtr<JSC::Exception> returnedException;447 auto jsResult = m_data->invokeCallback(thisValue, args, JSCallbackData::CallbackType::Object, Identifier::fromString(vm, "callbackWithThisObject"), returnedException);448 if (returnedException) {449 reportException(&lexicalGlobalObject, returnedException);450 return CallbackResultType::ExceptionThrown;451 }452 453 auto throwScope = DECLARE_THROW_SCOPE(vm);454 auto returnValue = convert<IDLDOMString>(lexicalGlobalObject, jsResult);455 RETURN_IF_EXCEPTION(throwScope, CallbackResultType::ExceptionThrown);456 return { WTFMove(returnValue) };457 }458 459 432 JSC::JSValue toJS(TestCallbackInterface& impl) 460 433 { -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h
r278253 r285639 34 34 class JSTestCallbackInterface final : public TestCallbackInterface { 35 35 public: 36 static Ref<JSTestCallbackInterface> create(JS C::JSObject* callback, JSDOMGlobalObject* globalObject)36 static Ref<JSTestCallbackInterface> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 37 37 { 38 return adoptRef(*new JSTestCallbackInterface( callback, globalObject));38 return adoptRef(*new JSTestCallbackInterface(globalObject, callback, incumbentGlobalObject)); 39 39 } 40 41 ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }42 40 43 41 ~JSTestCallbackInterface() final; … … 55 53 CallbackResult<typename IDLDOMString::ImplementationType> callbackWithAReturnValue() override; 56 54 CallbackResult<typename IDLDOMString::ImplementationType> callbackThatRethrowsExceptions(typename IDLEnumeration<TestCallbackInterface::Enum>::ParameterType enumParam) override; 57 CallbackResult<typename IDLDOMString::ImplementationType> callbackThatSkipsInvokeCheck(typename IDLDictionary<TestCallbackInterface::Dictionary>::ParameterType dictionaryParam) override;58 55 CallbackResult<typename IDLDOMString::ImplementationType> callbackWithThisObject(typename IDLInterface<TestNode>::ParameterType thisObject, typename IDLInterface<TestObj>::ParameterType testObjParam) override; 59 56 60 57 private: 61 JSTestCallbackInterface(JSC::JSObject*, JSDOMGlobalObject*); 58 JSTestCallbackInterface(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject); 59 60 JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); } 62 61 63 62 JSCallbackDataStrong* m_data; -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary.cpp
r276949 r285639 66 66 } 67 67 if (!callbackMemberValue.isUndefined()) { 68 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue , *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));68 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue); 69 69 RETURN_IF_EXCEPTION(throwScope, { }); 70 70 } … … 101 101 } 102 102 if (!partialCallbackMemberValue.isUndefined()) { 103 result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue , *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));103 result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue); 104 104 RETURN_IF_EXCEPTION(throwScope, { }); 105 105 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary2.cpp
r276949 r285639 66 66 } 67 67 if (!callbackMemberValue.isUndefined()) { 68 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue , *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));68 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue); 69 69 RETURN_IF_EXCEPTION(throwScope, { }); 70 70 } … … 154 154 } 155 155 if (!callbackMemberValue.isUndefined()) { 156 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue , *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));156 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue); 157 157 RETURN_IF_EXCEPTION(throwScope, { }); 158 158 } … … 189 189 } 190 190 if (!partialCallbackMemberValue.isUndefined()) { 191 result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue , *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));191 result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue); 192 192 RETURN_IF_EXCEPTION(throwScope, { }); 193 193 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary.cpp
r276949 r285639 66 66 } 67 67 if (!callbackMemberValue.isUndefined()) { 68 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue , *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));68 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue); 69 69 RETURN_IF_EXCEPTION(throwScope, { }); 70 70 } … … 101 101 } 102 102 if (!partialCallbackMemberValue.isUndefined()) { 103 result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue , *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));103 result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue); 104 104 RETURN_IF_EXCEPTION(throwScope, { }); 105 105 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary2.cpp
r276949 r285639 64 64 } 65 65 if (!callbackMemberValue.isUndefined()) { 66 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue , *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));66 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue); 67 67 RETURN_IF_EXCEPTION(throwScope, { }); 68 68 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
r284213 r285639 2010 2010 auto& document = downcast<Document>(*context); 2011 2011 EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); 2012 auto testCallback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument0.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "testCallback", "TestObject", nullptr); });2012 auto testCallback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "testCallback", "TestObject", nullptr); }); 2013 2013 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 2014 2014 EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); 2015 auto testCallbackFunction = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, argument1.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 1, "testCallbackFunction", "TestObject", nullptr); });2015 auto testCallbackFunction = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, argument1.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 1, "testCallbackFunction", "TestObject", nullptr); }); 2016 2016 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 2017 2017 auto object = TestObj::create(document, testCallback.releaseNonNull(), testCallbackFunction.releaseNonNull()); … … 3444 3444 auto throwScope = DECLARE_THROW_SCOPE(vm); 3445 3445 auto& impl = thisObject.wrapped(); 3446 auto nativeValue = convert<IDLRecord<IDLDOMString, IDLCallbackFunction<JSVoidCallback>>>(lexicalGlobalObject, value , *thisObject.globalObject());3446 auto nativeValue = convert<IDLRecord<IDLDOMString, IDLCallbackFunction<JSVoidCallback>>>(lexicalGlobalObject, value); 3447 3447 RETURN_IF_EXCEPTION(throwScope, false); 3448 3448 invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { … … 6960 6960 return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); 6961 6961 EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); 6962 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument0.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithCallbackInterfaceArg"); });6962 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithCallbackInterfaceArg"); }); 6963 6963 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6964 6964 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithCallbackInterfaceArg(callback.releaseNonNull()); }))); … … 6980 6980 return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); 6981 6981 EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); 6982 auto callback = convert<IDLNullable<IDLCallbackInterface<JSTestCallbackInterface>>>(*lexicalGlobalObject, argument0.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithNullableCallbackInterfaceArg"); });6982 auto callback = convert<IDLNullable<IDLCallbackInterface<JSTestCallbackInterface>>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithNullableCallbackInterfaceArg"); }); 6983 6983 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 6984 6984 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithNullableCallbackInterfaceArg(WTFMove(callback)); }))); … … 7003 7003 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7004 7004 EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); 7005 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument1.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 1, "callback", "TestObject", "methodWithNonCallbackInterfaceArgAndCallbackInterfaceArg"); });7005 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument1.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 1, "callback", "TestObject", "methodWithNonCallbackInterfaceArgAndCallbackInterfaceArg"); }); 7006 7006 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7007 7007 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithNonCallbackInterfaceArgAndCallbackInterfaceArg(WTFMove(nonCallback), callback.releaseNonNull()); }))); … … 7021 7021 auto& impl = castedThis->wrapped(); 7022 7022 EnsureStillAliveScope argument0 = callFrame->argument(0); 7023 auto callback = argument0.value().isUndefined() ? Converter<IDLCallbackInterface<JSTestCallbackInterface>>::ReturnType() : convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument0.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithOptionalCallbackInterfaceArg"); });7023 auto callback = argument0.value().isUndefined() ? Converter<IDLCallbackInterface<JSTestCallbackInterface>>::ReturnType() : convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithOptionalCallbackInterfaceArg"); }); 7024 7024 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7025 7025 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithOptionalCallbackInterfaceArg(WTFMove(callback)); }))); … … 7039 7039 auto& impl = castedThis->wrapped(); 7040 7040 EnsureStillAliveScope argument0 = callFrame->argument(0); 7041 auto callback = convert<IDLNullable<IDLCallbackInterface<JSTestCallbackInterface>>>(*lexicalGlobalObject, argument0.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithOptionalNullableCallbackInterfaceArg"); });7041 auto callback = convert<IDLNullable<IDLCallbackInterface<JSTestCallbackInterface>>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithOptionalNullableCallbackInterfaceArg"); }); 7042 7042 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7043 7043 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithOptionalNullableCallbackInterfaceArg(WTFMove(callback)); }))); … … 7059 7059 return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); 7060 7060 EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); 7061 auto callback = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, argument0.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithCallbackFunctionArg"); });7061 auto callback = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithCallbackFunctionArg"); }); 7062 7062 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7063 7063 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithCallbackFunctionArg(callback.releaseNonNull()); }))); … … 7079 7079 return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); 7080 7080 EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); 7081 auto callback = convert<IDLNullable<IDLCallbackFunction<JSTestCallbackFunction>>>(*lexicalGlobalObject, argument0.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithNullableCallbackFunctionArg"); });7081 auto callback = convert<IDLNullable<IDLCallbackFunction<JSTestCallbackFunction>>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithNullableCallbackFunctionArg"); }); 7082 7082 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7083 7083 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithNullableCallbackFunctionArg(WTFMove(callback)); }))); … … 7102 7102 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7103 7103 EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); 7104 auto callback = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, argument1.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 1, "callback", "TestObject", "methodWithNonCallbackArgAndCallbackFunctionArg"); });7104 auto callback = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, argument1.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 1, "callback", "TestObject", "methodWithNonCallbackArgAndCallbackFunctionArg"); }); 7105 7105 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7106 7106 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithNonCallbackArgAndCallbackFunctionArg(WTFMove(nonCallback), callback.releaseNonNull()); }))); … … 7120 7120 auto& impl = castedThis->wrapped(); 7121 7121 EnsureStillAliveScope argument0 = callFrame->argument(0); 7122 auto callback = argument0.value().isUndefined() ? Converter<IDLCallbackFunction<JSTestCallbackFunction>>::ReturnType() : convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, argument0.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithOptionalCallbackFunctionArg"); });7122 auto callback = argument0.value().isUndefined() ? Converter<IDLCallbackFunction<JSTestCallbackFunction>>::ReturnType() : convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithOptionalCallbackFunctionArg"); }); 7123 7123 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7124 7124 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithOptionalCallbackFunctionArg(WTFMove(callback)); }))); … … 7138 7138 auto& impl = castedThis->wrapped(); 7139 7139 EnsureStillAliveScope argument0 = callFrame->argument(0); 7140 auto callback = convert<IDLNullable<IDLCallbackFunction<JSTestCallbackFunction>>>(*lexicalGlobalObject, argument0.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithOptionalNullableCallbackFunctionArg"); });7140 auto callback = convert<IDLNullable<IDLCallbackFunction<JSTestCallbackFunction>>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "methodWithOptionalNullableCallbackFunctionArg"); }); 7141 7141 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7142 7142 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithOptionalNullableCallbackFunctionArg(WTFMove(callback)); }))); … … 7155 7155 UNUSED_PARAM(callFrame); 7156 7156 EnsureStillAliveScope argument0 = callFrame->argument(0); 7157 auto callback = convert<IDLNullable<IDLCallbackInterface<JSTestCallbackInterface>>>(*lexicalGlobalObject, argument0.value(), *jsCast<JSDOMGlobalObject*>(lexicalGlobalObject),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "staticMethodWithCallbackAndOptionalArg"); });7157 auto callback = convert<IDLNullable<IDLCallbackInterface<JSTestCallbackInterface>>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "staticMethodWithCallbackAndOptionalArg"); }); 7158 7158 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7159 7159 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return TestObj::staticMethodWithCallbackAndOptionalArg(WTFMove(callback)); }))); … … 7174 7174 return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); 7175 7175 EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); 7176 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument0.value(), *jsCast<JSDOMGlobalObject*>(lexicalGlobalObject),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "staticMethodWithCallbackArg"); });7176 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "staticMethodWithCallbackArg"); }); 7177 7177 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7178 7178 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return TestObj::staticMethodWithCallbackArg(callback.releaseNonNull()); }))); … … 7304 7304 auto& impl = castedThis->wrapped(); 7305 7305 EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); 7306 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument0.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "overloadedMethod"); });7306 auto callback = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument0.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 0, "callback", "TestObject", "overloadedMethod"); }); 7307 7307 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 7308 7308 RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.overloadedMethod(callback.releaseNonNull()); }))); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp
r284213 r285639 76 76 } 77 77 if (!callbackMemberValue.isUndefined()) { 78 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue , *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));78 result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue); 79 79 RETURN_IF_EXCEPTION(throwScope, { }); 80 80 } … … 137 137 } 138 138 if (!partialCallbackMemberValue.isUndefined()) { 139 result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue , *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));139 result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue); 140 140 RETURN_IF_EXCEPTION(throwScope, { }); 141 141 } -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp
r284213 r285639 169 169 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 170 170 EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); 171 auto testCallbackFunction = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, argument1.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 1, "testCallbackFunction", "TestTypedefs", nullptr); });171 auto testCallbackFunction = convert<IDLCallbackFunction<JSTestCallbackFunction>>(*lexicalGlobalObject, argument1.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 1, "testCallbackFunction", "TestTypedefs", nullptr); }); 172 172 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 173 173 EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); 174 auto testCallbackInterface = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument2.value(), *castedThis->globalObject(),[](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 2, "testCallbackInterface", "TestTypedefs", nullptr); });174 auto testCallbackInterface = convert<IDLCallbackInterface<JSTestCallbackInterface>>(*lexicalGlobalObject, argument2.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 2, "testCallbackInterface", "TestTypedefs", nullptr); }); 175 175 RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); 176 176 auto object = TestTypedefs::create(WTFMove(hello), testCallbackFunction.releaseNonNull(), testCallbackInterface.releaseNonNull()); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp
r275422 r285639 42 42 using namespace JSC; 43 43 44 JSTestVoidCallbackFunction::JSTestVoidCallbackFunction(JS Object* callback, JSDOMGlobalObject* globalObject)45 : TestVoidCallbackFunction(globalObject ->scriptExecutionContext())46 , m_data(new JSCallbackDataStrong(callback, globalObject, this))44 JSTestVoidCallbackFunction::JSTestVoidCallbackFunction(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 45 : TestVoidCallbackFunction(globalObject.scriptExecutionContext()) 46 , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this)) 47 47 { 48 48 } … … 69 69 Ref<JSTestVoidCallbackFunction> protectedThis(*this); 70 70 71 auto& globalObject = *m_data->globalObject();71 auto& globalObject = this->globalObject(); 72 72 auto& vm = globalObject.vm(); 73 73 … … 85 85 86 86 NakedPtr<JSC::Exception> returnedException; 87 m_data->invokeCallback( thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException);87 m_data->invokeCallback(lexicalGlobalObject, thisValue, args, JSCallbackData::CallbackType::Function, Identifier(), returnedException); 88 88 if (returnedException) { 89 89 reportException(&lexicalGlobalObject, returnedException); -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.h
r270115 r285639 32 32 class JSTestVoidCallbackFunction final : public TestVoidCallbackFunction { 33 33 public: 34 static Ref<JSTestVoidCallbackFunction> create(JS C::JSObject* callback, JSDOMGlobalObject* globalObject)34 static Ref<JSTestVoidCallbackFunction> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject) 35 35 { 36 return adoptRef(*new JSTestVoidCallbackFunction( callback, globalObject));36 return adoptRef(*new JSTestVoidCallbackFunction(globalObject, callback, incumbentGlobalObject)); 37 37 } 38 39 ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }40 38 41 39 ~JSTestVoidCallbackFunction() final; … … 46 44 47 45 private: 48 JSTestVoidCallbackFunction(JSC::JSObject*, JSDOMGlobalObject*); 46 JSTestVoidCallbackFunction(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject); 47 48 JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); } 49 49 50 50 JSCallbackDataStrong* m_data; -
trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep
r285196 r285639 41 41 DOMTestCallbackFunctionRethrow.h: 42 42 WebDOMTestCallbackFunctionRethrow.h: 43 JSTestCallbackFunctionSkipCallbackInvokeCheck.h: 44 DOMTestCallbackFunctionSkipCallbackInvokeCheck.h: 45 WebDOMTestCallbackFunctionSkipCallbackInvokeCheck.h: 43 46 JSTestCallbackFunctionWithThisObject.h: 44 47 DOMTestCallbackFunctionWithThisObject.h: -
trunk/Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl
r267813 r285639 53 53 DOMString callbackWithAReturnValue(); 54 54 [RethrowException] DOMString callbackThatRethrowsExceptions(TestCallbackInterfaceEnum enumParam); 55 [SkipCallbackInvokeCheck] DOMString callbackThatSkipsInvokeCheck(TestCallbackInterfaceDictionary dictionaryParam);56 55 [CallbackThisObject=TestNode] DOMString callbackWithThisObject(TestObj testObjParam); 57 56 }; -
trunk/Source/WebCore/dom/NodeFilter.idl
r267813 r285639 21 21 [ 22 22 IsWeakCallback, 23 SkipCallbackInvokeCheck, 23 24 Exposed=Window 24 25 ] callback interface NodeFilter { … … 43 44 const unsigned long SHOW_NOTATION = 0x00000800; // Historical. 44 45 45 [ SkipCallbackInvokeCheck,RethrowException] unsigned short acceptNode(Node node);46 [RethrowException] unsigned short acceptNode(Node node); 46 47 }; -
trunk/Source/WebCore/workers/WorkerOrWorkletGlobalScope.h
r283295 r285639 79 79 80 80 // ScriptExecutionContext. 81 ScriptExecutionContext* scriptExecutionContext() const final { return const_cast<WorkerOrWorkletGlobalScope*>(this); } 81 82 bool isJSExecutionForbidden() const final; 82 83 … … 91 92 92 93 // EventTarget. 93 ScriptExecutionContext* scriptExecutionContext() const final { return const_cast<WorkerOrWorkletGlobalScope*>(this); }94 94 void refEventTarget() final { ref(); } 95 95 void derefEventTarget() final { deref(); } -
trunk/Source/WebCore/worklets/PaintWorkletGlobalScope.cpp
r277908 r285639 134 134 return Exception { TypeError, "The class must have a paint method" }; 135 135 136 RefPtr<JSCSSPaintCallback> paint = convert<IDLCallbackFunction<JSCSSPaintCallback>>(globalObject, paintValue , *jsCast<JSDOMGlobalObject*>(&globalObject));136 RefPtr<JSCSSPaintCallback> paint = convert<IDLCallbackFunction<JSCSSPaintCallback>>(globalObject, paintValue); 137 137 RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError }); 138 138 -
trunk/Source/WebCore/xml/CustomXPathNSResolver.idl
r265387 r285639 25 25 26 26 // Not using [IsWeakCallback] here as XPathNSResolver wrappers always temporary (no reference is kept) 27 callback interface CustomXPathNSResolver { 28 [ImplementedAs=lookupNamespaceURIForBindings, SkipCallbackInvokeCheck] DOMString? lookupNamespaceURI(DOMString? prefix); 27 [ 28 SkipCallbackInvokeCheck, 29 ] callback interface CustomXPathNSResolver { 30 [ImplementedAs=lookupNamespaceURIForBindings] DOMString? lookupNamespaceURI(DOMString? prefix); 29 31 };
Note:
See TracChangeset
for help on using the changeset viewer.