Skip to content

Commit

Permalink
Adopt more smart pointers in AbortSignal
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=267863

Reviewed by Geoffrey Garen.

* Source/WebCore/Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith):
(WebCore::FetchRequest::clone):
* Source/WebCore/Modules/fetch/FetchRequest.h:
* Source/WebCore/bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSC_DEFINE_HOST_FUNCTION):
* Source/WebCore/bindings/js/JSDOMWrapper.h:
(WebCore::JSDOMWrapper::protectedWrapped const):
* Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* Source/WebCore/bindings/scripts/test/JS/JSDedicatedWorkerGlobalScope.h:
(WebCore::JSDedicatedWorkerGlobalScope::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSExposedStar.h:
(WebCore::JSExposedStar::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSLocalDOMWindow.h:
(WebCore::JSLocalDOMWindow::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSPaintWorkletGlobalScope.h:
(WebCore::JSPaintWorkletGlobalScope::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSServiceWorkerGlobalScope.h:
(WebCore::JSServiceWorkerGlobalScope::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSSharedWorkerGlobalScope.h:
(WebCore::JSSharedWorkerGlobalScope::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.h:
(WebCore::JSTestDOMJIT::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONIndirectInheritance.h:
(WebCore::JSTestDefaultToJSONIndirectInheritance::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONInherit.h:
(WebCore::JSTestDefaultToJSONInherit::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSTestDefaultToJSONInheritFinal.h:
(WebCore::JSTestDefaultToJSONInheritFinal::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.h:
(WebCore::JSTestEventConstructor::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h:
(WebCore::JSTestEventTarget::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSTestNode.h:
* Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h:
(WebCore::JSTestPromiseRejectionEvent::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSWorkerGlobalScope.h:
(WebCore::JSWorkerGlobalScope::protectedWrapped const):
* Source/WebCore/bindings/scripts/test/JS/JSWorkletGlobalScope.h:
(WebCore::JSWorkletGlobalScope::protectedWrapped const):
* Source/WebCore/dom/AbortSignal.cpp:
(WebCore::AbortSignal::timeout):
(WebCore::AbortSignal::any):
(WebCore::AbortSignal::signalAbort):
(WebCore::AbortSignal::signalFollow):

Canonical link: https://commits.webkit.org/273317@main
  • Loading branch information
cdumez committed Jan 22, 2024
1 parent 851a947 commit fd24e6d
Show file tree
Hide file tree
Showing 38 changed files with 150 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Source/WebCore/Modules/fetch/FetchRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ ExceptionOr<void> FetchRequest::initializeWith(const String& url, Init&& init)

if (init.signal) {
if (auto* signal = JSAbortSignal::toWrapped(scriptExecutionContext()->vm(), init.signal))
m_signal->signalFollow(*signal);
protectedSignal()->signalFollow(*signal);
else if (!init.signal.isUndefinedOrNull()) {
if (auto exception = processInvalidSignal(*scriptExecutionContext()))
return WTFMove(*exception);
Expand Down Expand Up @@ -231,14 +231,14 @@ ExceptionOr<void> FetchRequest::initializeWith(FetchRequest& input, Init&& init)

if (init.signal && !init.signal.isUndefined()) {
if (auto* signal = JSAbortSignal::toWrapped(scriptExecutionContext()->vm(), init.signal))
m_signal->signalFollow(*signal);
protectedSignal()->signalFollow(*signal);
else if (!init.signal.isNull()) {
if (auto exception = processInvalidSignal(*scriptExecutionContext()))
return WTFMove(*exception);
}

} else
m_signal->signalFollow(input.m_signal.get());
protectedSignal()->signalFollow(input.m_signal.get());

if (init.hasMembers()) {
auto fillResult = init.headers ? m_headers->fill(*init.headers) : m_headers->fill(input.headers());
Expand Down Expand Up @@ -351,7 +351,7 @@ ExceptionOr<Ref<FetchRequest>> FetchRequest::clone()
clone->suspendIfNeeded();
clone->cloneBody(*this);
clone->setNavigationPreloadIdentifier(m_navigationPreloadIdentifier);
clone->m_signal->signalFollow(m_signal);
clone->protectedSignal()->signalFollow(m_signal);
return clone;
}

Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/Modules/fetch/FetchRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ class FetchRequest final : public FetchBodyOwner {
void stop() final;
const char* activeDOMObjectName() const final;

Ref<AbortSignal> protectedSignal() const { return m_signal; }

ResourceRequest m_request;
URLKeepingBlobAlive m_requestURL;
FetchOptions m_options;
Expand Down
6 changes: 3 additions & 3 deletions Source/WebCore/bindings/js/JSDOMGlobalObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ JSC_DEFINE_HOST_FUNCTION(addAbortAlgorithmToSignal, (JSGlobalObject* globalObjec
auto* jsDOMGlobalObject = JSC::jsCast<JSDOMGlobalObject*>(globalObject);
Ref<AbortAlgorithm> abortAlgorithm = JSAbortAlgorithm::create(callFrame->uncheckedArgument(1).getObject(), jsDOMGlobalObject);

auto algorithmIdentifier = AbortSignal::addAbortAlgorithmToSignal(abortSignal->wrapped(), WTFMove(abortAlgorithm));
auto algorithmIdentifier = AbortSignal::addAbortAlgorithmToSignal(abortSignal->protectedWrapped().get(), WTFMove(abortAlgorithm));
return JSValue::encode(JSC::jsNumber(algorithmIdentifier));
}

Expand All @@ -247,7 +247,7 @@ JSC_DEFINE_HOST_FUNCTION(removeAbortAlgorithmFromSignal, (JSGlobalObject*, CallF
if (UNLIKELY(!abortSignal))
return JSValue::encode(JSValue(JSC::JSValue::JSFalse));

AbortSignal::removeAbortAlgorithmFromSignal(abortSignal->wrapped(), callFrame->uncheckedArgument(1).asUInt32());
AbortSignal::removeAbortAlgorithmFromSignal(abortSignal->protectedWrapped().get(), callFrame->uncheckedArgument(1).asUInt32());
return JSValue::encode(JSC::jsUndefined());
}

Expand All @@ -270,7 +270,7 @@ JSC_DEFINE_HOST_FUNCTION(signalAbort, (JSGlobalObject*, CallFrame* callFrame))

auto* abortSignal = jsDynamicCast<JSAbortSignal*>(callFrame->uncheckedArgument(0));
if (UNLIKELY(abortSignal))
abortSignal->wrapped().signalAbort(callFrame->uncheckedArgument(1));
abortSignal->protectedWrapped()->signalAbort(callFrame->uncheckedArgument(1));
return JSValue::encode(JSC::jsUndefined());
}

Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/bindings/js/JSDOMWrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class JSDOMWrapper : public JSDOMObject {
using DOMWrapped = ImplementationClass;

ImplementationClass& wrapped() const { return m_wrapped; }
Ref<ImplementationClass> protectedWrapped() const { return m_wrapped; }
static ptrdiff_t offsetOfWrapped() { return OBJECT_OFFSETOF(JSDOMWrapper, m_wrapped); }
constexpr static bool hasCustomPtrTraits() { return !std::is_same_v<PtrTraits, RawPtrTraits<ImplementationClass>>; };

Expand Down
10 changes: 9 additions & 1 deletion Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3332,7 +3332,8 @@ sub GenerateHeader
push(@headerContent, " $interfaceName& wrapped() const\n");
push(@headerContent, " {\n");
push(@headerContent, " return static_cast<$interfaceName&>(Base::wrapped());\n");
push(@headerContent, " }\n");
push(@headerContent, " }\n\n");
push(@headerContent, " Ref<$interfaceName> protectedWrapped() const;\n\n");
}
}

Expand Down Expand Up @@ -4881,6 +4882,13 @@ sub GenerateImplementation
push(@implContent, "}\n\n");
}

if (NeedsImplementationClass($interface) && $hasParent) {
push(@implContent, "Ref<$interfaceName> ${className}::protectedWrapped() const\n");
push(@implContent, "{\n");
push(@implContent, " return wrapped();\n");
push(@implContent, "}\n\n");
}

# Finish Creation
my @finishCreation = ();
$hasNonTrivialFinishCreation = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ JSDedicatedWorkerGlobalScope::JSDedicatedWorkerGlobalScope(VM& vm, Structure* st
{
}

Ref<DedicatedWorkerGlobalScope> JSDedicatedWorkerGlobalScope::protectedWrapped() const
{
return wrapped();
}

static_assert(!std::is_base_of<ActiveDOMObject, DedicatedWorkerGlobalScope>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");

#if ASSERT_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class JSDedicatedWorkerGlobalScope : public JSWorkerGlobalScope {
{
return static_cast<DedicatedWorkerGlobalScope&>(Base::wrapped());
}

Ref<DedicatedWorkerGlobalScope> protectedWrapped() const;

public:
static constexpr unsigned StructureFlags = Base::StructureFlags | JSC::HasStaticPropertyTable;
protected:
Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/bindings/scripts/test/JS/JSExposedStar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ JSExposedStar::JSExposedStar(Structure* structure, JSDOMGlobalObject& globalObje
{
}

Ref<ExposedStar> JSExposedStar::protectedWrapped() const
{
return wrapped();
}

static_assert(!std::is_base_of<ActiveDOMObject, ExposedStar>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");

JSObject* JSExposedStar::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/bindings/scripts/test/JS/JSExposedStar.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class JSExposedStar : public JSEventTarget {
{
return static_cast<ExposedStar&>(Base::wrapped());
}

Ref<ExposedStar> protectedWrapped() const;

protected:
JSExposedStar(JSC::Structure*, JSDOMGlobalObject&, Ref<ExposedStar>&&);

Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/bindings/scripts/test/JS/JSLocalDOMWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ JSLocalDOMWindow::JSLocalDOMWindow(VM& vm, Structure* structure, Ref<LocalDOMWin
{
}

Ref<LocalDOMWindow> JSLocalDOMWindow::protectedWrapped() const
{
return wrapped();
}

static_assert(!std::is_base_of<ActiveDOMObject, LocalDOMWindow>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");

void JSLocalDOMWindow::finishCreation(VM& vm, JSWindowProxy* proxy)
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/bindings/scripts/test/JS/JSLocalDOMWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class JSLocalDOMWindow : public JSEventTarget {
{
return static_cast<LocalDOMWindow&>(Base::wrapped());
}

Ref<LocalDOMWindow> protectedWrapped() const;

public:
static constexpr unsigned StructureFlags = Base::StructureFlags | JSC::HasStaticPropertyTable | JSC::ImplementsHasInstance | JSC::ImplementsDefaultHasInstance;
protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ JSPaintWorkletGlobalScope::JSPaintWorkletGlobalScope(VM& vm, Structure* structur
{
}

Ref<PaintWorkletGlobalScope> JSPaintWorkletGlobalScope::protectedWrapped() const
{
return wrapped();
}

static_assert(!std::is_base_of<ActiveDOMObject, PaintWorkletGlobalScope>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");

#if ASSERT_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class JSPaintWorkletGlobalScope : public JSWorkletGlobalScope {
{
return static_cast<PaintWorkletGlobalScope&>(Base::wrapped());
}

Ref<PaintWorkletGlobalScope> protectedWrapped() const;

public:
static constexpr unsigned StructureFlags = Base::StructureFlags | JSC::HasStaticPropertyTable;
protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ JSServiceWorkerGlobalScope::JSServiceWorkerGlobalScope(VM& vm, Structure* struct
{
}

Ref<ServiceWorkerGlobalScope> JSServiceWorkerGlobalScope::protectedWrapped() const
{
return wrapped();
}

static_assert(!std::is_base_of<ActiveDOMObject, ServiceWorkerGlobalScope>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");

#if ASSERT_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class JSServiceWorkerGlobalScope : public JSWorkerGlobalScope {
{
return static_cast<ServiceWorkerGlobalScope&>(Base::wrapped());
}

Ref<ServiceWorkerGlobalScope> protectedWrapped() const;

public:
static constexpr unsigned StructureFlags = Base::StructureFlags | JSC::HasStaticPropertyTable;
protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ JSSharedWorkerGlobalScope::JSSharedWorkerGlobalScope(VM& vm, Structure* structur
{
}

Ref<SharedWorkerGlobalScope> JSSharedWorkerGlobalScope::protectedWrapped() const
{
return wrapped();
}

static_assert(!std::is_base_of<ActiveDOMObject, SharedWorkerGlobalScope>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");

#if ASSERT_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class JSSharedWorkerGlobalScope : public JSWorkerGlobalScope {
{
return static_cast<SharedWorkerGlobalScope&>(Base::wrapped());
}

Ref<SharedWorkerGlobalScope> protectedWrapped() const;

public:
static constexpr unsigned StructureFlags = Base::StructureFlags | JSC::HasStaticPropertyTable;
protected:
Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,11 @@ JSTestDOMJIT::JSTestDOMJIT(Structure* structure, JSDOMGlobalObject& globalObject
{
}

Ref<TestDOMJIT> JSTestDOMJIT::protectedWrapped() const
{
return wrapped();
}

JSObject* JSTestDOMJIT::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
{
auto* structure = JSTestDOMJITPrototype::createStructure(vm, &globalObject, JSNode::prototype(vm, globalObject));
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/bindings/scripts/test/JS/JSTestDOMJIT.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class JSTestDOMJIT : public JSNode {
{
return static_cast<TestDOMJIT&>(Base::wrapped());
}

Ref<TestDOMJIT> protectedWrapped() const;

protected:
JSTestDOMJIT(JSC::Structure*, JSDOMGlobalObject&, Ref<TestDOMJIT>&&);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ JSTestDefaultToJSONIndirectInheritance::JSTestDefaultToJSONIndirectInheritance(S
{
}

Ref<TestDefaultToJSONIndirectInheritance> JSTestDefaultToJSONIndirectInheritance::protectedWrapped() const
{
return wrapped();
}

static_assert(!std::is_base_of<ActiveDOMObject, TestDefaultToJSONIndirectInheritance>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");

JSObject* JSTestDefaultToJSONIndirectInheritance::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class JSTestDefaultToJSONIndirectInheritance : public JSTestDefaultToJSONInherit
{
return static_cast<TestDefaultToJSONIndirectInheritance&>(Base::wrapped());
}

Ref<TestDefaultToJSONIndirectInheritance> protectedWrapped() const;

protected:
JSTestDefaultToJSONIndirectInheritance(JSC::Structure*, JSDOMGlobalObject&, Ref<TestDefaultToJSONIndirectInheritance>&&);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ JSTestDefaultToJSONInherit::JSTestDefaultToJSONInherit(Structure* structure, JSD
{
}

Ref<TestDefaultToJSONInherit> JSTestDefaultToJSONInherit::protectedWrapped() const
{
return wrapped();
}

static_assert(!std::is_base_of<ActiveDOMObject, TestDefaultToJSONInherit>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");

JSObject* JSTestDefaultToJSONInherit::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class JSTestDefaultToJSONInherit : public JSTestDefaultToJSON {
{
return static_cast<TestDefaultToJSONInherit&>(Base::wrapped());
}

Ref<TestDefaultToJSONInherit> protectedWrapped() const;

protected:
JSTestDefaultToJSONInherit(JSC::Structure*, JSDOMGlobalObject&, Ref<TestDefaultToJSONInherit>&&);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ JSTestDefaultToJSONInheritFinal::JSTestDefaultToJSONInheritFinal(Structure* stru
{
}

Ref<TestDefaultToJSONInheritFinal> JSTestDefaultToJSONInheritFinal::protectedWrapped() const
{
return wrapped();
}

static_assert(!std::is_base_of<ActiveDOMObject, TestDefaultToJSONInheritFinal>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");

JSObject* JSTestDefaultToJSONInheritFinal::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class JSTestDefaultToJSONInheritFinal : public JSTestDefaultToJSONInherit {
{
return static_cast<TestDefaultToJSONInheritFinal&>(Base::wrapped());
}

Ref<TestDefaultToJSONInheritFinal> protectedWrapped() const;

protected:
JSTestDefaultToJSONInheritFinal(JSC::Structure*, JSDOMGlobalObject&, Ref<TestDefaultToJSONInheritFinal>&&);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ JSTestEventConstructor::JSTestEventConstructor(Structure* structure, JSDOMGlobal
{
}

Ref<TestEventConstructor> JSTestEventConstructor::protectedWrapped() const
{
return wrapped();
}

static_assert(!std::is_base_of<ActiveDOMObject, TestEventConstructor>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");

JSObject* JSTestEventConstructor::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ class JSTestEventConstructor : public JSEvent {
{
return static_cast<TestEventConstructor&>(Base::wrapped());
}

Ref<TestEventConstructor> protectedWrapped() const;

protected:
JSTestEventConstructor(JSC::Structure*, JSDOMGlobalObject&, Ref<TestEventConstructor>&&);

Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ JSTestEventTarget::JSTestEventTarget(Structure* structure, JSDOMGlobalObject& gl
{
}

Ref<TestEventTarget> JSTestEventTarget::protectedWrapped() const
{
return wrapped();
}

static_assert(!std::is_base_of<ActiveDOMObject, TestEventTarget>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject.");

JSObject* JSTestEventTarget::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ class JSTestEventTarget : public JSEventTarget {
{
return static_cast<TestEventTarget&>(Base::wrapped());
}

Ref<TestEventTarget> protectedWrapped() const;

public:
static constexpr unsigned StructureFlags = Base::StructureFlags | JSC::GetOwnPropertySlotIsImpureForPropertyAbsence | JSC::InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero | JSC::MasqueradesAsUndefined | JSC::OverridesGetOwnPropertyNames | JSC::OverridesGetOwnPropertySlot | JSC::OverridesPut;
protected:
Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/bindings/scripts/test/JS/JSTestNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ JSTestNode::JSTestNode(Structure* structure, JSDOMGlobalObject& globalObject, Re
{
}

Ref<TestNode> JSTestNode::protectedWrapped() const
{
return wrapped();
}

JSObject* JSTestNode::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
{
auto* structure = JSTestNodePrototype::createStructure(vm, &globalObject, JSNode::prototype(vm, globalObject));
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/bindings/scripts/test/JS/JSTestNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class WEBCORE_EXPORT JSTestNode : public JSNode {
{
return static_cast<TestNode&>(Base::wrapped());
}

Ref<TestNode> protectedWrapped() const;

protected:
JSTestNode(JSC::Structure*, JSDOMGlobalObject&, Ref<TestNode>&&);

Expand Down
Loading

0 comments on commit fd24e6d

Please sign in to comment.