⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 285639 in webkit


Ignore:
Timestamp:
Nov 11, 2021, 10:29:14 AM (5 years ago)
Author:
Alexey Shvayka
Message:

JSCallbackData should use lexical global object for errors and lifecycle
https://bugs.webkit.org/show_bug.cgi?id=232387

Reviewed by Geoff Garen.

LayoutTests/imported/w3c:

  • web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-expected.txt: Added.
  • web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context-expected.txt: Added.
  • web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context.html: Added.
  • web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm.html: Added.
  • web-platform-tests/dom/traversal/support/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context-subframe.html: Added.
  • web-platform-tests/dom/traversal/support/TreeWalker-acceptNode-filter-cross-realm-subframe.html: Added.

Source/WebCore:

Currently, JSCallbackData uses incumbent [1] global object pretty much for everything,
which causes a few issues:

1) TypeErrors are constructed in incorrect realm;
2) NodeFilter / XPathNSResolver crash if their incumbent window gets disconnected;
3) other callbacks, originated in detached frame, were not invoked at all.

Since not all handleEvent() callers have ScriptExecutionContext, and to avoid a large
code diff, this patch utilizes callback wrapper's ScriptExecutionContext to fix all
the above-mentioned problems.

To accomodate NodeFilter and XPathNSResolver of detached frames without growing sizeof
of all other other callbacks, m_globalObject member is introduced only for them.

AudioWorklet changes are unobservable as worklets can't acquire a cross-realm method.

[1] https://html.spec.whatwg.org/multipage/webappapis.html#incumbent

Tests: fast/dom/Geolocation/callback-to-deleted-context.html

imported/w3c/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm-null-browsing-context.html
imported/w3c/web-platform-tests/dom/traversal/TreeWalker-acceptNode-filter-cross-realm.html

  • Modules/geolocation/PositionErrorCallback.idl:
  • Modules/webaudio/AudioWorkletGlobalScope.cpp:

(WebCore::AudioWorkletGlobalScope::registerProcessor):
(WebCore::AudioWorkletGlobalScope::createProcessor):

  • Modules/webaudio/AudioWorkletProcessor.cpp:

(WebCore::AudioWorkletProcessor::create):
(WebCore::AudioWorkletProcessor::AudioWorkletProcessor):
(WebCore::AudioWorkletProcessor::process):
(WebCore::AudioWorkletProcessor::setProcessCallback):

  • Modules/webaudio/AudioWorkletProcessor.h:

(WebCore::AudioWorkletProcessor::processCallbackWrapper):

  • bindings/js/JSAudioWorkletProcessorCustom.cpp:

(WebCore::JSAudioWorkletProcessor::visitAdditionalChildren):

  • bindings/js/JSCallbackData.cpp:

(WebCore::JSCallbackData::invokeCallback):

  • bindings/js/JSCallbackData.h:

(WebCore::JSCallbackData::JSCallbackData):
(WebCore::JSCallbackData::~JSCallbackData):
(WebCore::JSCallbackDataStrong::JSCallbackDataStrong):
(WebCore::JSCallbackDataStrong::invokeCallback):
(WebCore::JSCallbackDataWeak::JSCallbackDataWeak):
(WebCore::JSCallbackDataWeak::invokeCallback):
(WebCore::JSCallbackData::globalObject): Deleted.

  • bindings/js/JSDOMConvertCallbacks.h:

(WebCore::Converter<IDLCallbackFunction<T>>::convert):
(WebCore::Converter<IDLCallbackInterface<T>>::convert):

  • bindings/js/JSDOMConvertXPathNSResolver.h:

(WebCore::Converter<IDLInterface<XPathNSResolver>>::convert):

  • bindings/js/JSDOMGlobalObject.cpp:

(WebCore::JSC_DEFINE_HOST_FUNCTION):

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::jsDOMWindowInstanceFunction_openDatabaseBody):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateCallbackHeaderContent):
(GenerateCallbackImplementationContent):
(JSValueToNativeDOMConvertNeedsGlobalObject):

  • bindings/scripts/IDLAttributes.json:
  • bindings/scripts/test/JS/*: Updated.
  • bindings/scripts/test/TestCallbackFunctionSkipCallbackInvokeCheck.idl: Added.
  • bindings/scripts/test/TestCallbackInterface.idl:
  • dom/NodeFilter.idl:
  • workers/WorkerOrWorkletGlobalScope.h:
  • worklets/PaintWorkletGlobalScope.cpp:

(WebCore::PaintWorkletGlobalScope::registerPaint):

  • xml/CustomXPathNSResolver.idl:

LayoutTests:

  • fast/dom/Geolocation/callback-to-deleted-context-expected.txt:
  • fast/dom/Geolocation/callback-to-deleted-context.html:
  • fast/dom/Geolocation/resources/callback-to-deleted-context-inner1.html:
Location:
trunk
Files:
9 added
44 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r285638 r285639  
     12021-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
    1122021-11-11  Tim Nguyen  <ntim@apple.com>
    213
  • trunk/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context-expected.txt

    r281520 r285639  
    11frame "<!--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.
     2Tests 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.
    33
    44On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    55
    66
    7 PASS No callbacks invoked
     7PASS Success callback invoked
    88PASS successfullyParsed is true
    99
  • trunk/LayoutTests/fast/dom/Geolocation/callback-to-deleted-context.html

    r281520 r285639  
    66<body>
    77<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.");
     8description("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.");
    99
    1010function onFirstIframeLoaded() {
     
    1414function onSecondIframeLoaded() {
    1515    window.setTimeout(function() {
    16         testPassed('No callbacks invoked');
     16        testFailed('No callbacks invoked');
    1717        finishJSTest();
    1818    }, 500);
  • trunk/LayoutTests/fast/dom/Geolocation/resources/callback-to-deleted-context-inner1.html

    r281520 r285639  
    1414          // object attempts to invoke the callback.
    1515          window.parent.navigator.geolocation.getCurrentPosition(function() {
    16               parent.testFailed('Success callback invoked unexpectedly');
     16              parent.testPassed('Success callback invoked');
    1717              parent.finishJSTest();
    1818          }, function() {
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r285638 r285639  
     12021-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
    1152021-11-11  Tim Nguyen  <ntim@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r285638 r285639  
     12021-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
    1762021-11-11  Tim Nguyen  <ntim@apple.com>
    277
  • trunk/Source/WebCore/Modules/geolocation/PositionErrorCallback.idl

    r266311 r285639  
    2525[
    2626    Conditional=GEOLOCATION,
     27    SkipCallbackInvokeCheck,
    2728] callback PositionErrorCallback = undefined (GeolocationPositionError error);
  • trunk/Source/WebCore/Modules/webaudio/AudioWorkletGlobalScope.cpp

    r278185 r285639  
    7878
    7979    JSC::JSObject* jsConstructor = processorContructor->callbackData()->callback();
    80     auto* globalObject = jsConstructor->globalObject();
     80    auto* globalObject = scriptExecutionContext()->globalObject();
    8181    auto& vm = globalObject->vm();
    8282    auto scope = DECLARE_THROW_SCOPE(vm);
     
    134134
    135135    JSC::JSObject* jsConstructor = constructor->callbackData()->callback();
    136     auto* globalObject = constructor->callbackData()->globalObject();
     136    auto* globalObject = scriptExecutionContext()->globalObject();
    137137    JSC::VM& vm = globalObject->vm();
    138138    auto scope = DECLARE_THROW_SCOPE(vm);
     
    155155        return nullptr;
    156156
    157     jsProcessor->wrapped().setProcessCallback(makeUnique<JSCallbackDataStrong>(jsProcessor, globalObject));
     157    jsProcessor->wrapped().setProcessCallback(jsProcessor);
    158158
    159159    return &jsProcessor->wrapped();
  • trunk/Source/WebCore/Modules/webaudio/AudioWorkletProcessor.cpp

    r282707 r285639  
    202202        return Exception { TypeError, "No pending construction data for this worklet processor"_s };
    203203
    204     return adoptRef(*new AudioWorkletProcessor(*constructionData));
     204    return adoptRef(*new AudioWorkletProcessor(context, *constructionData));
    205205}
    206206
    207207AudioWorkletProcessor::~AudioWorkletProcessor() = default;
    208208
    209 AudioWorkletProcessor::AudioWorkletProcessor(const AudioWorkletProcessorConstructionData& constructionData)
    210     : m_name(constructionData.name())
     209AudioWorkletProcessor::AudioWorkletProcessor(ScriptExecutionContext& context, const AudioWorkletProcessorConstructionData& constructionData)
     210    : m_scriptExecutionContext(context)
     211    , m_name(constructionData.name())
    211212    , m_port(constructionData.port())
    212213{
     
    237238
    238239    ASSERT(m_processCallback);
    239     auto& globalObject = *m_processCallback->globalObject();
     240    auto& globalObject = *jsCast<JSDOMGlobalObject*>(m_scriptExecutionContext.globalObject());
    240241    ASSERT(globalObject.scriptExecutionContext());
    241242    ASSERT(globalObject.scriptExecutionContext()->isContextThread());
     
    248249
    249250    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);
    251252    if (returnedException) {
    252253        reportException(&globalObject, returnedException);
     
    260261}
    261262
    262 void AudioWorkletProcessor::setProcessCallback(std::unique_ptr<JSCallbackDataStrong>&& processCallback)
    263 {
    264     m_processCallback = WTFMove(processCallback);
     263void AudioWorkletProcessor::setProcessCallback(JSObject* processCallback)
     264{
     265    m_processCallback = { processCallback };
    265266}
    266267
  • trunk/Source/WebCore/Modules/webaudio/AudioWorkletProcessor.h

    r282707 r285639  
    6060    bool process(const Vector<RefPtr<AudioBus>>& inputs, Vector<Ref<AudioBus>>& outputs, const HashMap<String, std::unique_ptr<AudioFloatArray>>& paramValuesMap, bool& threwException);
    6161
    62     void setProcessCallback(std::unique_ptr<JSCallbackDataStrong>&&);
     62    void setProcessCallback(JSC::JSObject*);
    6363
     64    JSValueInWrappedObject& processCallbackWrapper() { return m_processCallback; }
    6465    JSValueInWrappedObject& jsInputsWrapper() { return m_jsInputs; }
    6566    JSValueInWrappedObject& jsOutputsWrapper() { return m_jsOutputs; }
     
    6768
    6869private:
    69     explicit AudioWorkletProcessor(const AudioWorkletProcessorConstructionData&);
     70    explicit AudioWorkletProcessor(ScriptExecutionContext&, const AudioWorkletProcessorConstructionData&);
    7071    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);
    7172
     73    ScriptExecutionContext& m_scriptExecutionContext;
    7274    String m_name;
    7375    Ref<MessagePort> m_port;
    74     std::unique_ptr<JSCallbackDataStrong> m_processCallback;
     76    JSValueInWrappedObject m_processCallback;
    7577    JSValueInWrappedObject m_jsInputs;
    7678    JSValueInWrappedObject m_jsOutputs;
  • trunk/Source/WebCore/bindings/js/JSAudioWorkletProcessorCustom.cpp

    r273138 r285639  
    3636{
    3737    auto& processor = wrapped();
     38    processor.processCallbackWrapper().visit(visitor);
    3839    processor.jsInputsWrapper().visit(visitor);
    3940    processor.jsOutputsWrapper().visit(visitor);
  • trunk/Source/WebCore/bindings/js/JSCallbackData.cpp

    r285098 r285639  
    4040
    4141// https://webidl.spec.whatwg.org/#call-a-user-objects-operation
    42 JSValue JSCallbackData::invokeCallback(JSDOMGlobalObject& globalObject, JSObject* callback, JSValue thisValue, MarkedArgumentBuffer& args, CallbackType method, PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)
     42JSValue JSCallbackData::invokeCallback(JSDOMGlobalObject& globalObject, JSDOMGlobalObject*, JSObject* callback, JSValue thisValue, MarkedArgumentBuffer& args, CallbackType method, PropertyName functionName, NakedPtr<JSC::Exception>& returnedException)
    4343{
    4444    ASSERT(callback);
  • trunk/Source/WebCore/bindings/js/JSCallbackData.h

    r273138 r285639  
    4848    enum class CallbackType { Function, Object, FunctionOrObject };
    4949
    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);
    5251protected:
    53     explicit JSCallbackData(JSDOMGlobalObject* globalObject)
    54         : m_globalObject(globalObject)
     52    explicit JSCallbackData(JSDOMGlobalObject* incumbentGlobalObject)
     53        : m_incumbentGlobalObject(incumbentGlobalObject)
    5554    {
    5655    }
     
    6261#endif
    6362    }
    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);
    6663
     64    JSC::Weak<JSDOMGlobalObject> m_incumbentGlobalObject;
    6765private:
    68     JSC::Weak<JSDOMGlobalObject> m_globalObject;
    6966#if ASSERT_ENABLED
    7067    Ref<Thread> m_thread { Thread::current() };
     
    7471class JSCallbackDataStrong : public JSCallbackData {
    7572public:
    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)
    7976    {
    8077    }
     
    8279    JSC::JSObject* callback() { return m_callback.get(); }
    8380
    84     JSC::JSValue invokeCallback(JSC::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)
    8582    {
    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);
    9184    }
    9285
     
    9790class JSCallbackDataWeak : public JSCallbackData {
    9891public:
    99     JSCallbackDataWeak(JSC::JSObject* callback, JSDOMGlobalObject* globalObject, void* owner)
    100         : JSCallbackData(globalObject)
     92    JSCallbackDataWeak(JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject, void* owner)
     93        : JSCallbackData(incumbentGlobalObject)
    10194        , m_callback(callback, &m_weakOwner, owner)
    10295    {
     
    10598    JSC::JSObject* callback() { return m_callback.get(); }
    10699
    107     JSC::JSValue invokeCallback(JSC::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)
    108101    {
    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);
    114103    }
    115104
  • trunk/Source/WebCore/bindings/js/JSDOMConvertCallbacks.h

    r283410 r285639  
    3636
    3737    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())
    3939    {
    4040        JSC::VM& vm = JSC::getVM(&lexicalGlobalObject);
     
    4646        }
    4747
    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));
    4950    }
    5051};
     
    7071template<typename T> struct Converter<IDLCallbackInterface<T>> : DefaultConverter<IDLCallbackInterface<T>> {
    7172    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())
    7374    {
    7475        JSC::VM& vm = JSC::getVM(&lexicalGlobalObject);
     
    8081        }
    8182
    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));
    8385    }
    8486};
  • trunk/Source/WebCore/bindings/js/JSDOMConvertXPathNSResolver.h

    r265387 r285639  
    4949            return &JSC::jsCast<JSXPathNSResolver*>(object)->wrapped();
    5050
    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));
    5253    }
    5354};
  • trunk/Source/WebCore/bindings/js/JSDOMGlobalObject.cpp

    r285636 r285639  
    196196
    197197    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);
    199199
    200200    bool result = AbortSignal::whenSignalAborted(abortSignal->wrapped(), WTFMove(abortAlgorithm));
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r284664 r285639  
    607607    }
    608608
    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) {
    610610        throwArgumentMustBeFunctionError(lexicalGlobalObject, scope, 4, "creationCallback", "Window", "openDatabase");
    611611    });
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r285252 r285639  
    63456345
    63466346    # The static create() method.
    6347     push(@$contentRef, "    static Ref<$className> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)\n");
     6347    push(@$contentRef, "    static Ref<$className> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)\n");
    63486348    push(@$contentRef, "    {\n");
    6349     push(@$contentRef, "        return adoptRef(*new ${className}(callback, globalObject));\n");
     6349    push(@$contentRef, "        return adoptRef(*new ${className}(globalObject, callback, incumbentGlobalObject));\n");
    63506350    push(@$contentRef, "    }\n\n");
    6351 
    6352     push(@$contentRef, "    ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }\n\n");
    63536351
    63546352    push(@$contentRef, "    ~$className() final;\n");
     
    63886386    push(@$contentRef, "\nprivate:\n");
    63896387
    6390     push(@$contentRef, "    ${className}(JSC::JSObject*, JSDOMGlobalObject*);\n\n");
     6388    push(@$contentRef, "    ${className}(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject);\n\n");
    63916389
    63926390    if ($interfaceOrCallback->extendedAttributes->{IsWeakCallback}) {
     
    63976395    push(@$contentRef, "    void visitJSFunction(JSC::SlotVisitor&) override;\n\n") if $interfaceOrCallback->extendedAttributes->{IsWeakCallback};
    63986396
     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};
    63996404    push(@$contentRef, "    ${callbackDataType}* m_data;\n");
    64006405    push(@$contentRef, "};\n\n");
     
    64176422
    64186423    # 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");
    64226428    push(@$contentRef, "{\n");
    64236429    push(@$contentRef, "}\n\n");
     
    65246530            # FIXME: This is needed for NodeFilter, which works even for disconnected iframes. We should investigate
    65256531            # if that behavior is needed for other callbacks.
    6526             if (!$operation->extendedAttributes->{SkipCallbackInvokeCheck}) {
     6532            if (!$interfaceOrCallback->extendedAttributes->{SkipCallbackInvokeCheck}) {
    65276533                push(@$contentRef, "    if (!canInvokeCallback())\n");
    65286534                push(@$contentRef, "        return CallbackResultType::UnableToExecute;\n\n");
     
    65306536
    65316537            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");
    65336539            push(@$contentRef, "    auto& vm = globalObject.vm();\n\n");
    65346540            push(@$contentRef, "    JSLockHolder lock(vm);\n");
     
    65486554            my $callbackInvocation;
    65496555            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)";
    65516557            } else {
    65526558                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)";
    65546560            }
    65556561
     
    70027008    my $type = shift;
    70037009
    7004     return 1 if $codeGenerator->IsCallbackInterface($type);
    7005     return 1 if $codeGenerator->IsCallbackFunction($type);
    70067010    return JSValueToNativeDOMConvertNeedsGlobalObject(@{$type->subtypes}[1]) if $codeGenerator->IsRecordType($type);
    70077011    return 1 if $type->name eq "ScheduledAction";
  • trunk/Source/WebCore/bindings/scripts/IDLAttributes.json

    r285098 r285639  
    479479        },
    480480        "SkipCallbackInvokeCheck": {
    481             "contextsAllowed": ["operation", "callback-function"]
     481            "contextsAllowed": ["interface", "callback-function"]
    482482        },
    483483        "SkipVTableValidation": {
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp

    r267891 r285639  
    3131using namespace JSC;
    3232
    33 JSTestCallbackFunction::JSTestCallbackFunction(JSObject* callback, JSDOMGlobalObject* globalObject)
    34     : TestCallbackFunction(globalObject->scriptExecutionContext())
    35     , m_data(new JSCallbackDataStrong(callback, globalObject, this))
     33JSTestCallbackFunction::JSTestCallbackFunction(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
     34    : TestCallbackFunction(globalObject.scriptExecutionContext())
     35    , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this))
    3636{
    3737}
     
    5858    Ref<JSTestCallbackFunction> protectedThis(*this);
    5959
    60     auto& globalObject = *m_data->globalObject();
     60    auto& globalObject = this->globalObject();
    6161    auto& vm = globalObject.vm();
    6262
     
    6969
    7070    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);
    7272    if (returnedException) {
    7373        reportException(&lexicalGlobalObject, returnedException);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h

    r270115 r285639  
    3030class JSTestCallbackFunction final : public TestCallbackFunction {
    3131public:
    32     static Ref<JSTestCallbackFunction> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
     32    static Ref<JSTestCallbackFunction> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
    3333    {
    34         return adoptRef(*new JSTestCallbackFunction(callback, globalObject));
     34        return adoptRef(*new JSTestCallbackFunction(globalObject, callback, incumbentGlobalObject));
    3535    }
    36 
    37     ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
    3836
    3937    ~JSTestCallbackFunction() final;
     
    4442
    4543private:
    46     JSTestCallbackFunction(JSC::JSObject*, JSDOMGlobalObject*);
     44    JSTestCallbackFunction(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject);
     45
     46    JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); }
    4747
    4848    JSCallbackDataStrong* m_data;
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp

    r267891 r285639  
    3434using namespace JSC;
    3535
    36 JSTestCallbackFunctionRethrow::JSTestCallbackFunctionRethrow(JSObject* callback, JSDOMGlobalObject* globalObject)
    37     : TestCallbackFunctionRethrow(globalObject->scriptExecutionContext())
    38     , m_data(new JSCallbackDataStrong(callback, globalObject, this))
     36JSTestCallbackFunctionRethrow::JSTestCallbackFunctionRethrow(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
     37    : TestCallbackFunctionRethrow(globalObject.scriptExecutionContext())
     38    , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this))
    3939{
    4040}
     
    6161    Ref<JSTestCallbackFunctionRethrow> protectedThis(*this);
    6262
    63     auto& globalObject = *m_data->globalObject();
     63    auto& globalObject = this->globalObject();
    6464    auto& vm = globalObject.vm();
    6565
     
    7272
    7373    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);
    7575    if (returnedException) {
    7676        auto throwScope = DECLARE_THROW_SCOPE(vm);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h

    r270115 r285639  
    3030class JSTestCallbackFunctionRethrow final : public TestCallbackFunctionRethrow {
    3131public:
    32     static Ref<JSTestCallbackFunctionRethrow> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
     32    static Ref<JSTestCallbackFunctionRethrow> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
    3333    {
    34         return adoptRef(*new JSTestCallbackFunctionRethrow(callback, globalObject));
     34        return adoptRef(*new JSTestCallbackFunctionRethrow(globalObject, callback, incumbentGlobalObject));
    3535    }
    36 
    37     ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
    3836
    3937    ~JSTestCallbackFunctionRethrow() final;
     
    4442
    4543private:
    46     JSTestCallbackFunctionRethrow(JSC::JSObject*, JSDOMGlobalObject*);
     44    JSTestCallbackFunctionRethrow(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject);
     45
     46    JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); }
    4747
    4848    JSCallbackDataStrong* m_data;
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp

    r275422 r285639  
    3535using namespace JSC;
    3636
    37 JSTestCallbackFunctionWithThisObject::JSTestCallbackFunctionWithThisObject(JSObject* callback, JSDOMGlobalObject* globalObject)
    38     : TestCallbackFunctionWithThisObject(globalObject->scriptExecutionContext())
    39     , m_data(new JSCallbackDataStrong(callback, globalObject, this))
     37JSTestCallbackFunctionWithThisObject::JSTestCallbackFunctionWithThisObject(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
     38    : TestCallbackFunctionWithThisObject(globalObject.scriptExecutionContext())
     39    , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this))
    4040{
    4141}
     
    6262    Ref<JSTestCallbackFunctionWithThisObject> protectedThis(*this);
    6363
    64     auto& globalObject = *m_data->globalObject();
     64    auto& globalObject = this->globalObject();
    6565    auto& vm = globalObject.vm();
    6666
     
    7373
    7474    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);
    7676    if (returnedException) {
    7777        reportException(&lexicalGlobalObject, returnedException);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h

    r270115 r285639  
    3030class JSTestCallbackFunctionWithThisObject final : public TestCallbackFunctionWithThisObject {
    3131public:
    32     static Ref<JSTestCallbackFunctionWithThisObject> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
     32    static Ref<JSTestCallbackFunctionWithThisObject> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
    3333    {
    34         return adoptRef(*new JSTestCallbackFunctionWithThisObject(callback, globalObject));
     34        return adoptRef(*new JSTestCallbackFunctionWithThisObject(globalObject, callback, incumbentGlobalObject));
    3535    }
    36 
    37     ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
    3836
    3937    ~JSTestCallbackFunctionWithThisObject() final;
     
    4442
    4543private:
    46     JSTestCallbackFunctionWithThisObject(JSC::JSObject*, JSDOMGlobalObject*);
     44    JSTestCallbackFunctionWithThisObject(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject);
     45
     46    JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); }
    4747
    4848    JSCallbackDataStrong* m_data;
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp

    r275422 r285639  
    3535using namespace JSC;
    3636
    37 JSTestCallbackFunctionWithTypedefs::JSTestCallbackFunctionWithTypedefs(JSObject* callback, JSDOMGlobalObject* globalObject)
    38     : TestCallbackFunctionWithTypedefs(globalObject->scriptExecutionContext())
    39     , m_data(new JSCallbackDataStrong(callback, globalObject, this))
     37JSTestCallbackFunctionWithTypedefs::JSTestCallbackFunctionWithTypedefs(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
     38    : TestCallbackFunctionWithTypedefs(globalObject.scriptExecutionContext())
     39    , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this))
    4040{
    4141}
     
    6262    Ref<JSTestCallbackFunctionWithTypedefs> protectedThis(*this);
    6363
    64     auto& globalObject = *m_data->globalObject();
     64    auto& globalObject = this->globalObject();
    6565    auto& vm = globalObject.vm();
    6666
     
    7474
    7575    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);
    7777    if (returnedException) {
    7878        reportException(&lexicalGlobalObject, returnedException);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h

    r270115 r285639  
    3030class JSTestCallbackFunctionWithTypedefs final : public TestCallbackFunctionWithTypedefs {
    3131public:
    32     static Ref<JSTestCallbackFunctionWithTypedefs> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
     32    static Ref<JSTestCallbackFunctionWithTypedefs> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
    3333    {
    34         return adoptRef(*new JSTestCallbackFunctionWithTypedefs(callback, globalObject));
     34        return adoptRef(*new JSTestCallbackFunctionWithTypedefs(globalObject, callback, incumbentGlobalObject));
    3535    }
    36 
    37     ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
    3836
    3937    ~JSTestCallbackFunctionWithTypedefs() final;
     
    4442
    4543private:
    46     JSTestCallbackFunctionWithTypedefs(JSC::JSObject*, JSDOMGlobalObject*);
     44    JSTestCallbackFunctionWithTypedefs(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject);
     45
     46    JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); }
    4747
    4848    JSCallbackDataStrong* m_data;
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp

    r283233 r285639  
    121121}
    122122
    123 JSTestCallbackInterface::JSTestCallbackInterface(JSObject* callback, JSDOMGlobalObject* globalObject)
    124     : TestCallbackInterface(globalObject->scriptExecutionContext())
    125     , m_data(new JSCallbackDataStrong(callback, globalObject, this))
     123JSTestCallbackInterface::JSTestCallbackInterface(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
     124    : TestCallbackInterface(globalObject.scriptExecutionContext())
     125    , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this))
    126126{
    127127}
     
    184184    Ref<JSTestCallbackInterface> protectedThis(*this);
    185185
    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);
    197197    if (returnedException) {
    198198        reportException(&lexicalGlobalObject, returnedException);
     
    210210    Ref<JSTestCallbackInterface> protectedThis(*this);
    211211
    212     auto& globalObject = *m_data->globalObject();
     212    auto& globalObject = this->globalObject();
    213213    auto& vm = globalObject.vm();
    214214
     
    221221
    222222    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);
    224224    if (returnedException) {
    225225        reportException(&lexicalGlobalObject, returnedException);
     
    237237    Ref<JSTestCallbackInterface> protectedThis(*this);
    238238
    239     auto& globalObject = *m_data->globalObject();
     239    auto& globalObject = this->globalObject();
    240240    auto& vm = globalObject.vm();
    241241
     
    249249
    250250    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);
    252252    if (returnedException) {
    253253        reportException(&lexicalGlobalObject, returnedException);
     
    265265    Ref<JSTestCallbackInterface> protectedThis(*this);
    266266
    267     auto& globalObject = *m_data->globalObject();
     267    auto& globalObject = this->globalObject();
    268268    auto& vm = globalObject.vm();
    269269
     
    276276
    277277    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);
    279279    if (returnedException) {
    280280        reportException(&lexicalGlobalObject, returnedException);
     
    292292    Ref<JSTestCallbackInterface> protectedThis(*this);
    293293
    294     auto& globalObject = *m_data->globalObject();
     294    auto& globalObject = this->globalObject();
    295295    auto& vm = globalObject.vm();
    296296
     
    303303
    304304    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);
    306306    if (returnedException) {
    307307        reportException(&lexicalGlobalObject, returnedException);
     
    319319    Ref<JSTestCallbackInterface> protectedThis(*this);
    320320
    321     auto& globalObject = *m_data->globalObject();
     321    auto& globalObject = this->globalObject();
    322322    auto& vm = globalObject.vm();
    323323
     
    331331
    332332    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);
    334334    if (returnedException) {
    335335        reportException(&lexicalGlobalObject, returnedException);
     
    347347    Ref<JSTestCallbackInterface> protectedThis(*this);
    348348
    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);
    360360    if (returnedException) {
    361361        reportException(&lexicalGlobalObject, returnedException);
     
    376376    Ref<JSTestCallbackInterface> protectedThis(*this);
    377377
    378     auto& globalObject = *m_data->globalObject();
     378    auto& globalObject = this->globalObject();
    379379    auto& vm = globalObject.vm();
    380380
     
    387387
    388388    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);
    390390    if (returnedException) {
    391391        auto throwScope = DECLARE_THROW_SCOPE(vm);
     
    400400}
    401401
    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);
     402CallbackResult<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);
    418421    if (returnedException) {
    419422        reportException(&lexicalGlobalObject, returnedException);
     
    427430}
    428431
    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 
    459432JSC::JSValue toJS(TestCallbackInterface& impl)
    460433{
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h

    r278253 r285639  
    3434class JSTestCallbackInterface final : public TestCallbackInterface {
    3535public:
    36     static Ref<JSTestCallbackInterface> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
     36    static Ref<JSTestCallbackInterface> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
    3737    {
    38         return adoptRef(*new JSTestCallbackInterface(callback, globalObject));
     38        return adoptRef(*new JSTestCallbackInterface(globalObject, callback, incumbentGlobalObject));
    3939    }
    40 
    41     ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
    4240
    4341    ~JSTestCallbackInterface() final;
     
    5553    CallbackResult<typename IDLDOMString::ImplementationType> callbackWithAReturnValue() override;
    5654    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;
    5855    CallbackResult<typename IDLDOMString::ImplementationType> callbackWithThisObject(typename IDLInterface<TestNode>::ParameterType thisObject, typename IDLInterface<TestObj>::ParameterType testObjParam) override;
    5956
    6057private:
    61     JSTestCallbackInterface(JSC::JSObject*, JSDOMGlobalObject*);
     58    JSTestCallbackInterface(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject);
     59
     60    JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); }
    6261
    6362    JSCallbackDataStrong* m_data;
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary.cpp

    r276949 r285639  
    6666    }
    6767    if (!callbackMemberValue.isUndefined()) {
    68         result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
     68        result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue);
    6969        RETURN_IF_EXCEPTION(throwScope, { });
    7070    }
     
    101101    }
    102102    if (!partialCallbackMemberValue.isUndefined()) {
    103         result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
     103        result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue);
    104104        RETURN_IF_EXCEPTION(throwScope, { });
    105105    }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestDerivedDictionary2.cpp

    r276949 r285639  
    6666    }
    6767    if (!callbackMemberValue.isUndefined()) {
    68         result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
     68        result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue);
    6969        RETURN_IF_EXCEPTION(throwScope, { });
    7070    }
     
    154154    }
    155155    if (!callbackMemberValue.isUndefined()) {
    156         result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
     156        result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue);
    157157        RETURN_IF_EXCEPTION(throwScope, { });
    158158    }
     
    189189    }
    190190    if (!partialCallbackMemberValue.isUndefined()) {
    191         result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
     191        result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue);
    192192        RETURN_IF_EXCEPTION(throwScope, { });
    193193    }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary.cpp

    r276949 r285639  
    6666    }
    6767    if (!callbackMemberValue.isUndefined()) {
    68         result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
     68        result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue);
    6969        RETURN_IF_EXCEPTION(throwScope, { });
    7070    }
     
    101101    }
    102102    if (!partialCallbackMemberValue.isUndefined()) {
    103         result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
     103        result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue);
    104104        RETURN_IF_EXCEPTION(throwScope, { });
    105105    }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInheritedDictionary2.cpp

    r276949 r285639  
    6464    }
    6565    if (!callbackMemberValue.isUndefined()) {
    66         result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
     66        result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue);
    6767        RETURN_IF_EXCEPTION(throwScope, { });
    6868    }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r284213 r285639  
    20102010    auto& document = downcast<Document>(*context);
    20112011    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); });
    20132013    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    20142014    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); });
    20162016    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    20172017    auto object = TestObj::create(document, testCallback.releaseNonNull(), testCallbackFunction.releaseNonNull());
     
    34443444    auto throwScope = DECLARE_THROW_SCOPE(vm);
    34453445    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);
    34473447    RETURN_IF_EXCEPTION(throwScope, false);
    34483448    invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] {
     
    69606960        return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject));
    69616961    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"); });
    69636963    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    69646964    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithCallbackInterfaceArg(callback.releaseNonNull()); })));
     
    69806980        return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject));
    69816981    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"); });
    69836983    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    69846984    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithNullableCallbackInterfaceArg(WTFMove(callback)); })));
     
    70037003    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    70047004    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"); });
    70067006    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    70077007    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithNonCallbackInterfaceArgAndCallbackInterfaceArg(WTFMove(nonCallback), callback.releaseNonNull()); })));
     
    70217021    auto& impl = castedThis->wrapped();
    70227022    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"); });
    70247024    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    70257025    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithOptionalCallbackInterfaceArg(WTFMove(callback)); })));
     
    70397039    auto& impl = castedThis->wrapped();
    70407040    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"); });
    70427042    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    70437043    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithOptionalNullableCallbackInterfaceArg(WTFMove(callback)); })));
     
    70597059        return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject));
    70607060    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"); });
    70627062    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    70637063    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithCallbackFunctionArg(callback.releaseNonNull()); })));
     
    70797079        return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject));
    70807080    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"); });
    70827082    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    70837083    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithNullableCallbackFunctionArg(WTFMove(callback)); })));
     
    71027102    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    71037103    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"); });
    71057105    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    71067106    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithNonCallbackArgAndCallbackFunctionArg(WTFMove(nonCallback), callback.releaseNonNull()); })));
     
    71207120    auto& impl = castedThis->wrapped();
    71217121    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"); });
    71237123    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    71247124    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithOptionalCallbackFunctionArg(WTFMove(callback)); })));
     
    71387138    auto& impl = castedThis->wrapped();
    71397139    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"); });
    71417141    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    71427142    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.methodWithOptionalNullableCallbackFunctionArg(WTFMove(callback)); })));
     
    71557155    UNUSED_PARAM(callFrame);
    71567156    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"); });
    71587158    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    71597159    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return TestObj::staticMethodWithCallbackAndOptionalArg(WTFMove(callback)); })));
     
    71747174        return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject));
    71757175    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"); });
    71777177    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    71787178    RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return TestObj::staticMethodWithCallbackArg(callback.releaseNonNull()); })));
     
    73047304    auto& impl = castedThis->wrapped();
    73057305    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"); });
    73077307    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    73087308    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  
    7676    }
    7777    if (!callbackMemberValue.isUndefined()) {
    78         result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
     78        result.callbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, callbackMemberValue);
    7979        RETURN_IF_EXCEPTION(throwScope, { });
    8080    }
     
    137137    }
    138138    if (!partialCallbackMemberValue.isUndefined()) {
    139         result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue, *jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject));
     139        result.partialCallbackMember = convert<IDLCallbackFunction<JSVoidCallback>>(lexicalGlobalObject, partialCallbackMemberValue);
    140140        RETURN_IF_EXCEPTION(throwScope, { });
    141141    }
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestTypedefs.cpp

    r284213 r285639  
    169169    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    170170    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); });
    172172    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    173173    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); });
    175175    RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
    176176    auto object = TestTypedefs::create(WTFMove(hello), testCallbackFunction.releaseNonNull(), testCallbackInterface.releaseNonNull());
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp

    r275422 r285639  
    4242using namespace JSC;
    4343
    44 JSTestVoidCallbackFunction::JSTestVoidCallbackFunction(JSObject* callback, JSDOMGlobalObject* globalObject)
    45     : TestVoidCallbackFunction(globalObject->scriptExecutionContext())
    46     , m_data(new JSCallbackDataStrong(callback, globalObject, this))
     44JSTestVoidCallbackFunction::JSTestVoidCallbackFunction(JSDOMGlobalObject& globalObject, JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
     45    : TestVoidCallbackFunction(globalObject.scriptExecutionContext())
     46    , m_data(new JSCallbackDataStrong(callback, incumbentGlobalObject, this))
    4747{
    4848}
     
    6969    Ref<JSTestVoidCallbackFunction> protectedThis(*this);
    7070
    71     auto& globalObject = *m_data->globalObject();
     71    auto& globalObject = this->globalObject();
    7272    auto& vm = globalObject.vm();
    7373
     
    8585
    8686    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);
    8888    if (returnedException) {
    8989        reportException(&lexicalGlobalObject, returnedException);
  • trunk/Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.h

    r270115 r285639  
    3232class JSTestVoidCallbackFunction final : public TestVoidCallbackFunction {
    3333public:
    34     static Ref<JSTestVoidCallbackFunction> create(JSC::JSObject* callback, JSDOMGlobalObject* globalObject)
     34    static Ref<JSTestVoidCallbackFunction> create(JSDOMGlobalObject& globalObject, JSC::JSObject* callback, JSDOMGlobalObject* incumbentGlobalObject)
    3535    {
    36         return adoptRef(*new JSTestVoidCallbackFunction(callback, globalObject));
     36        return adoptRef(*new JSTestVoidCallbackFunction(globalObject, callback, incumbentGlobalObject));
    3737    }
    38 
    39     ScriptExecutionContext* scriptExecutionContext() const { return ContextDestructionObserver::scriptExecutionContext(); }
    4038
    4139    ~JSTestVoidCallbackFunction() final;
     
    4644
    4745private:
    48     JSTestVoidCallbackFunction(JSC::JSObject*, JSDOMGlobalObject*);
     46    JSTestVoidCallbackFunction(JSDOMGlobalObject& lexicalGlobalObject, JSC::JSObject*, JSDOMGlobalObject* incumbentGlobalObject);
     47
     48    JSDOMGlobalObject& globalObject() const { return *JSC::jsCast<JSDOMGlobalObject*>(scriptExecutionContext()->globalObject()); }
    4949
    5050    JSCallbackDataStrong* m_data;
  • trunk/Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep

    r285196 r285639  
    4141DOMTestCallbackFunctionRethrow.h:
    4242WebDOMTestCallbackFunctionRethrow.h:
     43JSTestCallbackFunctionSkipCallbackInvokeCheck.h:
     44DOMTestCallbackFunctionSkipCallbackInvokeCheck.h:
     45WebDOMTestCallbackFunctionSkipCallbackInvokeCheck.h:
    4346JSTestCallbackFunctionWithThisObject.h:
    4447DOMTestCallbackFunctionWithThisObject.h:
  • trunk/Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl

    r267813 r285639  
    5353    DOMString callbackWithAReturnValue();
    5454    [RethrowException] DOMString callbackThatRethrowsExceptions(TestCallbackInterfaceEnum enumParam);
    55     [SkipCallbackInvokeCheck] DOMString callbackThatSkipsInvokeCheck(TestCallbackInterfaceDictionary dictionaryParam);
    5655    [CallbackThisObject=TestNode] DOMString callbackWithThisObject(TestObj testObjParam);
    5756};
  • trunk/Source/WebCore/dom/NodeFilter.idl

    r267813 r285639  
    2121[
    2222    IsWeakCallback,
     23    SkipCallbackInvokeCheck,
    2324    Exposed=Window
    2425] callback interface NodeFilter {
     
    4344    const unsigned long SHOW_NOTATION = 0x00000800; // Historical.
    4445
    45     [SkipCallbackInvokeCheck, RethrowException] unsigned short acceptNode(Node node);
     46    [RethrowException] unsigned short acceptNode(Node node);
    4647};
  • trunk/Source/WebCore/workers/WorkerOrWorkletGlobalScope.h

    r283295 r285639  
    7979
    8080    // ScriptExecutionContext.
     81    ScriptExecutionContext* scriptExecutionContext() const final { return const_cast<WorkerOrWorkletGlobalScope*>(this); }
    8182    bool isJSExecutionForbidden() const final;
    8283
     
    9192
    9293    // EventTarget.
    93     ScriptExecutionContext* scriptExecutionContext() const final { return const_cast<WorkerOrWorkletGlobalScope*>(this); }
    9494    void refEventTarget() final { ref(); }
    9595    void derefEventTarget() final { deref(); }
  • trunk/Source/WebCore/worklets/PaintWorkletGlobalScope.cpp

    r277908 r285639  
    134134            return Exception { TypeError, "The class must have a paint method" };
    135135
    136         RefPtr<JSCSSPaintCallback> paint = convert<IDLCallbackFunction<JSCSSPaintCallback>>(globalObject, paintValue, *jsCast<JSDOMGlobalObject*>(&globalObject));
     136        RefPtr<JSCSSPaintCallback> paint = convert<IDLCallbackFunction<JSCSSPaintCallback>>(globalObject, paintValue);
    137137        RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError });
    138138
  • trunk/Source/WebCore/xml/CustomXPathNSResolver.idl

    r265387 r285639  
    2525
    2626// 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);
    2931};
Note: See TracChangeset for help on using the changeset viewer.