/* This file is part of the WebKit open source project. This file has been generated by generate-bindings.pl. DO NOT MODIFY! This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "config.h" #include "JSReadableStreamSource.h" #include "ActiveDOMObject.h" #include "ExtendedDOMClientIsoSubspaces.h" #include "ExtendedDOMIsoSubspaces.h" #include "IDLTypes.h" #include "JSDOMAttribute.h" #include "JSDOMBinding.h" #include "JSDOMConvertAny.h" #include "JSDOMConvertBase.h" #include "JSDOMExceptionHandling.h" #include "JSDOMOperation.h" #include "JSDOMOperationReturningPromise.h" #include "JSDOMWrapperCache.h" #include "ScriptExecutionContext.h" #include "WebCoreJSClientData.h" #include #include #include #include #include #include #include #include namespace WebCore { using namespace JSC; // Functions static JSC_DECLARE_HOST_FUNCTION(jsReadableStreamSourcePrototypeFunction_start); static JSC_DECLARE_HOST_FUNCTION(jsReadableStreamSourcePrototypeFunction_pull); static JSC_DECLARE_HOST_FUNCTION(jsReadableStreamSourcePrototypeFunction_cancel); // Attributes static JSC_DECLARE_CUSTOM_GETTER(jsReadableStreamSource_controller); class JSReadableStreamSourcePrototype final : public JSC::JSNonFinalObject { public: using Base = JSC::JSNonFinalObject; static JSReadableStreamSourcePrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) { JSReadableStreamSourcePrototype* ptr = new (NotNull, JSC::allocateCell(vm)) JSReadableStreamSourcePrototype(vm, globalObject, structure); ptr->finishCreation(vm); return ptr; } DECLARE_INFO; template static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) { STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSReadableStreamSourcePrototype, Base); return &vm.plainObjectSpace(); } static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) { return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); } private: JSReadableStreamSourcePrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(vm, structure) { } void finishCreation(JSC::VM&); }; STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSReadableStreamSourcePrototype, JSReadableStreamSourcePrototype::Base); /* Hash table for prototype */ static const HashTableValue JSReadableStreamSourcePrototypeTableValues[] = { { "controller"_s, static_cast(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { HashTableValue::GetterSetterType, jsReadableStreamSource_controller, 0 } }, { "start"_s, static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsReadableStreamSourcePrototypeFunction_start, 1 } }, { "pull"_s, static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsReadableStreamSourcePrototypeFunction_pull, 1 } }, { "cancel"_s, static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsReadableStreamSourcePrototypeFunction_cancel, 1 } }, }; const ClassInfo JSReadableStreamSourcePrototype::s_info = { "ReadableStreamSource"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSReadableStreamSourcePrototype) }; void JSReadableStreamSourcePrototype::finishCreation(VM& vm) { Base::finishCreation(vm); // -- BUN ADDITION -- auto clientData = WebCore::clientData(vm); this->putDirect(vm, clientData->builtinNames().bunNativePtrPrivateName(), jsNumber(0), JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete | 0); this->putDirect(vm, clientData->builtinNames().bunNativeTypePrivateName(), jsNumber(0), JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete | 0); // -- BUN ADDITION -- reifyStaticProperties(vm, JSReadableStreamSource::info(), JSReadableStreamSourcePrototypeTableValues, *this); JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); } const ClassInfo JSReadableStreamSource::s_info = { "ReadableStreamSource"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSReadableStreamSource) }; JSReadableStreamSource::JSReadableStreamSource(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) : JSDOMWrapper(structure, globalObject, WTFMove(impl)) { } void JSReadableStreamSource::finishCreation(VM& vm) { Base::finishCreation(vm); ASSERT(inherits(info())); // static_assert(!std::is_base_of::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject."); } JSObject* JSReadableStreamSource::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) { return JSReadableStreamSourcePrototype::create(vm, &globalObject, JSReadableStreamSourcePrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); } JSObject* JSReadableStreamSource::prototype(VM& vm, JSDOMGlobalObject& globalObject) { return getDOMPrototype(vm, globalObject); } void JSReadableStreamSource::destroy(JSC::JSCell* cell) { JSReadableStreamSource* thisObject = static_cast(cell); thisObject->JSReadableStreamSource::~JSReadableStreamSource(); } static inline JSValue jsReadableStreamSource_controllerGetter(JSGlobalObject& lexicalGlobalObject, JSReadableStreamSource& thisObject) { UNUSED_PARAM(lexicalGlobalObject); return thisObject.controller(lexicalGlobalObject); } JSC_DEFINE_CUSTOM_GETTER(jsReadableStreamSource_controller, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) { return IDLAttribute::get(*lexicalGlobalObject, thisValue, attributeName); } static inline JSC::EncodedJSValue jsReadableStreamSourcePrototypeFunction_startBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperationReturningPromise::ClassParameter castedThis, Ref&& promise) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); RELEASE_AND_RETURN(throwScope, (JSValue::encode(castedThis->start(*lexicalGlobalObject, *callFrame, WTFMove(promise))))); } JSC_DEFINE_HOST_FUNCTION(jsReadableStreamSourcePrototypeFunction_start, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperationReturningPromise::call(*lexicalGlobalObject, *callFrame, "start"); } static inline JSC::EncodedJSValue jsReadableStreamSourcePrototypeFunction_pullBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperationReturningPromise::ClassParameter castedThis, Ref&& promise) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); RELEASE_AND_RETURN(throwScope, (JSValue::encode(castedThis->pull(*lexicalGlobalObject, *callFrame, WTFMove(promise))))); } JSC_DEFINE_HOST_FUNCTION(jsReadableStreamSourcePrototypeFunction_pull, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperationReturningPromise::call(*lexicalGlobalObject, *callFrame, "pull"); } static inline JSC::EncodedJSValue jsReadableStreamSourcePrototypeFunction_cancelBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) { auto& vm = JSC::getVM(lexicalGlobalObject); auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); auto& impl = castedThis->wrapped(); if (UNLIKELY(callFrame->argumentCount() < 1)) return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto reason = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.cancel(WTFMove(reason)); }))); } JSC_DEFINE_HOST_FUNCTION(jsReadableStreamSourcePrototypeFunction_cancel, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) { return IDLOperation::call(*lexicalGlobalObject, *callFrame, "cancel"); } JSC::GCClient::IsoSubspace* JSReadableStreamSource::subspaceForImpl(JSC::VM& vm) { return WebCore::subspaceForImpl( vm, [](auto& spaces) { return spaces.m_clientSubspaceForReadableStreamSource.get(); }, [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForReadableStreamSource = WTFMove(space); }, [](auto& spaces) { return spaces.m_subspaceForReadableStreamSource.get(); }, [](auto& spaces, auto&& space) { spaces.m_subspaceForReadableStreamSource = WTFMove(space); }); } template void JSReadableStreamSource::visitChildrenImpl(JSCell* cell, Visitor& visitor) { auto* thisObject = jsCast(cell); ASSERT_GC_OBJECT_INHERITS(thisObject, info()); Base::visitChildren(thisObject, visitor); visitor.append(thisObject->m_controller); } DEFINE_VISIT_CHILDREN(JSReadableStreamSource); void JSReadableStreamSource::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) { auto* thisObject = jsCast(cell); analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped()); if (thisObject->scriptExecutionContext()) analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); Base::analyzeHeap(cell, analyzer); } bool JSReadableStreamSourceOwner::isReachableFromOpaqueRoots(JSC::Handle handle, void*, AbstractSlotVisitor& visitor, const char** reason) { UNUSED_PARAM(handle); UNUSED_PARAM(visitor); UNUSED_PARAM(reason); return false; } void JSReadableStreamSourceOwner::finalize(JSC::Handle handle, void* context) { auto* jsReadableStreamSource = static_cast(handle.slot()->asCell()); auto& world = *static_cast(context); uncacheWrapper(world, &jsReadableStreamSource->wrapped(), jsReadableStreamSource); } JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& impl) { return createWrapper(globalObject, WTFMove(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, ReadableStreamSource& impl) { return wrap(lexicalGlobalObject, globalObject, impl); } ReadableStreamSource* JSReadableStreamSource::toWrapped(JSC::VM&, JSC::JSValue value) { if (auto* wrapper = jsDynamicCast(value)) return &wrapper->wrapped(); return nullptr; } } tion> Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2021-09-15Version Packages (#1377)astro@0.20.7Gravatar github-actions[bot] 23-30/+27
2021-09-15Update stats.ts (#1376)Gravatar Fred K. Schott 2-1/+6
2021-09-15Expose slots to components (#1368)Gravatar Jonathan Neal 10-0/+169
2021-09-15[ci] collect statsGravatar FredKSchott 1-0/+1
2021-09-14Revert "fix bad ci paths"Gravatar Fred K. Schott 1-5/+5
2021-09-15[ci] yarn formatGravatar FredKSchott 1-0/+1
2021-09-14Version Packages (#1358)astro@0.20.6@astrojs/renderer-vue@0.1.8@astrojs/renderer-svelte@0.1.2@astrojs/renderer-solid@0.1.1@astrojs/renderer-react@0.2.1@astrojs/renderer-preact@0.2.2@astrojs/renderer-lit@0.1.1Gravatar github-actions[bot] 41-70/+91
2021-09-14fix bad ci pathsGravatar Fred K. Schott 1-5/+5
2021-09-14update changesetsGravatar Fred K. Schott 1-1/+1
2021-09-14Fix passing Markdown content through props (#1259) (#1343)Gravatar kelvinsjk 4-0/+22
2021-09-14Improve stats logging to use `pretty-bytes` so that 20B doesn't get output as...Gravatar Caleb Jasik 4-2/+13
2021-09-14[ci] yarn formatGravatar FredKSchott 1-1/+1
2021-09-14Merge "Remove check for referenced files" (#1196)Gravatar (none) 6-6/+45
2021-09-14Docs: Add READMEs for renderers (#1351)Gravatar Drew Powers 8-1/+184
2021-09-14Update deployment docs for Netlify deployment (#1361)Gravatar Cassidy Williams 1-7/+9
2021-09-14Delete perfect-kids-occur.md (#1372)Gravatar Fred K. Schott 1-5/+0
2021-09-14[ci] yarn formatGravatar FredKSchott 1-15/+10
2021-09-14Self-host homepage fonts to improve page load speed (#1370)Gravatar mundry 14-5/+52
2021-09-14Add types to examples and docs (#1347)Gravatar Matthew Phillips 8-20/+60
2021-09-14[ci] collect statsGravatar FredKSchott 1-0/+1
2021-09-13Fix typo (#1360)Gravatar Marcus Otterström 1-1/+1
2021-09-13Disclaimer for Github pages / jekyll quirk (#1355)Gravatar Tc001 2-0/+7
2021-09-13fix outdated lockfile issue (#1357)Gravatar Fred K. Schott 1-3/+1
2021-09-13Add `astro.build/play` link (#1359)Gravatar Nate Moore 1-0/+6
2021-09-13[ci] yarn formatGravatar FredKSchott 2-8/+7
2021-09-13Add a new lockfile (#1356)Gravatar Matthew Phillips 1-19/+19
2021-09-13[ci] collect statsGravatar FredKSchott 1-0/+1
2021-09-12[ci] collect statsGravatar FredKSchott 1-0/+1
2021-09-11[ci] collect statsGravatar FredKSchott 1-0/+1
2021-09-10Prevent removing CSS preloads during bundling (#1326)Gravatar Bartek Igielski 8-18/+96
2021-09-10Fix typos in Netlify sponsorship announcement blog post (#1346)Gravatar mundry 1-4/+4
2021-09-10[ci] collect statsGravatar FredKSchott 2-1/+2
2021-09-09blog: announce netlify sponsorship (#1345)Gravatar Fred K. Schott 4-5/+64
2021-09-09Version Packages (#1344)Gravatar github-actions[bot] 29-53/+42
2021-09-09Revert "Version Packages (#1303)"Gravatar Fred K. Schott 29-42/+53
2021-09-09update lockfileastro@0.20.5@astrojs/markdown-support@0.3.1Gravatar Fred K. Schott 1-9/+9
2021-09-09Version Packages (#1303)Gravatar github-actions[bot] 29-53/+42
2021-09-09[ci] collect statsGravatar FredKSchott 2-1/+2
2021-09-08Update netlify deploy instructions for `.nvmrc` syntax (#1337)Gravatar Caleb Jasik 1-1/+1
2021-09-08[ci] yarn formatGravatar jasikpark 1-1/+0