Advertisement
Guest User

Untitled

a guest
Apr 6th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 13.30 KB | None | 0 0
  1. WebKitBuild/Debug/DerivedSources/WebCore/JSWorkerGlobalScope.cpp
  2. --- WebKitBuild/Debug/DerivedSources/WebCore/JSWorkerGlobalScope.cpp.bak    2016-04-06 09:09:20.000000000 -0700
  3. +++ WebKitBuild/Debug/DerivedSources/WebCore/JSWorkerGlobalScope.cpp    2016-04-06 09:42:00.000000000 -0700
  4. @@ -39,6 +39,7 @@
  5.  #include "JSWorkerNavigator.h"
  6.  #include "JSXMLHttpRequest.h"
  7.  #include "JSXMLHttpRequestEventTarget.h"
  8. +#include "RuntimeEnabledFeatures.h"
  9.  #include "WorkerGlobalScope.h"
  10.  #include "WorkerGlobalScopeIndexedDatabase.h"
  11.  #include "WorkerGlobalScopeNotifications.h"
  12. @@ -98,7 +99,7 @@
  13.  JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionClose(JSC::ExecState*);
  14.  JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionImportScripts(JSC::ExecState*);
  15.  #if ENABLE(FETCH_API)
  16. -JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionFetch(JSC::ExecState*);
  17. +JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionFetch(JSC::ExecState*);
  18.  #endif
  19.  JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionSetTimeout(JSC::ExecState*);
  20.  JSC::EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionClearTimeout(JSC::ExecState*);
  21. @@ -267,7 +268,7 @@
  22.  
  23.  /* Hash table */
  24.  
  25. -static const struct CompactHashIndex JSWorkerGlobalScopeTableIndex[137] = {
  26. +static const struct CompactHashIndex JSWorkerGlobalScopeTableIndex[135] = {
  27.      { -1, -1 },
  28.      { 13, 130 },
  29.      { -1, -1 },
  30. @@ -278,7 +279,7 @@
  31.      { 22, -1 },
  32.      { 3, -1 },
  33.      { 14, -1 },
  34. -    { 51, -1 },
  35. +    { 47, -1 },
  36.      { -1, -1 },
  37.      { -1, -1 },
  38.      { -1, -1 },
  39. @@ -288,7 +289,7 @@
  40.      { -1, -1 },
  41.      { -1, -1 },
  42.      { -1, -1 },
  43. -    { 50, -1 },
  44. +    { 46, -1 },
  45.      { -1, -1 },
  46.      { -1, -1 },
  47.      { -1, -1 },
  48. @@ -299,9 +300,9 @@
  49.      { -1, -1 },
  50.      { -1, -1 },
  51.      { -1, -1 },
  52. -    { 46, -1 },
  53. +    { 42, -1 },
  54. +    { -1, -1 },
  55.      { -1, -1 },
  56. -    { 29, -1 },
  57.      { -1, -1 },
  58.      { -1, -1 },
  59.      { 25, -1 },
  60. @@ -312,30 +313,30 @@
  61.      { -1, -1 },
  62.      { -1, -1 },
  63.      { -1, -1 },
  64. -    { 37, -1 },
  65. -    { 34, -1 },
  66. +    { 33, -1 },
  67. +    { 31, -1 },
  68.      { -1, -1 },
  69.      { 12, -1 },
  70.      { 1, -1 },
  71.      { -1, -1 },
  72. -    { 40, -1 },
  73. +    { 36, -1 },
  74.      { -1, -1 },
  75.      { -1, -1 },
  76.      { -1, -1 },
  77.      { -1, -1 },
  78. -    { 49, -1 },
  79. -    { 39, -1 },
  80. -    { 32, -1 },
  81. -    { 48, -1 },
  82. +    { 45, -1 },
  83. +    { 35, -1 },
  84. +    { 29, -1 },
  85. +    { 44, -1 },
  86.      { 11, -1 },
  87.      { -1, -1 },
  88. -    { 53, -1 },
  89. +    { 49, -1 },
  90.      { -1, -1 },
  91. -    { 41, -1 },
  92. +    { 37, -1 },
  93.      { -1, -1 },
  94.      { -1, -1 },
  95.      { -1, -1 },
  96. -    { 15, 133 },
  97. +    { 15, -1 },
  98.      { -1, -1 },
  99.      { 26, -1 },
  100.      { -1, -1 },
  101. @@ -344,7 +345,7 @@
  102.      { -1, -1 },
  103.      { -1, -1 },
  104.      { -1, -1 },
  105. -    { 42, -1 },
  106. +    { 38, -1 },
  107.      { -1, -1 },
  108.      { -1, -1 },
  109.      { -1, -1 },
  110. @@ -357,7 +358,7 @@
  111.      { -1, -1 },
  112.      { -1, -1 },
  113.      { -1, -1 },
  114. -    { 36, 136 },
  115. +    { 32, 134 },
  116.      { -1, -1 },
  117.      { -1, -1 },
  118.      { -1, -1 },
  119. @@ -366,11 +367,11 @@
  120.      { -1, -1 },
  121.      { -1, -1 },
  122.      { -1, -1 },
  123. -    { 35, -1 },
  124.      { -1, -1 },
  125.      { -1, -1 },
  126.      { -1, -1 },
  127. -    { 45, -1 },
  128. +    { -1, -1 },
  129. +    { 41, -1 },
  130.      { -1, -1 },
  131.      { -1, -1 },
  132.      { 6, 128 },
  133. @@ -380,31 +381,29 @@
  134.      { 23, -1 },
  135.      { 2, -1 },
  136.      { -1, -1 },
  137. -    { 10, 132 },
  138. +    { 10, -1 },
  139.      { -1, -1 },
  140. -    { 16, 135 },
  141. +    { 16, 133 },
  142.      { -1, -1 },
  143.      { -1, -1 },
  144. -    { 43, -1 },
  145. +    { 39, -1 },
  146.      { 4, -1 },
  147.      { -1, -1 },
  148.      { -1, -1 },
  149.      { -1, -1 },
  150. -    { 52, -1 },
  151. -    { 33, -1 },
  152. +    { 48, -1 },
  153. +    { 30, -1 },
  154.      { 9, 129 },
  155.      { 27, -1 },
  156.      { -1, -1 },
  157.      { -1, -1 },
  158. -    { 7, 134 },
  159. +    { 7, 132 },
  160.      { 18, -1 },
  161.      { 19, -1 },
  162.      { 28, -1 },
  163. -    { 30, -1 },
  164. -    { 31, -1 },
  165. -    { 38, -1 },
  166. -    { 44, -1 },
  167. -    { 47, -1 },
  168. +    { 34, -1 },
  169. +    { 40, -1 },
  170. +    { 43, -1 },
  171.  };
  172.  
  173.  
  174. @@ -527,21 +526,6 @@
  175.  #else
  176.      { 0, 0, NoIntrinsic, { 0, 0 } },
  177.  #endif
  178. -#if ENABLE(FETCH_API)
  179. -    { "Headers", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeHeadersConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeHeadersConstructor) } },
  180. -#else
  181. -    { 0, 0, NoIntrinsic, { 0, 0 } },
  182. -#endif
  183. -#if ENABLE(FETCH_API)
  184. -    { "Request", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeRequestConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeRequestConstructor) } },
  185. -#else
  186. -    { 0, 0, NoIntrinsic, { 0, 0 } },
  187. -#endif
  188. -#if ENABLE(FETCH_API)
  189. -    { "Response", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeResponseConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeResponseConstructor) } },
  190. -#else
  191. -    { 0, 0, NoIntrinsic, { 0, 0 } },
  192. -#endif
  193.  #if ENABLE(STREAMS_API)
  194.      { "ByteLengthQueuingStrategy", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeByteLengthQueuingStrategyConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeByteLengthQueuingStrategyConstructor) } },
  195.  #else
  196. @@ -557,11 +541,6 @@
  197.  #else
  198.      { 0, 0, NoIntrinsic, { 0, 0 } },
  199.  #endif
  200. -#if ENABLE(WEB_SOCKETS)
  201. -    { "WebSocket", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeWebSocketConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeWebSocketConstructor) } },
  202. -#else
  203. -    { 0, 0, NoIntrinsic, { 0, 0 } },
  204. -#endif
  205.  #if ENABLE(CHANNEL_MESSAGING)
  206.      { "MessageChannel", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeMessageChannelConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeMessageChannelConstructor) } },
  207.  #else
  208. @@ -586,7 +565,7 @@
  209.      { "clearInterval", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopeInstanceFunctionClearInterval), (intptr_t) (0) } },
  210.  };
  211.  
  212. -static const HashTable JSWorkerGlobalScopeTable = { 54, 127, true, JSWorkerGlobalScopeTableValues, JSWorkerGlobalScopeTableIndex };
  213. +static const HashTable JSWorkerGlobalScopeTable = { 50, 127, true, JSWorkerGlobalScopeTableValues, JSWorkerGlobalScopeTableIndex };
  214.  template<> JSValue JSWorkerGlobalScopeConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
  215.  {
  216.      return JSEventTarget::getConstructor(vm, &globalObject);
  217. @@ -603,29 +582,18 @@
  218.  
  219.  /* Hash table for prototype */
  220.  
  221. -static const struct CompactHashIndex JSWorkerGlobalScopePrototypeTableIndex[8] = {
  222. +static const struct CompactHashIndex JSWorkerGlobalScopePrototypeTableIndex[2] = {
  223.      { -1, -1 },
  224.      { 0, -1 },
  225. -    { 1, -1 },
  226. -    { -1, -1 },
  227. -    { -1, -1 },
  228. -    { -1, -1 },
  229. -    { -1, -1 },
  230. -    { -1, -1 },
  231.  };
  232.  
  233.  
  234.  static const HashTableValue JSWorkerGlobalScopePrototypeTableValues[] =
  235.  {
  236.      { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerGlobalScopeConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWorkerGlobalScopeConstructor) } },
  237. -#if ENABLE(FETCH_API)
  238. -    { "fetch", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsWorkerGlobalScopePrototypeFunctionFetch), (intptr_t) (1) } },
  239. -#else
  240. -    { 0, 0, NoIntrinsic, { 0, 0 } },
  241. -#endif
  242.  };
  243.  
  244. -static const HashTable JSWorkerGlobalScopePrototypeTable = { 2, 7, true, JSWorkerGlobalScopePrototypeTableValues, JSWorkerGlobalScopePrototypeTableIndex };
  245. +static const HashTable JSWorkerGlobalScopePrototypeTable = { 1, 1, true, JSWorkerGlobalScopePrototypeTableValues, JSWorkerGlobalScopePrototypeTableIndex };
  246.  const ClassInfo JSWorkerGlobalScopePrototype::s_info = { "WorkerGlobalScopePrototype", &Base::s_info, &JSWorkerGlobalScopePrototypeTable, CREATE_METHOD_TABLE(JSWorkerGlobalScopePrototype) };
  247.  
  248.  bool JSWorkerGlobalScopePrototype::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
  249. @@ -643,6 +611,40 @@
  250.  {
  251.  }
  252.  
  253. +void JSWorkerGlobalScope::finishCreation(VM& vm)
  254. +{
  255. +    Base::finishCreation(vm);
  256. +
  257. +#if ENABLE(FETCH_API)
  258. +    if (RuntimeEnabledFeatures::sharedFeatures().fetchAPIEnabled()) {
  259. +        auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeHeadersConstructor, setJSWorkerGlobalScopeHeadersConstructor);
  260. +        putDirectCustomAccessor(vm, vm.propertyNames->Headers, customGetterSetter, attributesForStructure(DontEnum));
  261. +    }
  262. +#endif
  263. +#if ENABLE(FETCH_API)
  264. +    if (RuntimeEnabledFeatures::sharedFeatures().fetchAPIEnabled()) {
  265. +        auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeRequestConstructor, setJSWorkerGlobalScopeRequestConstructor);
  266. +        putDirectCustomAccessor(vm, vm.propertyNames->Request, customGetterSetter, attributesForStructure(DontEnum));
  267. +    }
  268. +#endif
  269. +#if ENABLE(FETCH_API)
  270. +    if (RuntimeEnabledFeatures::sharedFeatures().fetchAPIEnabled()) {
  271. +        auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeResponseConstructor, setJSWorkerGlobalScopeResponseConstructor);
  272. +        putDirectCustomAccessor(vm, vm.propertyNames->Response, customGetterSetter, attributesForStructure(DontEnum));
  273. +    }
  274. +#endif
  275. +#if ENABLE(WEB_SOCKETS)
  276. +    if (RuntimeEnabledFeatures::sharedFeatures().webSocketEnabled()) {
  277. +        auto* customGetterSetter = CustomGetterSetter::create(vm, jsWorkerGlobalScopeWebSocketConstructor, setJSWorkerGlobalScopeWebSocketConstructor);
  278. +        putDirectCustomAccessor(vm, vm.propertyNames->WebSocket, customGetterSetter, attributesForStructure(DontEnum));
  279. +    }
  280. +#endif
  281. +#if ENABLE(FETCH_API)
  282. +    if (RuntimeEnabledFeatures::sharedFeatures().fetchAPIEnabled())
  283. +        putDirectNativeFunction(vm, this, vm.propertyNames->fetch, 1, jsWorkerGlobalScopeInstanceFunctionFetch, NoIntrinsic, attributesForStructure(JSC::Function));
  284. +#endif
  285. +}
  286. +
  287.  bool JSWorkerGlobalScope::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
  288.  {
  289.      auto* thisObject = jsCast<JSWorkerGlobalScope*>(object);
  290. @@ -2048,13 +2050,13 @@
  291.  }
  292.  
  293.  #if ENABLE(FETCH_API)
  294. -static EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch1Promise(ExecState*, JSPromiseDeferred*);
  295. -static inline EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch1(ExecState* state)
  296. +static EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch1Promise(ExecState*, JSPromiseDeferred*);
  297. +static inline EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch1(ExecState* state)
  298.  {
  299. -    return JSValue::encode(callPromiseFunction(*state, jsWorkerGlobalScopePrototypeFunctionFetch1Promise));
  300. +    return JSValue::encode(callPromiseFunction(*state, jsWorkerGlobalScopeInstanceFunctionFetch1Promise));
  301.  }
  302.  
  303. -static inline EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch1Promise(ExecState* state, JSPromiseDeferred* promiseDeferred)
  304. +static inline EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch1Promise(ExecState* state, JSPromiseDeferred* promiseDeferred)
  305.  {
  306.      JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode));
  307.      if (UNLIKELY(!castedThis))
  308. @@ -2076,13 +2078,13 @@
  309.  #endif
  310.  
  311.  #if ENABLE(FETCH_API)
  312. -static EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch2Promise(ExecState*, JSPromiseDeferred*);
  313. -static inline EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch2(ExecState* state)
  314. +static EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch2Promise(ExecState*, JSPromiseDeferred*);
  315. +static inline EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch2(ExecState* state)
  316.  {
  317. -    return JSValue::encode(callPromiseFunction(*state, jsWorkerGlobalScopePrototypeFunctionFetch2Promise));
  318. +    return JSValue::encode(callPromiseFunction(*state, jsWorkerGlobalScopeInstanceFunctionFetch2Promise));
  319.  }
  320.  
  321. -static inline EncodedJSValue jsWorkerGlobalScopePrototypeFunctionFetch2Promise(ExecState* state, JSPromiseDeferred* promiseDeferred)
  322. +static inline EncodedJSValue jsWorkerGlobalScopeInstanceFunctionFetch2Promise(ExecState* state, JSPromiseDeferred* promiseDeferred)
  323.  {
  324.      JSWorkerGlobalScope* castedThis = toJSWorkerGlobalScope(state->thisValue().toThis(state, NotStrictMode));
  325.      if (UNLIKELY(!castedThis))
  326. @@ -2107,18 +2109,18 @@
  327.  
  328.  #endif
  329.  
  330. -EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopePrototypeFunctionFetch(ExecState* state)
  331. +EncodedJSValue JSC_HOST_CALL jsWorkerGlobalScopeInstanceFunctionFetch(ExecState* state)
  332.  {
  333.      size_t argsCount = std::min<size_t>(2, state->argumentCount());
  334.  #if ENABLE(FETCH_API)
  335.      if (argsCount == 1 || argsCount == 2)
  336. -        return jsWorkerGlobalScopePrototypeFunctionFetch1(state);
  337. +        return jsWorkerGlobalScopeInstanceFunctionFetch1(state);
  338.  #endif
  339.  
  340.      JSValue arg0(state->argument(0));
  341.  #if ENABLE(FETCH_API)
  342.      if ((argsCount == 1 && ((arg0.isObject() && asObject(arg0)->inherits(JSFetchRequest::info())))) || (argsCount == 2 && ((arg0.isObject() && asObject(arg0)->inherits(JSFetchRequest::info())))))
  343. -        return jsWorkerGlobalScopePrototypeFunctionFetch2(state);
  344. +        return jsWorkerGlobalScopeInstanceFunctionFetch2(state);
  345.  #endif
  346.  
  347.      if (argsCount < 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement