Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WebKitBuild/Debug/DerivedSources/WebCore/JSWorkerGlobalScope.cpp
- --- WebKitBuild/Debug/DerivedSources/WebCore/JSWorkerGlobalScope.cpp.bak 2016-04-06 09:09:20.000000000 -0700
- +++ WebKitBuild/Debug/DerivedSources/WebCore/JSWorkerGlobalScope.cpp 2016-04-06 09:42:00.000000000 -0700
- @@ -39,6 +39,7 @@
- #include "JSWorkerNavigator.h"
- #include "JSXMLHttpRequest.h"
- #include "JSXMLHttpRequestEventTarget.h"
- +#include "RuntimeEnabledFeatures.h"
- #include "WorkerGlobalScope.h"
- #include "WorkerGlobalScopeIndexedDatabase.h"
- #include "WorkerGlobalScopeNotifications.h"
- @@ -98,7 +99,7 @@
- JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionClose(JSC::ExecState*);
- JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionImportScripts(JSC::ExecState*);
- #if ENABLE(FETCH_API)
- -JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionFetch(JSC::ExecState*);
- +JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionFetch(JSC::ExecState*);
- #endif
- JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionSetTimeout(JSC::ExecState*);
- JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionClearTimeout(JSC::ExecState*);
- @@ -267,7 +268,7 @@
- /* Hash table */
- -static const struct CompactHashIndex JSWorkerGlobalScopeTableIndex[137] = {
- +static const struct CompactHashIndex JSWorkerGlobalScopeTableIndex[135] = {
- { -1, -1 },
- { 13, 130 },
- { -1, -1 },
- @@ -278,7 +279,7 @@
- { 22, -1 },
- { 3, -1 },
- { 14, -1 },
- - { 51, -1 },
- + { 47, -1 },
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- @@ -288,7 +289,7 @@
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- - { 50, -1 },
- + { 46, -1 },
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- @@ -299,9 +300,9 @@
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- - { 46, -1 },
- + { 42, -1 },
- + { -1, -1 },
- { -1, -1 },
- - { 29, -1 },
- { -1, -1 },
- { -1, -1 },
- { 25, -1 },
- @@ -312,30 +313,30 @@
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- - { 37, -1 },
- - { 34, -1 },
- + { 33, -1 },
- + { 31, -1 },
- { -1, -1 },
- { 12, -1 },
- { 1, -1 },
- { -1, -1 },
- - { 40, -1 },
- + { 36, -1 },
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- - { 49, -1 },
- - { 39, -1 },
- - { 32, -1 },
- - { 48, -1 },
- + { 45, -1 },
- + { 35, -1 },
- + { 29, -1 },
- + { 44, -1 },
- { 11, -1 },
- { -1, -1 },
- - { 53, -1 },
- + { 49, -1 },
- { -1, -1 },
- - { 41, -1 },
- + { 37, -1 },
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- - { 15, 133 },
- + { 15, -1 },
- { -1, -1 },
- { 26, -1 },
- { -1, -1 },
- @@ -344,7 +345,7 @@
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- - { 42, -1 },
- + { 38, -1 },
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- @@ -357,7 +358,7 @@
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- - { 36, 136 },
- + { 32, 134 },
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- @@ -366,11 +367,11 @@
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- - { 35, -1 },
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- - { 45, -1 },
- + { -1, -1 },
- + { 41, -1 },
- { -1, -1 },
- { -1, -1 },
- { 6, 128 },
- @@ -380,31 +381,29 @@
- { 23, -1 },
- { 2, -1 },
- { -1, -1 },
- - { 10, 132 },
- + { 10, -1 },
- { -1, -1 },
- - { 16, 135 },
- + { 16, 133 },
- { -1, -1 },
- { -1, -1 },
- - { 43, -1 },
- + { 39, -1 },
- { 4, -1 },
- { -1, -1 },
- { -1, -1 },
- { -1, -1 },
- - { 52, -1 },
- - { 33, -1 },
- + { 48, -1 },
- + { 30, -1 },
- { 9, 129 },
- { 27, -1 },
- { -1, -1 },
- { -1, -1 },
- - { 7, 134 },
- + { 7, 132 },
- { 18, -1 },
- { 19, -1 },
- { 28, -1 },
- - { 30, -1 },
- - { 31, -1 },
- - { 38, -1 },
- - { 44, -1 },
- - { 47, -1 },
- + { 34, -1 },
- + { 40, -1 },
- + { 43, -1 },
- };
- @@ -527,21 +526,6 @@
- #else
- { 0, 0, NoIntrinsic, { 0, 0 } },
- #endif
- -#if ENABLE(FETCH_API)
- - { "Headers", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeHeadersConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeHeadersConstructor) } },
- -#else
- - { 0, 0, NoIntrinsic, { 0, 0 } },
- -#endif
- -#if ENABLE(FETCH_API)
- - { "Request", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeRequestConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeRequestConstructor) } },
- -#else
- - { 0, 0, NoIntrinsic, { 0, 0 } },
- -#endif
- -#if ENABLE(FETCH_API)
- - { "Response", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeResponseConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeResponseConstructor) } },
- -#else
- - { 0, 0, NoIntrinsic, { 0, 0 } },
- -#endif
- #if ENABLE(STREAMS_API)
- { "ByteLengthQueuingStrategy", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeByteLengthQueuingStrategyConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeByteLengthQueuingStrategyConstructor) } },
- #else
- @@ -557,11 +541,6 @@
- #else
- { 0, 0, NoIntrinsic, { 0, 0 } },
- #endif
- -#if ENABLE(WEB_SOCKETS)
- - { "WebSocket", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebSocketConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebSocketConstructor) } },
- -#else
- - { 0, 0, NoIntrinsic, { 0, 0 } },
- -#endif
- #if ENABLE(CHANNEL_MESSAGING)
- { "MessageChannel", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeMessageChannelConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeMessageChannelConstructor) } },
- #else
- @@ -586,7 +565,7 @@
- { "clearInterval", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopeInstanceFunctionClearInterval), (intptr_t) (0) } },
- };
- -static const HashTable JSWorkerGlobalScopeTable = { 54, 127, true, JSWorkerGlobalScopeTableValues, JSWorkerGlobalScopeTableIndex };
- +static const HashTable JSWorkerGlobalScopeTable = { 50, 127, true, JSWorkerGlobalScopeTableValues, JSWorkerGlobalScopeTableIndex };
- template<> JSValue JSWorkerGlobalScopeConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
- {
- return JSEventTarget::getConstructor(vm, &globalObject);
- @@ -603,29 +582,18 @@
- /* Hash table for prototype */
- -static const struct CompactHashIndex JSWorkerGlobalScopePrototypeTableIndex[8] = {
- +static const struct CompactHashIndex JSWorkerGlobalScopePrototypeTableIndex[2] = {
- { -1, -1 },
- { 0, -1 },
- - { 1, -1 },
- - { -1, -1 },
- - { -1, -1 },
- - { -1, -1 },
- - { -1, -1 },
- - { -1, -1 },
- };
- static const HashTableValue JSWorkerGlobalScopePrototypeTableValues[] =
- {
- { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeConstructor) } },
- -#if ENABLE(FETCH_API)
- - { "fetch", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionFetch), (intptr_t) (1) } },
- -#else
- - { 0, 0, NoIntrinsic, { 0, 0 } },
- -#endif
- };
- -static const HashTable JSWorkerGlobalScopePrototypeTable = { 2, 7, true, JSWorkerGlobalScopePrototypeTableValues, JSWorkerGlobalScopePrototypeTableIndex };
- +static const HashTable JSWorkerGlobalScopePrototypeTable = { 1, 1, true, JSWorkerGlobalScopePrototypeTableValues, JSWorkerGlobalScopePrototypeTableIndex };
- const ClassInfo JSWorkerGlobalScopePrototype::s_info = { "WorkerGlobalScopePrototype", &Base::s_info, &JSWorkerGlobalScopePrototypeTable, CREATE_METHOD_TABLE(JSWorkerGlobalScopePrototype) };
- bool JSWorkerGlobalScopePrototype::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
- @@ -643,6 +611,40 @@
- {
- }
- +void JSWorkerGlobalScope::finishCreation(VM& vm)
- +{
- + Base::finishCreation(vm);
- +
- +#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)
- + if (RuntimeEnabledFeatures::sharedFeatures().fetchAPIEnabled())
- + putDirectNativeFunction(vm, this, vm.propertyNames->fetch, 1, jsWorkerGlobalScopeInstanceFunctionFetch, NoIntrinsic, attributesForStructure(JSC::Function));
- +#endif
- +}
- +
- bool JSWorkerGlobalScope::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
- {
- auto* thisObject = jsCast<JSWorkerGlobalScope*>(object);
- @@ -2048,13 +2050,13 @@
- }
- #if ENABLE(FETCH_API)
- -static EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch1Promise(ExecState*, JSPromiseDeferred*);
- -static inline EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch1(ExecState* state)
- +static EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch1Promise(ExecState*, JSPromiseDeferred*);
- +static inline EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch1(ExecState* state)
- {
- - return JSValue::encode(callPromiseFunction(*state, jsWorkerGlobalScopePrototypeFunctionFetch1Promise));
- + return JSValue::encode(callPromiseFunction(*state, jsWorkerGlobalScopeInstanceFunctionFetch1Promise));
- }
- -static inline EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch1Promise(ExecState* state, JSPromiseDeferred* promiseDeferred)
- +static inline EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch1Promise(ExecState* state, JSPromiseDeferred* promiseDeferred)
- {
- JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode));
- if (UNLIKELY(!castedThis))
- @@ -2076,13 +2078,13 @@
- #endif
- #if ENABLE(FETCH_API)
- -static EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch2Promise(ExecState*, JSPromiseDeferred*);
- -static inline EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch2(ExecState* state)
- +static EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch2Promise(ExecState*, JSPromiseDeferred*);
- +static inline EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch2(ExecState* state)
- {
- - return JSValue::encode(callPromiseFunction(*state, jsWorkerGlobalScopePrototypeFunctionFetch2Promise));
- + return JSValue::encode(callPromiseFunction(*state, jsWorkerGlobalScopeInstanceFunctionFetch2Promise));
- }
- -static inline EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch2Promise(ExecState* state, JSPromiseDeferred* promiseDeferred)
- +static inline EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch2Promise(ExecState* state, JSPromiseDeferred* promiseDeferred)
- {
- JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode));
- if (UNLIKELY(!castedThis))
- @@ -2107,18 +2109,18 @@
- #endif
- -EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionFetch(ExecState* state)
- +EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionFetch(ExecState* state)
- {
- size_t argsCount = std::min<size_t>(2, state->argumentCount());
- #if ENABLE(FETCH_API)
- if (argsCount == 1 || argsCount == 2)
- - return jsWorkerGlobalScopePrototypeFunctionFetch1(state);
- + return jsWorkerGlobalScopeInstanceFunctionFetch1(state);
- #endif
- JSValue arg0(state->argument(0));
- #if ENABLE(FETCH_API)
- if ((argsCount == 1 && ((arg0.isObject() && asObject(arg0)->inherits(JSFetchRequest::info())))) || (argsCount == 2 && ((arg0.isObject() && asObject(arg0)->inherits(JSFetchRequest::info())))))
- - return jsWorkerGlobalScopePrototypeFunctionFetch2(state);
- + return jsWorkerGlobalScopeInstanceFunctionFetch2(state);
- #endif
- if (argsCount < 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement