| /* |
| 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 "JSWorkerGlobalScope.h" |
| |
| #include "EventNames.h" |
| #include "ExceptionCode.h" |
| #include "JSBlob.h" |
| #include "JSCrypto.h" |
| #include "JSDOMBinding.h" |
| #include "JSDOMConstructor.h" |
| #include "JSDOMConvert.h" |
| #include "JSDOMCoreException.h" |
| #include "JSDOMPromise.h" |
| #include "JSDOMURL.h" |
| #include "JSErrorEvent.h" |
| #include "JSErrorHandler.h" |
| #include "JSEvent.h" |
| #include "JSEventListener.h" |
| #include "JSEventSource.h" |
| #include "JSEventTarget.h" |
| #include "JSFileReader.h" |
| #include "JSFileReaderSync.h" |
| #include "JSImageData.h" |
| #include "JSMessageEvent.h" |
| #include "JSMessagePort.h" |
| #include "JSProgressEvent.h" |
| #include "JSURLSearchParams.h" |
| #include "JSWorkerGlobalScope.h" |
| #include "JSWorkerLocation.h" |
| #include "JSWorkerNavigator.h" |
| #include "JSXMLHttpRequest.h" |
| #include "JSXMLHttpRequestEventTarget.h" |
| #include "RuntimeEnabledFeatures.h" |
| #include "URL.h" |
| #include "WebCoreJSClientData.h" |
| #include "WorkerGlobalScope.h" |
| #include "WorkerGlobalScopeIndexedDatabase.h" |
| #include <runtime/Error.h> |
| #include <runtime/JSString.h> |
| #include <wtf/GetPtr.h> |
| |
| #if ENABLE(CHANNEL_MESSAGING) |
| #include "JSMessageChannel.h" |
| #endif |
| |
| #if ENABLE(FETCH_API) |
| #include "JSFetchHeaders.h" |
| #include "JSFetchRequest.h" |
| #include "JSFetchResponse.h" |
| #include "WorkerGlobalScopeFetch.h" |
| #include "WorkerGlobalScopeFetchBuiltins.h" |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| #include "JSIDBCursor.h" |
| #include "JSIDBCursorWithValue.h" |
| #include "JSIDBDatabase.h" |
| #include "JSIDBFactory.h" |
| #include "JSIDBIndex.h" |
| #include "JSIDBKeyRange.h" |
| #include "JSIDBObjectStore.h" |
| #include "JSIDBOpenDBRequest.h" |
| #include "JSIDBRequest.h" |
| #include "JSIDBTransaction.h" |
| #include "JSIDBVersionChangeEvent.h" |
| #endif |
| |
| #if ENABLE(READABLE_STREAM_API) |
| #include "JSReadableStream.h" |
| #endif |
| |
| #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) |
| #include "JSByteLengthQueuingStrategy.h" |
| #include "JSCountQueuingStrategy.h" |
| #endif |
| |
| #if ENABLE(WEB_SOCKETS) |
| #include "JSWebSocket.h" |
| #endif |
| |
| using namespace JSC; |
| |
| namespace WebCore { |
| |
| // Functions |
| |
| JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionClose(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionImportScripts(JSC::ExecState*); |
| #if ENABLE(FETCH_API) |
| JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionFetchRequest(JSC::ExecState*); |
| #endif |
| JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionSetTimeout(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionClearTimeout(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionSetInterval(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionClearInterval(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionAtob(JSC::ExecState*); |
| JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionBtoa(JSC::ExecState*); |
| |
| // Attributes |
| |
| JSC::EncodedJSValue jsWorkerGlobalScopeSelf(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| JSC::EncodedJSValue jsWorkerGlobalScopeLocation(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| JSC::EncodedJSValue jsWorkerGlobalScopeOnerror(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeOnerror(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeOnoffline(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeOnoffline(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeOnonline(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeOnonline(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeNavigator(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| JSC::EncodedJSValue jsWorkerGlobalScopeWebkitURLConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeWebkitURLConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIDBCursorConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeIDBCursorConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIDBCursorWithValueConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeIDBCursorWithValueConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIDBDatabaseConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeIDBDatabaseConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIDBFactoryConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeIDBFactoryConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIDBIndexConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeIDBIndexConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIDBKeyRangeConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeIDBKeyRangeConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIDBObjectStoreConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeIDBObjectStoreConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIDBOpenDBRequestConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeIDBOpenDBRequestConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIDBRequestConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeIDBRequestConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIDBTransactionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeIDBTransactionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIDBVersionChangeEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeIDBVersionChangeEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeIndexedDB(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| #endif |
| JSC::EncodedJSValue jsWorkerGlobalScopeCrypto(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| #if ENABLE(FETCH_API) |
| JSC::EncodedJSValue jsWorkerGlobalScopeHeadersConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeHeadersConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(FETCH_API) |
| JSC::EncodedJSValue jsWorkerGlobalScopeRequestConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeRequestConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(FETCH_API) |
| JSC::EncodedJSValue jsWorkerGlobalScopeResponseConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeResponseConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) |
| JSC::EncodedJSValue jsWorkerGlobalScopeByteLengthQueuingStrategyConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeByteLengthQueuingStrategyConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) |
| JSC::EncodedJSValue jsWorkerGlobalScopeCountQueuingStrategyConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeCountQueuingStrategyConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(READABLE_STREAM_API) |
| JSC::EncodedJSValue jsWorkerGlobalScopeReadableStreamConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeReadableStreamConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(WEB_SOCKETS) |
| JSC::EncodedJSValue jsWorkerGlobalScopeWebSocketConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeWebSocketConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| JSC::EncodedJSValue jsWorkerGlobalScopeDOMExceptionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeDOMExceptionConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeErrorEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeErrorEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeEventTargetConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeEventTargetConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #if ENABLE(CHANNEL_MESSAGING) |
| JSC::EncodedJSValue jsWorkerGlobalScopeMessageChannelConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeMessageChannelConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| JSC::EncodedJSValue jsWorkerGlobalScopeMessageEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeMessageEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeMessagePortConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeMessagePortConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeProgressEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeProgressEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeBlobConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeBlobConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeFileReaderConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeFileReaderConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeFileReaderSyncConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeFileReaderSyncConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeURLConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeURLConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeImageDataConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeImageDataConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeURLSearchParamsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeURLSearchParamsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeCryptoConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeCryptoConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeEventSourceConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeEventSourceConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeWorkerNavigatorConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeWorkerNavigatorConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeWorkerGlobalScopeConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeWorkerGlobalScopeConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeWorkerLocationConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeWorkerLocationConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeXMLHttpRequestConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeXMLHttpRequestConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeXMLHttpRequestEventTargetConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeXMLHttpRequestEventTargetConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsWorkerGlobalScopeConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSWorkerGlobalScopeConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| |
| typedef JSDOMConstructorNotConstructable<JSWorkerGlobalScope> JSWorkerGlobalScopeConstructor; |
| |
| /* Hash table */ |
| |
| static const struct CompactHashIndex JSWorkerGlobalScopeTableIndex[68] = { |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 16, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 11, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 7, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 18, -1 }, |
| { -1, -1 }, |
| { 10, -1 }, |
| { 8, 67 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 23, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 22, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 0, 64 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 9, -1 }, |
| { 3, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 17, -1 }, |
| { -1, -1 }, |
| { 14, 66 }, |
| { 20, -1 }, |
| { -1, -1 }, |
| { 19, -1 }, |
| { 4, -1 }, |
| { -1, -1 }, |
| { 13, -1 }, |
| { 1, -1 }, |
| { 5, -1 }, |
| { 2, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 15, -1 }, |
| { 6, 65 }, |
| { 12, -1 }, |
| { 21, -1 }, |
| { 24, -1 }, |
| }; |
| |
| |
| static const HashTableValue JSWorkerGlobalScopeTableValues[] = |
| { |
| { "webkitURL", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebkitURLConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebkitURLConstructor) } }, |
| #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) |
| { "ByteLengthQueuingStrategy", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeByteLengthQueuingStrategyConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeByteLengthQueuingStrategyConstructor) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) |
| { "CountQueuingStrategy", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeCountQueuingStrategyConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeCountQueuingStrategyConstructor) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(READABLE_STREAM_API) |
| { "ReadableStream", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeReadableStreamConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeReadableStreamConstructor) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| { "DOMException", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeDOMExceptionConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeDOMExceptionConstructor) } }, |
| { "ErrorEvent", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeErrorEventConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeErrorEventConstructor) } }, |
| { "Event", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeEventConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeEventConstructor) } }, |
| { "EventTarget", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeEventTargetConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeEventTargetConstructor) } }, |
| #if ENABLE(CHANNEL_MESSAGING) |
| { "MessageChannel", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeMessageChannelConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeMessageChannelConstructor) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| { "MessageEvent", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeMessageEventConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeMessageEventConstructor) } }, |
| { "MessagePort", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeMessagePortConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeMessagePortConstructor) } }, |
| { "ProgressEvent", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeProgressEventConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeProgressEventConstructor) } }, |
| { "Blob", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeBlobConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeBlobConstructor) } }, |
| { "FileReader", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeFileReaderConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeFileReaderConstructor) } }, |
| { "FileReaderSync", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeFileReaderSyncConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeFileReaderSyncConstructor) } }, |
| { "URL", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeURLConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeURLConstructor) } }, |
| { "ImageData", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeImageDataConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeImageDataConstructor) } }, |
| { "URLSearchParams", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeURLSearchParamsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeURLSearchParamsConstructor) } }, |
| { "Crypto", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeCryptoConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeCryptoConstructor) } }, |
| { "EventSource", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeEventSourceConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeEventSourceConstructor) } }, |
| { "WorkerNavigator", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWorkerNavigatorConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWorkerNavigatorConstructor) } }, |
| { "WorkerGlobalScope", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWorkerGlobalScopeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWorkerGlobalScopeConstructor) } }, |
| { "WorkerLocation", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWorkerLocationConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWorkerLocationConstructor) } }, |
| { "XMLHttpRequest", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeXMLHttpRequestConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeXMLHttpRequestConstructor) } }, |
| { "XMLHttpRequestEventTarget", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeXMLHttpRequestEventTargetConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeXMLHttpRequestEventTargetConstructor) } }, |
| }; |
| |
| static const HashTable JSWorkerGlobalScopeTable = { 25, 63, true, JSWorkerGlobalScopeTableValues, JSWorkerGlobalScopeTableIndex }; |
| template<> JSValue JSWorkerGlobalScopeConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| { |
| return JSEventTarget::getConstructor(vm, &globalObject); |
| } |
| |
| template<> void JSWorkerGlobalScopeConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| putDirect(vm, vm.propertyNames->prototype, JSWorkerGlobalScope::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum); |
| putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("WorkerGlobalScope"))), ReadOnly | DontEnum); |
| putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum); |
| } |
| |
| template<> const ClassInfo JSWorkerGlobalScopeConstructor::s_info = { "WorkerGlobalScope", &Base::s_info, 0, CREATE_METHOD_TABLE(JSWorkerGlobalScopeConstructor) }; |
| |
| /* Hash table for prototype */ |
| |
| static const struct CompactHashIndex JSWorkerGlobalScopePrototypeTableIndex[66] = { |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 4, -1 }, |
| { -1, -1 }, |
| { 11, -1 }, |
| { 15, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 10, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 0, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 1, 65 }, |
| { 7, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 6, -1 }, |
| { -1, -1 }, |
| { 3, -1 }, |
| { -1, -1 }, |
| { 2, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 5, -1 }, |
| { 9, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 8, 64 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 13, -1 }, |
| { -1, -1 }, |
| { -1, -1 }, |
| { 12, -1 }, |
| { 14, -1 }, |
| }; |
| |
| |
| static const HashTableValue JSWorkerGlobalScopePrototypeTableValues[] = |
| { |
| { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeConstructor) } }, |
| { "self", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeSelf), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "location", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeLocation), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "onerror", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeOnerror), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeOnerror) } }, |
| { "onoffline", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeOnoffline), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeOnoffline) } }, |
| { "ononline", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeOnonline), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeOnonline) } }, |
| { "navigator", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeNavigator), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "crypto", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeCrypto), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| { "close", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionClose), (intptr_t) (0) } }, |
| { "importScripts", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionImportScripts), (intptr_t) (0) } }, |
| { "setTimeout", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionSetTimeout), (intptr_t) (1) } }, |
| { "clearTimeout", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionClearTimeout), (intptr_t) (0) } }, |
| { "setInterval", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionSetInterval), (intptr_t) (1) } }, |
| { "clearInterval", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionClearInterval), (intptr_t) (0) } }, |
| { "atob", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionAtob), (intptr_t) (1) } }, |
| { "btoa", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionBtoa), (intptr_t) (1) } }, |
| }; |
| |
| static const HashTable JSWorkerGlobalScopePrototypeTable = { 16, 63, true, JSWorkerGlobalScopePrototypeTableValues, JSWorkerGlobalScopePrototypeTableIndex }; |
| const ClassInfo JSWorkerGlobalScopePrototype::s_info = { "WorkerGlobalScopePrototype", &Base::s_info, &JSWorkerGlobalScopePrototypeTable, CREATE_METHOD_TABLE(JSWorkerGlobalScopePrototype) }; |
| |
| const ClassInfo JSWorkerGlobalScope::s_info = { "WorkerGlobalScope", &Base::s_info, &JSWorkerGlobalScopeTable, CREATE_METHOD_TABLE(JSWorkerGlobalScope) }; |
| |
| JSWorkerGlobalScope::JSWorkerGlobalScope(VM& vm, Structure* structure, Ref<WorkerGlobalScope>&& impl) |
| : JSWorkerGlobalScopeBase(vm, structure, WTFMove(impl)) |
| { |
| } |
| |
| void JSWorkerGlobalScope::finishCreation(VM& vm, JSProxy* proxy) |
| { |
| Base::finishCreation(vm, proxy); |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIDBCursorConstructor, setJSWorkerGlobalScopeIDBCursorConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->IDBCursor, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIDBCursorWithValueConstructor, setJSWorkerGlobalScopeIDBCursorWithValueConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->IDBCursorWithValue, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIDBDatabaseConstructor, setJSWorkerGlobalScopeIDBDatabaseConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->IDBDatabase, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIDBFactoryConstructor, setJSWorkerGlobalScopeIDBFactoryConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->IDBFactory, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIDBIndexConstructor, setJSWorkerGlobalScopeIDBIndexConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->IDBIndex, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIDBKeyRangeConstructor, setJSWorkerGlobalScopeIDBKeyRangeConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->IDBKeyRange, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIDBObjectStoreConstructor, setJSWorkerGlobalScopeIDBObjectStoreConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->IDBObjectStore, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIDBOpenDBRequestConstructor, setJSWorkerGlobalScopeIDBOpenDBRequestConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->IDBOpenDBRequest, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIDBRequestConstructor, setJSWorkerGlobalScopeIDBRequestConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->IDBRequest, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIDBTransactionConstructor, setJSWorkerGlobalScopeIDBTransactionConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->IDBTransaction, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIDBVersionChangeEventConstructor, setJSWorkerGlobalScopeIDBVersionChangeEventConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->IDBVersionChangeEvent, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| if (RuntimeEnabledFeatures::sharedFeatures().indexedDBWorkersEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeIndexedDB, nullptr); |
| putDirectCustomAccessor(vm, vm.propertyNames->indexedDB, customGetterSetter, attributesForStructure(ReadOnly | CustomAccessor)); |
| } |
| #endif |
| #if ENABLE(FETCH_API) |
| if (RuntimeEnabledFeatures::sharedFeatures().fetchAPIEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeHeadersConstructor, setJSWorkerGlobalScopeHeadersConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->Headers, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(FETCH_API) |
| if (RuntimeEnabledFeatures::sharedFeatures().fetchAPIEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeRequestConstructor, setJSWorkerGlobalScopeRequestConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->Request, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(FETCH_API) |
| if (RuntimeEnabledFeatures::sharedFeatures().fetchAPIEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeResponseConstructor, setJSWorkerGlobalScopeResponseConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->Response, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(WEB_SOCKETS) |
| if (RuntimeEnabledFeatures::sharedFeatures().webSocketEnabled()) { |
| auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeWebSocketConstructor, setJSWorkerGlobalScopeWebSocketConstructor); |
| putDirectCustomAccessor(vm, vm.propertyNames->WebSocket, customGetterSetter, attributesForStructure(DontEnum)); |
| } |
| #endif |
| #if ENABLE(FETCH_API) |
| putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().HeadersPrivateName(), CustomGetterSetter::create(vm, jsWorkerGlobalScopeHeadersConstructor, nullptr), attributesForStructure(DontDelete | ReadOnly)); |
| #endif |
| #if ENABLE(FETCH_API) |
| putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().RequestPrivateName(), CustomGetterSetter::create(vm, jsWorkerGlobalScopeRequestConstructor, nullptr), attributesForStructure(DontDelete | ReadOnly)); |
| #endif |
| #if ENABLE(FETCH_API) |
| putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().ResponsePrivateName(), CustomGetterSetter::create(vm, jsWorkerGlobalScopeResponseConstructor, nullptr), attributesForStructure(DontDelete | ReadOnly)); |
| #endif |
| #if ENABLE(READABLE_STREAM_API) |
| putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().ReadableStreamPrivateName(), CustomGetterSetter::create(vm, jsWorkerGlobalScopeReadableStreamConstructor, nullptr), attributesForStructure(DontDelete | ReadOnly)); |
| #endif |
| putDirectCustomAccessor(vm, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().XMLHttpRequestPrivateName(), CustomGetterSetter::create(vm, jsWorkerGlobalScopeXMLHttpRequestConstructor, nullptr), attributesForStructure(DontDelete | ReadOnly)); |
| #if ENABLE(FETCH_API) |
| if (RuntimeEnabledFeatures::sharedFeatures().fetchAPIEnabled()) |
| putDirectBuiltinFunction(vm, this, vm.propertyNames->fetch, workerGlobalScopeFetchFetchCodeGenerator(vm), attributesForStructure(JSC::Builtin)); |
| #endif |
| #if ENABLE(FETCH_API) |
| if (RuntimeEnabledFeatures::sharedFeatures().fetchAPIEnabled()) |
| putDirectNativeFunction(vm, this, static_cast<JSVMClientData*>(vm.clientData)->builtinNames().fetchRequestPrivateName(), 1, jsWorkerGlobalScopePrototypeFunctionFetchRequest, NoIntrinsic, attributesForStructure(JSC::Function)); |
| #endif |
| } |
| |
| JSObject* JSWorkerGlobalScope::createPrototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return JSWorkerGlobalScopePrototype::create(vm, globalObject, JSWorkerGlobalScopePrototype::createStructure(vm, globalObject, JSEventTarget::prototype(vm, globalObject))); |
| } |
| |
| JSObject* JSWorkerGlobalScope::prototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return getDOMPrototype<JSWorkerGlobalScope>(vm, globalObject); |
| } |
| |
| EncodedJSValue jsWorkerGlobalScopeSelf(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "self"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.self()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeLocation(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "location"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.location()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeOnerror(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "onerror"); |
| } |
| UNUSED_PARAM(state); |
| return JSValue::encode(eventHandlerAttribute(castedThis->wrapped(), eventNames().errorEvent)); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeOnoffline(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "onoffline"); |
| } |
| UNUSED_PARAM(state); |
| return JSValue::encode(eventHandlerAttribute(castedThis->wrapped(), eventNames().offlineEvent)); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeOnonline(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "ononline"); |
| } |
| UNUSED_PARAM(state); |
| return JSValue::encode(eventHandlerAttribute(castedThis->wrapped(), eventNames().onlineEvent)); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeNavigator(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "navigator"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.navigator()); |
| return JSValue::encode(result); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeWebkitURLConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "webkitURL"); |
| } |
| return JSValue::encode(JSDOMURL::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIDBCursorConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBCursor"); |
| } |
| return JSValue::encode(JSIDBCursor::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIDBCursorWithValueConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBCursorWithValue"); |
| } |
| return JSValue::encode(JSIDBCursorWithValue::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIDBDatabaseConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBDatabase"); |
| } |
| return JSValue::encode(JSIDBDatabase::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIDBFactoryConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBFactory"); |
| } |
| return JSValue::encode(JSIDBFactory::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIDBIndexConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBIndex"); |
| } |
| return JSValue::encode(JSIDBIndex::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIDBKeyRangeConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBKeyRange"); |
| } |
| return JSValue::encode(JSIDBKeyRange::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIDBObjectStoreConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBObjectStore"); |
| } |
| return JSValue::encode(JSIDBObjectStore::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIDBOpenDBRequestConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBOpenDBRequest"); |
| } |
| return JSValue::encode(JSIDBOpenDBRequest::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIDBRequestConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBRequest"); |
| } |
| return JSValue::encode(JSIDBRequest::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIDBTransactionConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBTransaction"); |
| } |
| return JSValue::encode(JSIDBTransaction::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIDBVersionChangeEventConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBVersionChangeEvent"); |
| } |
| return JSValue::encode(JSIDBVersionChangeEvent::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| EncodedJSValue jsWorkerGlobalScopeIndexedDB(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "indexedDB"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), WebCore::WorkerGlobalScopeIndexedDatabase::indexedDB(impl)); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| EncodedJSValue jsWorkerGlobalScopeCrypto(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "crypto"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), impl.crypto()); |
| return JSValue::encode(result); |
| } |
| |
| |
| #if ENABLE(FETCH_API) |
| EncodedJSValue jsWorkerGlobalScopeHeadersConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "Headers"); |
| } |
| return JSValue::encode(JSFetchHeaders::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(FETCH_API) |
| EncodedJSValue jsWorkerGlobalScopeRequestConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "Request"); |
| } |
| return JSValue::encode(JSFetchRequest::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(FETCH_API) |
| EncodedJSValue jsWorkerGlobalScopeResponseConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "Response"); |
| } |
| return JSValue::encode(JSFetchResponse::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) |
| EncodedJSValue jsWorkerGlobalScopeByteLengthQueuingStrategyConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "ByteLengthQueuingStrategy"); |
| } |
| return JSValue::encode(JSByteLengthQueuingStrategy::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) |
| EncodedJSValue jsWorkerGlobalScopeCountQueuingStrategyConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "CountQueuingStrategy"); |
| } |
| return JSValue::encode(JSCountQueuingStrategy::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(READABLE_STREAM_API) |
| EncodedJSValue jsWorkerGlobalScopeReadableStreamConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "ReadableStream"); |
| } |
| return JSValue::encode(JSReadableStream::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| #if ENABLE(WEB_SOCKETS) |
| EncodedJSValue jsWorkerGlobalScopeWebSocketConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "WebSocket"); |
| } |
| return JSValue::encode(JSWebSocket::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| EncodedJSValue jsWorkerGlobalScopeDOMExceptionConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "DOMException"); |
| } |
| return JSValue::encode(JSDOMCoreException::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeErrorEventConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "ErrorEvent"); |
| } |
| return JSValue::encode(JSErrorEvent::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeEventConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "Event"); |
| } |
| return JSValue::encode(JSEvent::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeEventTargetConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "EventTarget"); |
| } |
| return JSValue::encode(JSEventTarget::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| #if ENABLE(CHANNEL_MESSAGING) |
| EncodedJSValue jsWorkerGlobalScopeMessageChannelConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "MessageChannel"); |
| } |
| return JSValue::encode(JSMessageChannel::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| #endif |
| |
| EncodedJSValue jsWorkerGlobalScopeMessageEventConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "MessageEvent"); |
| } |
| return JSValue::encode(JSMessageEvent::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeMessagePortConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "MessagePort"); |
| } |
| return JSValue::encode(JSMessagePort::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeProgressEventConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "ProgressEvent"); |
| } |
| return JSValue::encode(JSProgressEvent::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeBlobConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "Blob"); |
| } |
| return JSValue::encode(JSBlob::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeFileReaderConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "FileReader"); |
| } |
| return JSValue::encode(JSFileReader::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeFileReaderSyncConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "FileReaderSync"); |
| } |
| return JSValue::encode(JSFileReaderSync::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeURLConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "URL"); |
| } |
| return JSValue::encode(JSDOMURL::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeImageDataConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "ImageData"); |
| } |
| return JSValue::encode(JSImageData::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeURLSearchParamsConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "URLSearchParams"); |
| } |
| return JSValue::encode(JSURLSearchParams::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeCryptoConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "Crypto"); |
| } |
| return JSValue::encode(JSCrypto::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeEventSourceConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "EventSource"); |
| } |
| return JSValue::encode(JSEventSource::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeWorkerNavigatorConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "WorkerNavigator"); |
| } |
| return JSValue::encode(JSWorkerNavigator::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeWorkerGlobalScopeConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "WorkerGlobalScope"); |
| } |
| return JSValue::encode(JSWorkerGlobalScope::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeWorkerLocationConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "WorkerLocation"); |
| } |
| return JSValue::encode(JSWorkerLocation::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeXMLHttpRequestConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "XMLHttpRequest"); |
| } |
| return JSValue::encode(JSXMLHttpRequest::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeXMLHttpRequestEventTargetConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = toJSWorkerGlobalScope(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, throwScope, "WorkerGlobalScope", "XMLHttpRequestEventTarget"); |
| } |
| return JSValue::encode(JSXMLHttpRequestEventTarget::getConstructor(state->vm(), castedThis->globalObject())); |
| } |
| |
| |
| EncodedJSValue jsWorkerGlobalScopeConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| JSWorkerGlobalScopePrototype* domObject = jsDynamicCast<JSWorkerGlobalScopePrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!domObject)) |
| return throwVMTypeError(state, throwScope); |
| return JSValue::encode(JSWorkerGlobalScope::getConstructor(state->vm(), domObject->globalObject())); |
| } |
| |
| bool setJSWorkerGlobalScopeConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| JSValue value = JSValue::decode(encodedValue); |
| JSWorkerGlobalScopePrototype* domObject = jsDynamicCast<JSWorkerGlobalScopePrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!domObject)) { |
| throwVMTypeError(state, throwScope); |
| return false; |
| } |
| // Shadowing a built-in constructor |
| return domObject->putDirect(state->vm(), state->propertyNames().constructor, value); |
| } |
| |
| bool setJSWorkerGlobalScopeOnerror(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "onerror"); |
| } |
| castedThis->wrapped().setAttributeEventListener(eventNames().errorEvent, createJSErrorHandler(state, value, castedThis)); |
| return true; |
| } |
| |
| |
| bool setJSWorkerGlobalScopeOnoffline(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "onoffline"); |
| } |
| setEventHandlerAttribute(*state, *castedThis, castedThis->wrapped(), eventNames().offlineEvent, value); |
| return true; |
| } |
| |
| |
| bool setJSWorkerGlobalScopeOnonline(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "ononline"); |
| } |
| setEventHandlerAttribute(*state, *castedThis, castedThis->wrapped(), eventNames().onlineEvent, value); |
| return true; |
| } |
| |
| |
| bool setJSWorkerGlobalScopeWebkitURLConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "webkitURL"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "webkitURL"), value); |
| } |
| |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| bool setJSWorkerGlobalScopeIDBCursorConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBCursor"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "IDBCursor"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| bool setJSWorkerGlobalScopeIDBCursorWithValueConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBCursorWithValue"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "IDBCursorWithValue"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| bool setJSWorkerGlobalScopeIDBDatabaseConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBDatabase"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "IDBDatabase"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| bool setJSWorkerGlobalScopeIDBFactoryConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBFactory"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "IDBFactory"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| bool setJSWorkerGlobalScopeIDBIndexConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBIndex"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "IDBIndex"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| bool setJSWorkerGlobalScopeIDBKeyRangeConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBKeyRange"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "IDBKeyRange"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| bool setJSWorkerGlobalScopeIDBObjectStoreConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBObjectStore"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "IDBObjectStore"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| bool setJSWorkerGlobalScopeIDBOpenDBRequestConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBOpenDBRequest"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "IDBOpenDBRequest"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| bool setJSWorkerGlobalScopeIDBRequestConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBRequest"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "IDBRequest"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| bool setJSWorkerGlobalScopeIDBTransactionConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBTransaction"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "IDBTransaction"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(INDEXED_DATABASE_IN_WORKERS) |
| bool setJSWorkerGlobalScopeIDBVersionChangeEventConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "IDBVersionChangeEvent"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "IDBVersionChangeEvent"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(FETCH_API) |
| bool setJSWorkerGlobalScopeHeadersConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "Headers"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "Headers"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(FETCH_API) |
| bool setJSWorkerGlobalScopeRequestConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "Request"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "Request"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(FETCH_API) |
| bool setJSWorkerGlobalScopeResponseConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "Response"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "Response"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) |
| bool setJSWorkerGlobalScopeByteLengthQueuingStrategyConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "ByteLengthQueuingStrategy"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "ByteLengthQueuingStrategy"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(READABLE_STREAM_API) || ENABLE(WRITABLE_STREAM_API) |
| bool setJSWorkerGlobalScopeCountQueuingStrategyConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "CountQueuingStrategy"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "CountQueuingStrategy"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(READABLE_STREAM_API) |
| bool setJSWorkerGlobalScopeReadableStreamConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "ReadableStream"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "ReadableStream"), value); |
| } |
| |
| #endif |
| |
| #if ENABLE(WEB_SOCKETS) |
| bool setJSWorkerGlobalScopeWebSocketConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "WebSocket"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "WebSocket"), value); |
| } |
| |
| #endif |
| |
| bool setJSWorkerGlobalScopeDOMExceptionConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "DOMException"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "DOMException"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeErrorEventConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "ErrorEvent"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "ErrorEvent"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeEventConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "Event"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "Event"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeEventTargetConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "EventTarget"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "EventTarget"), value); |
| } |
| |
| |
| #if ENABLE(CHANNEL_MESSAGING) |
| bool setJSWorkerGlobalScopeMessageChannelConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "MessageChannel"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "MessageChannel"), value); |
| } |
| |
| #endif |
| |
| bool setJSWorkerGlobalScopeMessageEventConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "MessageEvent"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "MessageEvent"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeMessagePortConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "MessagePort"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "MessagePort"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeProgressEventConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "ProgressEvent"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "ProgressEvent"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeBlobConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "Blob"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "Blob"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeFileReaderConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "FileReader"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "FileReader"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeFileReaderSyncConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "FileReaderSync"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "FileReaderSync"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeURLConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "URL"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "URL"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeImageDataConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "ImageData"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "ImageData"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeURLSearchParamsConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "URLSearchParams"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "URLSearchParams"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeCryptoConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "Crypto"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "Crypto"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeEventSourceConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "EventSource"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "EventSource"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeWorkerNavigatorConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "WorkerNavigator"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "WorkerNavigator"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeWorkerGlobalScopeConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "WorkerGlobalScope"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "WorkerGlobalScope"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeWorkerLocationConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "WorkerLocation"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "WorkerLocation"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeXMLHttpRequestConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "XMLHttpRequest"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "XMLHttpRequest"), value); |
| } |
| |
| |
| bool setJSWorkerGlobalScopeXMLHttpRequestEventTargetConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, throwScope, "WorkerGlobalScope", "XMLHttpRequestEventTarget"); |
| } |
| // Shadowing a built-in constructor. |
| return castedThis->putDirect(state->vm(), Identifier::fromString(state, "XMLHttpRequestEventTarget"), value); |
| } |
| |
| |
| JSValue JSWorkerGlobalScope::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| { |
| return getDOMConstructor<JSWorkerGlobalScopeConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionClose(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode)); |
| if (UNLIKELY(!castedThis)) |
| return throwVMTypeError(state, throwScope); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.close(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionImportScripts(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode)); |
| if (UNLIKELY(!castedThis)) |
| return throwVMTypeError(state, throwScope); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info()); |
| return JSValue::encode(castedThis->importScripts(*state)); |
| } |
| |
| #if ENABLE(FETCH_API) |
| static EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetchRequestPromise(ExecState*, Ref<DeferredPromise>&&); |
| |
| EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionFetchRequest(ExecState* state) |
| { |
| ASSERT(state); |
| return JSValue::encode(callPromiseFunction<jsWorkerGlobalScopePrototypeFunctionFetchRequestPromise, PromiseExecutionScope::WindowOrWorker>(*state)); |
| } |
| |
| static inline EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetchRequestPromise(ExecState* state, Ref<DeferredPromise>&& promise) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode)); |
| if (UNLIKELY(!castedThis)) |
| return throwVMTypeError(state, throwScope); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| auto request = JSFetchRequest::toWrapped(state->uncheckedArgument(0)); |
| if (UNLIKELY(!request)) |
| return throwArgumentTypeError(*state, throwScope, 0, "request", "WorkerGlobalScope", "fetchRequest", "FetchRequest"); |
| WebCore::WorkerGlobalScopeFetch::fetch(impl, *request, WTFMove(promise)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionSetTimeout(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode)); |
| if (UNLIKELY(!castedThis)) |
| return throwVMTypeError(state, throwScope); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info()); |
| return JSValue::encode(castedThis->setTimeout(*state)); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionClearTimeout(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode)); |
| if (UNLIKELY(!castedThis)) |
| return throwVMTypeError(state, throwScope); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info()); |
| auto& impl = castedThis->wrapped(); |
| auto handle = convert<int32_t>(*state, state->argument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.clearTimeout(WTFMove(handle)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionSetInterval(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode)); |
| if (UNLIKELY(!castedThis)) |
| return throwVMTypeError(state, throwScope); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info()); |
| return JSValue::encode(castedThis->setInterval(*state)); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionClearInterval(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode)); |
| if (UNLIKELY(!castedThis)) |
| return throwVMTypeError(state, throwScope); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info()); |
| auto& impl = castedThis->wrapped(); |
| auto handle = convert<int32_t>(*state, state->argument(0), NormalConversion); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| impl.clearInterval(WTFMove(handle)); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionAtob(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode)); |
| if (UNLIKELY(!castedThis)) |
| return throwVMTypeError(state, throwScope); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto string = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.atob(WTFMove(string), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionBtoa(ExecState* state) |
| { |
| VM& vm = state->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode)); |
| if (UNLIKELY(!castedThis)) |
| return throwVMTypeError(state, throwScope); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSWorkerGlobalScope::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, throwScope, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto string = state->uncheckedArgument(0).toWTFString(state); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| JSValue result = jsStringWithCache(state, impl.btoa(WTFMove(string), ec)); |
| |
| setDOMException(state, throwScope, ec); |
| return JSValue::encode(result); |
| } |
| |
| void JSWorkerGlobalScope::visitChildren(JSCell* cell, SlotVisitor& visitor) |
| { |
| auto* thisObject = jsCast<JSWorkerGlobalScope*>(cell); |
| ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
| Base::visitChildren(thisObject, visitor); |
| thisObject->wrapped().visitJSEventListeners(visitor); |
| thisObject->visitAdditionalChildren(visitor); |
| } |
| |
| WorkerGlobalScope* JSWorkerGlobalScope::toWrapped(JSC::JSValue value) |
| { |
| if (auto* wrapper = jsDynamicCast<JSWorkerGlobalScope*>(value)) |
| return &wrapper->wrapped(); |
| return nullptr; |
| } |
| |
| } |