WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Implementation inside JSC
bug-146594-20150720152818.patch (text/plain), 50.74 KB, created by
Xabier RodrÃguez Calvar
on 2015-07-20 06:29:32 PDT
(
hide
)
Description:
Implementation inside JSC
Filename:
MIME Type:
Creator:
Xabier RodrÃguez Calvar
Created:
2015-07-20 06:29:32 PDT
Size:
50.74 KB
patch
obsolete
>Subversion Revision: 187012 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 13340353515b2fc67d3039e9e6310dc1824f9cc9..60e0733f0e12a5253b2333fccbe3fbd146ce4360 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,57 @@ >+2015-07-20 Xabier Rodriguez Calvar <calvaris@igalia.com> >+ >+ [Streams API] Create CountQueuingStrategy object as per spec >+ https://bugs.webkit.org/show_bug.cgi?id=146594 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implemented the CountQueuingStrategy from Streams API directly in JSC. Class, constructor and prototype were >+ created and added to the GlobalObject. The class reads the highWaterMark and the prototype contains the method >+ to return 1 as per spec. >+ >+ Current tests suffice after removing the refererence implementation in JS. >+ >+ * CMakeLists.txt: >+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: >+ * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: >+ * JavaScriptCore.xcodeproj/project.pbxproj: Added StreamsCountQueuingStrategy*.cpp files to the compilation. >+ * runtime/CommonIdentifiers.h: Added CountQueuingStrategy as private and public properties and highWaterMark >+ only as public. >+ * runtime/JSGlobalObject.cpp: >+ (JSC::JSGlobalObject::init): Created and set the prototype, constructor and structure. Added the constructor to >+ the prototype and the GlobalObject and set the properties to the constructor. >+ (JSC::JSGlobalObject::visitChildren): Added prototype, constructor and structure to be visited. >+ * runtime/JSGlobalObject.h: >+ (JSC::JSGlobalObject::streamsCountQueuingStrategyConstructor): >+ (JSC::JSGlobalObject::streamsCountQueingStrategyPrototype): >+ (JSC::JSGlobalObject::streamsCountQueuingStrategyStructure): Added constructor, prototype and structure as >+ private attributes and public methods to access them. >+ * runtime/StreamsCountQueuingStrategy.cpp: Added. >+ (JSC::StreamsCountQueuingStrategy::create): Static method to create the strategy. >+ (JSC::StreamsCountQueuingStrategy::createStructure): Static method to create the structure. >+ (JSC::StreamsCountQueuingStrategy::StreamsCountQueuingStrategy): Empty constructor. >+ (JSC::StreamsCountQueuingStrategy::finishCreation): Takes the argument, reads the highWaterMark and sets it to >+ ifself. >+ * runtime/StreamsCountQueuingStrategy.h: Added. >+ * runtime/StreamsCountQueuingStrategyConstructor.cpp: Added. >+ (JSC::StreamsCountQueuingStrategyConstructor::create): Static method to create the constructor. >+ (JSC::StreamsCountQueuingStrategyConstructor::createStructure): Static method to create the constructor >+ structure. >+ (JSC::StreamsCountQueuingStrategyConstructor::StreamsCountQueuingStrategyConstructor): Empty constructor. >+ (JSC::StreamsCountQueuingStrategyConstructor::finishCreation): Sets the prototype and the length. >+ (JSC::constructCountQueuingStrategy): JS function to create a count queuing strategy and return it. >+ (JSC::StreamsCountQueuingStrategyConstructor::getConstructData): >+ (JSC::StreamsCountQueuingStrategyConstructor::getCallData): Create construct and call data. >+ (JSC::constructCountQueuingStrategy): Invokes the JS function. >+ * runtime/StreamsCountQueuingStrategyConstructor.h: Added. >+ * runtime/StreamsCountQueuingStrategyPrototype.cpp: Added. >+ (JSC::StreamsCountQueuingStrategyPrototype::create): Static method to create the prototype. >+ (JSC::StreamsCountQueuingStrategyPrototype::createStructure): Static method to create the prototype structure. >+ (JSC::StreamsCountQueuingStrategyPrototype::StreamsCountQueuingStrategyPrototype): Empty prototype constructor. >+ (JSC::streamsCountQueuingStrategyProtoFuncSize): JS function that just returns 1 as per spec. >+ (JSC::StreamsCountQueuingStrategyPrototype::finishCreation): Adds the size function to the prototype. >+ * runtime/StreamsCountQueuingStrategyPrototype.h: Added. >+ > 2015-07-18 Saam barati <saambarati1@gmail.com> > > [ES6] Add support for block scope const >diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt >index 94326d9a10248b1407bbd792507b9f81d01183ac..6ec0a99b6c71519cfae24764b5a152a8fef3c57b 100644 >--- a/Source/JavaScriptCore/CMakeLists.txt >+++ b/Source/JavaScriptCore/CMakeLists.txt >@@ -572,6 +572,9 @@ set(JavaScriptCore_RUNTIME_SOURCES > runtime/SimpleTypedArrayController.cpp > runtime/SmallStrings.cpp > runtime/SparseArrayValueMap.cpp >+ runtime/StreamsCountQueuingStrategy.cpp >+ runtime/StreamsCountQueuingStrategyConstructor.cpp >+ runtime/StreamsCountQueuingStrategyPrototype.cpp > runtime/StrictEvalActivation.cpp > runtime/StringConstructor.cpp > runtime/StringIteratorPrototype.cpp >diff --git a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj >index 74efa9d345d0cd07c6d3840f92da0982e0f46457..3aadb5f0f623fdc586dfd9ad3feb4ecfe16bb2bb 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj >+++ b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj >@@ -828,6 +828,9 @@ > <ClCompile Include="..\runtime\SimpleTypedArrayController.cpp" /> > <ClCompile Include="..\runtime\SmallStrings.cpp" /> > <ClCompile Include="..\runtime\SparseArrayValueMap.cpp" /> >+ <ClCompile Include="..\runtime\StreamsCountQueuingStrategy.cpp" /> >+ <ClCompile Include="..\runtime\StreamsCountQueuingStrategyConstructor.cpp" /> >+ <ClCompile Include="..\runtime\StreamsCountQueuingStrategyPrototype.cpp" /> > <ClCompile Include="..\runtime\StrictEvalActivation.cpp" /> > <ClCompile Include="..\runtime\StringConstructor.cpp" /> > <ClCompile Include="..\runtime\StringObject.cpp" /> >@@ -1673,6 +1676,9 @@ > <ClInclude Include="..\runtime\SmallStrings.h" /> > <ClInclude Include="..\runtime\SparseArrayValueMap.h" /> > <ClInclude Include="..\runtime\StackAlignment.h" /> >+ <ClInclude Include="..\runtime\StreamsCountQueuingStrategy.h" /> >+ <ClInclude Include="..\runtime\StreamsCountQueuingStrategyConstructor.h" /> >+ <ClInclude Include="..\runtime\StreamsCountQueuingStrategyPrototype.h" /> > <ClInclude Include="..\runtime\StrictEvalActivation.h" /> > <ClInclude Include="..\runtime\StringConstructor.h" /> > <ClInclude Include="..\runtime\StringIteratorPrototype.h" /> >diff --git a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters >index aaf3256296143f71bce56db9ea3c523a2ca1a438..12d1605fbb24e1b6e7c9d5d9069cf57902f40676 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters >+++ b/Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters >@@ -837,6 +837,15 @@ > <ClCompile Include="..\runtime\SparseArrayValueMap.cpp"> > <Filter>runtime</Filter> > </ClCompile> >+ <ClCompile Include="..\runtime\StreamsCountQueuingStrategy.cpp"> >+ <Filter>runtime</Filter> >+ </ClCompile> >+ <ClCompile Include="..\runtime\StreamsCountQueuingStrategyConstructor.cpp"> >+ <Filter>runtime</Filter> >+ </ClCompile> >+ <ClCompile Include="..\runtime\StreamsCountQueuingStrategyPrototype.cpp"> >+ <Filter>runtime</Filter> >+ </ClCompile> > <ClCompile Include="..\runtime\StrictEvalActivation.cpp"> > <Filter>runtime</Filter> > </ClCompile> >@@ -2916,6 +2925,15 @@ > <ClInclude Include="..\runtime\SparseArrayValueMap.h"> > <Filter>runtime</Filter> > </ClInclude> >+ <ClInclude Include="..\runtime\StreamsCountQueuingStrategy.h"> >+ <Filter>runtime</Filter> >+ </ClInclude> >+ <ClInclude Include="..\runtime\StreamsCountQueuingStrategyConstructor.h"> >+ <Filter>runtime</Filter> >+ </ClInclude> >+ <ClInclude Include="..\runtime\StreamsCountQueuingStrategyPrototype.h"> >+ <Filter>runtime</Filter> >+ </ClInclude> > <ClInclude Include="..\runtime\StrictEvalActivation.h"> > <Filter>runtime</Filter> > </ClInclude> >diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >index 08f0d0f4c7f24a7eeee46cbb4a459de804e36b40..7385dc449e9cac5b229a3f1832bcb61748c1ddc2 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >@@ -908,6 +908,12 @@ > 14E84FA114EE1ACC00D6D5D4 /* WeakSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9C14EE1ACC00D6D5D4 /* WeakSet.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 14E84FA214EE1ACC00D6D5D4 /* WeakImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 14E84F9D14EE1ACC00D6D5D4 /* WeakImpl.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 14E9D17B107EC469004DDA21 /* JSGlobalObjectFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC756FC60E2031B200DE7D12 /* JSGlobalObjectFunctions.cpp */; }; >+ 14EEF5201B5D077300ED41E3 /* StreamsCountQueuingStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14EEF51A1B5D077300ED41E3 /* StreamsCountQueuingStrategy.cpp */; }; >+ 14EEF5211B5D077300ED41E3 /* StreamsCountQueuingStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 14EEF51B1B5D077300ED41E3 /* StreamsCountQueuingStrategy.h */; }; >+ 14EEF5221B5D077300ED41E3 /* StreamsCountQueuingStrategyConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14EEF51C1B5D077300ED41E3 /* StreamsCountQueuingStrategyConstructor.cpp */; }; >+ 14EEF5231B5D077300ED41E3 /* StreamsCountQueuingStrategyConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 14EEF51D1B5D077300ED41E3 /* StreamsCountQueuingStrategyConstructor.h */; }; >+ 14EEF5241B5D077300ED41E3 /* StreamsCountQueuingStrategyPrototype.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14EEF51E1B5D077300ED41E3 /* StreamsCountQueuingStrategyPrototype.cpp */; }; >+ 14EEF5251B5D077300ED41E3 /* StreamsCountQueuingStrategyPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = 14EEF51F1B5D077300ED41E3 /* StreamsCountQueuingStrategyPrototype.h */; }; > 14F7256514EE265E00B1652B /* WeakHandleOwner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 14F7256314EE265E00B1652B /* WeakHandleOwner.cpp */; }; > 14F7256614EE265E00B1652B /* WeakHandleOwner.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F7256414EE265E00B1652B /* WeakHandleOwner.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 14F97447138C853E00DA1C67 /* HeapRootVisitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 14F97446138C853E00DA1C67 /* HeapRootVisitor.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -2613,6 +2619,12 @@ > 14E84F9B14EE1ACC00D6D5D4 /* WeakSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakSet.cpp; sourceTree = "<group>"; }; > 14E84F9C14EE1ACC00D6D5D4 /* WeakSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakSet.h; sourceTree = "<group>"; }; > 14E84F9D14EE1ACC00D6D5D4 /* WeakImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakImpl.h; sourceTree = "<group>"; }; >+ 14EEF51A1B5D077300ED41E3 /* StreamsCountQueuingStrategy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamsCountQueuingStrategy.cpp; sourceTree = "<group>"; }; >+ 14EEF51B1B5D077300ED41E3 /* StreamsCountQueuingStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamsCountQueuingStrategy.h; sourceTree = "<group>"; }; >+ 14EEF51C1B5D077300ED41E3 /* StreamsCountQueuingStrategyConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamsCountQueuingStrategyConstructor.cpp; sourceTree = "<group>"; }; >+ 14EEF51D1B5D077300ED41E3 /* StreamsCountQueuingStrategyConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamsCountQueuingStrategyConstructor.h; sourceTree = "<group>"; }; >+ 14EEF51E1B5D077300ED41E3 /* StreamsCountQueuingStrategyPrototype.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamsCountQueuingStrategyPrototype.cpp; sourceTree = "<group>"; }; >+ 14EEF51F1B5D077300ED41E3 /* StreamsCountQueuingStrategyPrototype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StreamsCountQueuingStrategyPrototype.h; sourceTree = "<group>"; }; > 14F252560D08DD8D004ECFFF /* JSEnvironmentRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEnvironmentRecord.h; sourceTree = "<group>"; }; > 14F7256314EE265E00B1652B /* WeakHandleOwner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WeakHandleOwner.cpp; sourceTree = "<group>"; }; > 14F7256414EE265E00B1652B /* WeakHandleOwner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakHandleOwner.h; sourceTree = "<group>"; }; >@@ -4336,6 +4348,12 @@ > 7EF6E0BB0EB7A1EC0079AFAF /* runtime */ = { > isa = PBXGroup; > children = ( >+ 14EEF51A1B5D077300ED41E3 /* StreamsCountQueuingStrategy.cpp */, >+ 14EEF51B1B5D077300ED41E3 /* StreamsCountQueuingStrategy.h */, >+ 14EEF51C1B5D077300ED41E3 /* StreamsCountQueuingStrategyConstructor.cpp */, >+ 14EEF51D1B5D077300ED41E3 /* StreamsCountQueuingStrategyConstructor.h */, >+ 14EEF51E1B5D077300ED41E3 /* StreamsCountQueuingStrategyPrototype.cpp */, >+ 14EEF51F1B5D077300ED41E3 /* StreamsCountQueuingStrategyPrototype.h */, > BCF605110E203EF800B9A64D /* ArgList.cpp */, > BCF605120E203EF800B9A64D /* ArgList.h */, > 0FE0500C1AA9091100D33B33 /* ArgumentsMode.h */, >@@ -5658,6 +5676,7 @@ > FE7BA6101A1A7CEC00F1F7B4 /* HeapVerifier.h in Headers */, > A5EF9B141A1D43F600702E90 /* generate_cpp_backend_dispatcher_header.py in Headers */, > C2DA778318E259990066FCB6 /* HeapInlines.h in Headers */, >+ 14EEF5231B5D077300ED41E3 /* StreamsCountQueuingStrategyConstructor.h in Headers */, > C4F4B6F41A05C944005CAB76 /* cpp_generator.py in Headers */, > A532439418569709002ED692 /* generate-combined-inspector-json.py in Headers */, > A5840E27187C981E00843B10 /* cssmin.py in Headers */, >@@ -5788,6 +5807,7 @@ > 0F136D4D174AD69E0075B354 /* DeferGC.h in Headers */, > 0FC712DF17CD877C008CC93C /* DeferredCompilationCallback.h in Headers */, > A77A423E17A0BBFD00A8DB81 /* DFGAbstractHeap.h in Headers */, >+ 14EEF5251B5D077300ED41E3 /* StreamsCountQueuingStrategyPrototype.h in Headers */, > A5EA70E819F5B1010098F5EC /* AugmentableInspectorControllerClient.h in Headers */, > A704D90317A0BAA8006BA554 /* DFGAbstractInterpreter.h in Headers */, > A704D90417A0BAA8006BA554 /* DFGAbstractInterpreterInlines.h in Headers */, >@@ -5983,6 +6003,7 @@ > 0F25F1B0181635F300522F39 /* FTLInlineCacheSize.h in Headers */, > 0FEA0A241709606900BB722C /* FTLIntrinsicRepository.h in Headers */, > 0FEA0A0E170513DB00BB722C /* FTLJITCode.h in Headers */, >+ 14EEF5211B5D077300ED41E3 /* StreamsCountQueuingStrategy.h in Headers */, > A78A9781179738D5009DF744 /* FTLJITFinalizer.h in Headers */, > 0FED67BA1B26256D0066CE15 /* DFGConstantHoistingPhase.h in Headers */, > 0F6B1CB6185FC9E900845D97 /* FTLJSCall.h in Headers */, >@@ -7238,6 +7259,7 @@ > 147F39C8107EC37600427A48 /* ErrorConstructor.cpp in Sources */, > FEB58C14187B8B160098EF0B /* ErrorHandlingScope.cpp in Sources */, > 147F39C9107EC37600427A48 /* ErrorInstance.cpp in Sources */, >+ 14EEF5221B5D077300ED41E3 /* StreamsCountQueuingStrategyConstructor.cpp in Sources */, > 147F39CA107EC37600427A48 /* ErrorPrototype.cpp in Sources */, > A54982031891D0B00081E5B8 /* EventLoop.cpp in Sources */, > 1429D8780ED21ACD00B89619 /* ExceptionHelpers.cpp in Sources */, >@@ -7282,6 +7304,7 @@ > 0FD8A31B17D51F2200CA2C40 /* FTLOSREntry.cpp in Sources */, > 0F235BDC17178E1C00690C7F /* FTLOSRExit.cpp in Sources */, > 0F235BDF17178E1C00690C7F /* FTLOSRExitCompiler.cpp in Sources */, >+ 14EEF5241B5D077300ED41E3 /* StreamsCountQueuingStrategyPrototype.cpp in Sources */, > 0FEA0A2A1709629600BB722C /* FTLOutput.cpp in Sources */, > 0F485329187DFDEC0083B687 /* FTLRecoveryOpcode.cpp in Sources */, > 0F6B1CC31862C47800845D97 /* FTLRegisterAtOffset.cpp in Sources */, >@@ -7370,6 +7393,7 @@ > 140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */, > C2CF39C116E15A8100DD69BE /* JSAPIWrapperObject.mm in Sources */, > 147F39D0107EC37600427A48 /* JSArray.cpp in Sources */, >+ 14EEF5201B5D077300ED41E3 /* StreamsCountQueuingStrategy.cpp in Sources */, > 0F2B66E217B6B5AB00A7AE3F /* JSArrayBuffer.cpp in Sources */, > 0F2B66E417B6B5AB00A7AE3F /* JSArrayBufferConstructor.cpp in Sources */, > 0F2B66E617B6B5AB00A7AE3F /* JSArrayBufferPrototype.cpp in Sources */, >diff --git a/Source/JavaScriptCore/runtime/CommonIdentifiers.h b/Source/JavaScriptCore/runtime/CommonIdentifiers.h >index 41b94f1bf47bfc66d876450c01301e5521ff956d..e1dff316b0ab1de24a8cd7f2ede52a3ab0a3d5a8 100644 >--- a/Source/JavaScriptCore/runtime/CommonIdentifiers.h >+++ b/Source/JavaScriptCore/runtime/CommonIdentifiers.h >@@ -33,6 +33,7 @@ > macro(ArrayIterator) \ > macro(BYTES_PER_ELEMENT) \ > macro(Boolean) \ >+ macro(CountQueuingStrategy) \ > macro(Date) \ > macro(Error) \ > macro(EvalError) \ >@@ -116,6 +117,7 @@ > macro(hasOwnProperty) \ > macro(hash) \ > macro(header) \ >+ macro(highWaterMark) \ > macro(href) \ > macro(id) \ > macro(ignoreCase) \ >@@ -277,6 +279,7 @@ > macro(Array) \ > macro(String) \ > macro(Promise) \ >+ macro(CountQueuingStrategy) \ > macro(abs) \ > macro(floor) \ > macro(isFinite) \ >diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >index 419c1b27799428b6f6af59582219df9b3f15183f..7b0440e588ea498026e40eb582019ff561736166 100644 >--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp >@@ -141,6 +141,12 @@ > #include "JSPromisePrototype.h" > #endif // ENABLE(PROMISES) > >+#if ENABLE(STREAMS_API) >+#include "StreamsCountQueuingStrategy.h" >+#include "StreamsCountQueuingStrategyConstructor.h" >+#include "StreamsCountQueuingStrategyPrototype.h" >+#endif >+ > #if ENABLE(REMOTE_INSPECTOR) > #include "JSGlobalObjectDebuggable.h" > #include "JSGlobalObjectInspectorController.h" >@@ -347,6 +353,11 @@ void JSGlobalObject::init(VM& vm) > m_promiseStructure.set(vm, this, JSPromise::createStructure(vm, this, m_promisePrototype.get())); > #endif // ENABLE(PROMISES) > >+#if ENABLE(STREAMS_API) >+ m_streamsCountQueuingStrategyPrototype.set(vm, this, StreamsCountQueuingStrategyPrototype::create(exec, this, StreamsCountQueuingStrategyPrototype::createStructure(vm, this, m_objectPrototype.get()))); >+ m_streamsCountQueuingStrategyStructure.set(vm, this, StreamsCountQueuingStrategy::createStructure(vm, this, m_streamsCountQueuingStrategyPrototype.get())); >+#endif >+ > m_parseIntFunction.set(vm, this, JSFunction::create(vm, this, 2, vm.propertyNames->parseInt.string(), globalFuncParseInt, NoIntrinsic)); > putDirectWithoutTransition(vm, vm.propertyNames->parseInt, m_parseIntFunction.get(), DontEnum | Function); > >@@ -402,6 +413,9 @@ m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->c > #if ENABLE(PROMISES) > m_promiseConstructor.set(vm, this, JSPromiseConstructor::create(vm, JSPromiseConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promisePrototype.get())); > #endif >+#if ENABLE(STREAMS_API) >+ m_streamsCountQueuingStrategyConstructor.set(vm, this, StreamsCountQueuingStrategyConstructor::create(vm, StreamsCountQueuingStrategyConstructor::createStructure(vm, this, m_functionPrototype.get()), m_streamsCountQueuingStrategyPrototype.get())); >+#endif > > m_objectPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, objectConstructor, DontEnum); > m_functionPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, functionConstructor, DontEnum); >@@ -410,6 +424,9 @@ m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->c > #if ENABLE(PROMISES) > m_promisePrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, m_promiseConstructor.get(), DontEnum); > #endif >+#if ENABLE(STREAMS_API) >+ m_streamsCountQueuingStrategyPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, m_streamsCountQueuingStrategyConstructor.get(), DontEnum); >+#endif > > putDirectWithoutTransition(vm, vm.propertyNames->Object, objectConstructor, DontEnum); > putDirectWithoutTransition(vm, vm.propertyNames->Function, functionConstructor, DontEnum); >@@ -425,6 +442,9 @@ m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->c > if (!m_runtimeFlags.isPromiseDisabled()) > putDirectWithoutTransition(vm, vm.propertyNames->Promise, m_promiseConstructor.get(), DontEnum); > #endif >+#if ENABLE(STREAMS_API) >+ putDirectWithoutTransition(vm, vm.propertyNames->CountQueuingStrategy, m_streamsCountQueuingStrategyConstructor.get(), DontEnum); >+#endif > > > #define PUT_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \ >@@ -513,6 +533,9 @@ putDirectWithoutTransition(vm, vm.propertyNames-> jsName, lowerName ## Construct > GlobalPropertyInfo(vm.propertyNames->promiseFulfilledPrivateName, jsNumber(static_cast<unsigned>(JSPromise::Status::Fulfilled)), DontEnum | DontDelete | ReadOnly), > GlobalPropertyInfo(vm.propertyNames->promiseRejectedPrivateName, jsNumber(static_cast<unsigned>(JSPromise::Status::Rejected)), DontEnum | DontDelete | ReadOnly), > #endif >+#if ENABLE(STREAMS_API) >+ GlobalPropertyInfo(vm.propertyNames->CountQueuingStrategyPrivateName, m_streamsCountQueuingStrategyConstructor.get(), DontEnum | DontDelete | ReadOnly), >+#endif > GlobalPropertyInfo(vm.propertyNames->builtinNames().toLengthPrivateName(), privateFuncToLength, DontEnum | DontDelete | ReadOnly), > GlobalPropertyInfo(vm.propertyNames->builtinNames().toIntegerPrivateName(), privateFuncToInteger, DontEnum | DontDelete | ReadOnly), > GlobalPropertyInfo(vm.propertyNames->builtinNames().isObjectPrivateName(), JSFunction::createBuiltinFunction(vm, globalObjectIsObjectCodeGenerator(vm), this), DontEnum | DontDelete | ReadOnly), >@@ -770,6 +793,9 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) > #if ENABLE(PROMISES) > visitor.append(&thisObject->m_promiseConstructor); > #endif >+#if ENABLE(STREAMS_API) >+ visitor.append(&thisObject->m_streamsCountQueuingStrategyConstructor); >+#endif > > visitor.append(&thisObject->m_nullGetterFunction); > visitor.append(&thisObject->m_nullSetterFunction); >@@ -794,6 +820,9 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) > #if ENABLE(PROMISES) > visitor.append(&thisObject->m_promisePrototype); > #endif >+#if ENABLE(STREAMS_API) >+ visitor.append(&thisObject->m_streamsCountQueuingStrategyPrototype); >+#endif > > visitor.append(&thisObject->m_debuggerScopeStructure); > visitor.append(&thisObject->m_withScopeStructure); >@@ -832,6 +861,9 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor) > #if ENABLE(PROMISES) > visitor.append(&thisObject->m_promiseStructure); > #endif // ENABLE(PROMISES) >+#if ENABLE(STREAMS_API) >+ visitor.append(&thisObject->m_streamsCountQueuingStrategyStructure); >+#endif > > #define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName) \ > visitor.append(&thisObject->m_ ## lowerName ## Prototype); \ >diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.h b/Source/JavaScriptCore/runtime/JSGlobalObject.h >index 337bb746a32ae035602e77cc7d219648da8f3c0d..679f202306f3143e83a3b25d56b07f233230a9af 100644 >--- a/Source/JavaScriptCore/runtime/JSGlobalObject.h >+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.h >@@ -82,6 +82,8 @@ class ProgramExecutable; > class RegExpConstructor; > class RegExpPrototype; > class SourceCode; >+class StreamsCountQueuingStrategyConstructor; >+class StreamsCountQueuingStrategyPrototype; > class NullGetterFunction; > class NullSetterFunction; > enum class ThisTDZMode; >@@ -189,6 +191,9 @@ protected: > #if ENABLE(PROMISES) > WriteBarrier<JSPromiseConstructor> m_promiseConstructor; > #endif >+#if ENABLE(STREAMS_API) >+ WriteBarrier<StreamsCountQueuingStrategyConstructor> m_streamsCountQueuingStrategyConstructor; >+#endif > WriteBarrier<ObjectConstructor> m_objectConstructor; > > WriteBarrier<NullGetterFunction> m_nullGetterFunction; >@@ -215,6 +220,9 @@ protected: > #if ENABLE(PROMISES) > WriteBarrier<JSPromisePrototype> m_promisePrototype; > #endif >+#if ENABLE(STREAMS_API) >+ WriteBarrier<StreamsCountQueuingStrategyPrototype> m_streamsCountQueuingStrategyPrototype; >+#endif > > WriteBarrier<Structure> m_debuggerScopeStructure; > WriteBarrier<Structure> m_withScopeStructure; >@@ -257,6 +265,9 @@ protected: > #if ENABLE(PROMISES) > WriteBarrier<Structure> m_promiseStructure; > #endif // ENABLE(PROMISES) >+#if ENABLE(STREAMS_API) >+ WriteBarrier<Structure> m_streamsCountQueuingStrategyStructure; >+#endif > > #define DEFINE_STORAGE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \ > WriteBarrier<capitalName ## Prototype> m_ ## lowerName ## Prototype; \ >@@ -401,6 +412,9 @@ public: > #if ENABLE(PROMISES) > JSPromiseConstructor* promiseConstructor() const { return m_promiseConstructor.get(); } > #endif >+#if ENABLE(STREAMS_API) >+ StreamsCountQueuingStrategyConstructor* streamsCountQueuingStrategyConstructor() const { return m_streamsCountQueuingStrategyConstructor.get(); } >+#endif > > NullGetterFunction* nullGetterFunction() const { return m_nullGetterFunction.get(); } > NullSetterFunction* nullSetterFunction() const { return m_nullSetterFunction.get(); } >@@ -437,6 +451,9 @@ public: > #if ENABLE(PROMISES) > JSPromisePrototype* promisePrototype() const { return m_promisePrototype.get(); } > #endif >+#if ENABLE(STREAMS_API) >+ StreamsCountQueuingStrategyPrototype* streamsCountQueingStrategyPrototype() const { return m_streamsCountQueuingStrategyPrototype.get(); } >+#endif > > Structure* debuggerScopeStructure() const { return m_debuggerScopeStructure.get(); } > Structure* withScopeStructure() const { return m_withScopeStructure.get(); } >@@ -498,6 +515,9 @@ public: > #if ENABLE(PROMISES) > Structure* promiseStructure() const { return m_promiseStructure.get(); } > #endif // ENABLE(PROMISES) >+#if ENABLE(STREAMS_API) >+ Structure* streamsCountQueuingStrategyStructure() const { return m_streamsCountQueuingStrategyStructure.get(); } >+#endif > > JS_EXPORT_PRIVATE void setRemoteDebuggingEnabled(bool); > JS_EXPORT_PRIVATE bool remoteDebuggingEnabled() const; >diff --git a/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategy.cpp b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategy.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..c7fb5c7a59d68d4d13dd0b4163ad3d2243ad221b >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategy.cpp >@@ -0,0 +1,77 @@ >+/* >+ * Copyright (C) 2015 Canon Inc. >+ * Copyright (C) 2015 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted, provided that the following conditions >+ * are required to be met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Canon Inc. nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR >+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "StreamsCountQueuingStrategy.h" >+ >+#if ENABLE(STREAMS_API) >+ >+#include "Error.h" >+#include "JSCJSValueInlines.h" >+#include "JSCellInlines.h" >+#include "Microtask.h" >+#include "SlotVisitorInlines.h" >+#include "StreamsCountQueuingStrategyConstructor.h" >+#include "StructureInlines.h" >+ >+namespace JSC { >+ >+const ClassInfo StreamsCountQueuingStrategy::s_info = { "CountQueuingStrategy", &Base::s_info, 0, CREATE_METHOD_TABLE(StreamsCountQueuingStrategy) }; >+ >+StreamsCountQueuingStrategy* StreamsCountQueuingStrategy::create(VM& vm, JSGlobalObject* globalObject) >+{ >+ StreamsCountQueuingStrategy* countQueuingStrategy = new (NotNull, allocateCell<StreamsCountQueuingStrategy>(vm.heap)) StreamsCountQueuingStrategy(vm, globalObject->streamsCountQueuingStrategyStructure()); >+ countQueuingStrategy->finishCreation(vm); >+ return countQueuingStrategy; >+} >+ >+Structure* StreamsCountQueuingStrategy::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >+{ >+ return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); >+} >+ >+StreamsCountQueuingStrategy::StreamsCountQueuingStrategy(VM& vm, Structure* structure) >+ : JSNonFinalObject(vm, structure) >+{ >+} >+ >+void StreamsCountQueuingStrategy::finishCreation(VM& vm) >+{ >+ Base::finishCreation(vm); >+ JSValue argument = vm.topCallFrame->argument(0); >+ if (argument.isObject()) { >+ JSValue highWaterMark = argument.getObject()->getDirect(vm, vm.propertyNames->highWaterMark); >+ if (highWaterMark) >+ putDirect(vm, vm.propertyNames->highWaterMark, highWaterMark); >+ } >+} >+ >+} // namespace JSC >+ >+#endif // ENABLE(STREAMS_API) >diff --git a/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategy.h b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategy.h >new file mode 100644 >index 0000000000000000000000000000000000000000..5662614103f782e2c508d20be6038798fc122156 >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategy.h >@@ -0,0 +1,57 @@ >+/* >+ * Copyright (C) 2015 Canon Inc. >+ * Copyright (C) 2015 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted, provided that the following conditions >+ * are required to be met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Canon Inc. nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR >+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef StreamsCountQueuingStrategy_h >+#define StreamsCountQueuingStrategy_h >+ >+#if ENABLE(STREAMS_API) >+ >+#include "JSObject.h" >+ >+namespace JSC { >+ >+class StreamsCountQueuingStrategy : public JSNonFinalObject { >+public: >+ typedef JSNonFinalObject Base; >+ >+ static StreamsCountQueuingStrategy* create(VM&, JSGlobalObject*); >+ static Structure* createStructure(VM&, JSGlobalObject*, JSValue); >+ >+ DECLARE_EXPORT_INFO; >+ >+private: >+ StreamsCountQueuingStrategy(VM&, Structure*); >+ void finishCreation(VM&); >+}; >+ >+} // namespace JSC >+ >+#endif >+ >+#endif // StreamsCountQueuingStrategy_h >diff --git a/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyConstructor.cpp b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyConstructor.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..8d7d7762db43543f3b4cb6570fb52783a000537d >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyConstructor.cpp >@@ -0,0 +1,119 @@ >+/* >+ * Copyright (C) 2015 Canon Inc. >+ * Copyright (C) 2015 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted, provided that the following conditions >+ * are required to be met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Canon Inc. nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR >+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "StreamsCountQueuingStrategyConstructor.h" >+ >+#if ENABLE(STREAMS_API) >+ >+#include "Error.h" >+#include "Exception.h" >+#include "IteratorOperations.h" >+#include "JSCBuiltins.h" >+#include "JSCJSValueInlines.h" >+#include "JSCellInlines.h" >+#include "Lookup.h" >+#include "NumberObject.h" >+#include "StreamsCountQueuingStrategy.h" >+#include "StreamsCountQueuingStrategyPrototype.h" >+#include "StructureInlines.h" >+ >+namespace JSC { >+ >+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(StreamsCountQueuingStrategyConstructor); >+ >+} >+ >+namespace JSC { >+ >+const ClassInfo StreamsCountQueuingStrategyConstructor::s_info = { "Function", &InternalFunction::s_info, 0, CREATE_METHOD_TABLE(StreamsCountQueuingStrategyConstructor) }; >+ >+StreamsCountQueuingStrategyConstructor* StreamsCountQueuingStrategyConstructor::create(VM& vm, Structure* structure, StreamsCountQueuingStrategyPrototype* countQueuingStrategyPrototype) >+{ >+ StreamsCountQueuingStrategyConstructor* constructor = new (NotNull, allocateCell<StreamsCountQueuingStrategyConstructor>(vm.heap)) StreamsCountQueuingStrategyConstructor(vm, structure); >+ constructor->finishCreation(vm, countQueuingStrategyPrototype); >+ return constructor; >+} >+ >+Structure* StreamsCountQueuingStrategyConstructor::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >+{ >+ return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); >+} >+ >+StreamsCountQueuingStrategyConstructor::StreamsCountQueuingStrategyConstructor(VM& vm, Structure* structure) >+ : InternalFunction(vm, structure) >+{ >+} >+ >+void StreamsCountQueuingStrategyConstructor::finishCreation(VM& vm, StreamsCountQueuingStrategyPrototype* streamsCountQueuingStrategyPrototype) >+{ >+ Base::finishCreation(vm, ASCIILiteral("CountQueuingStrategy")); >+ putDirectWithoutTransition(vm, vm.propertyNames->prototype, streamsCountQueuingStrategyPrototype, DontEnum | DontDelete | ReadOnly); >+ putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum | DontDelete); >+} >+ >+static EncodedJSValue JSC_HOST_CALL constructCountQueuingStrategy(ExecState* exec) >+{ >+ VM& vm = exec->vm(); >+ JSGlobalObject* globalObject = exec->callee()->globalObject(); >+ >+ StreamsCountQueuingStrategy* countQueuingStrategy = StreamsCountQueuingStrategy::create(vm, globalObject); >+ >+ return JSValue::encode(countQueuingStrategy); >+} >+ >+ConstructType StreamsCountQueuingStrategyConstructor::getConstructData(JSCell*, ConstructData& constructData) >+{ >+ constructData.native.function = constructCountQueuingStrategy; >+ return ConstructTypeHost; >+} >+ >+CallType StreamsCountQueuingStrategyConstructor::getCallData(JSCell*, CallData& callData) >+{ >+ callData.native.function = constructCountQueuingStrategy; >+ return CallTypeHost; >+} >+ >+StreamsCountQueuingStrategy* constructCountQueuingStrategy(ExecState* exec, JSGlobalObject* globalObject, JSFunction* resolver) >+{ >+ StreamsCountQueuingStrategyConstructor* countQueuingStrategyConstructor = globalObject->streamsCountQueuingStrategyConstructor(); >+ >+ ConstructData constructData; >+ ConstructType constructType = getConstructData(countQueuingStrategyConstructor, constructData); >+ ASSERT(constructType != ConstructTypeNone); >+ >+ MarkedArgumentBuffer arguments; >+ arguments.append(resolver); >+ >+ return jsCast<StreamsCountQueuingStrategy*>(construct(exec, countQueuingStrategyConstructor, constructType, constructData, arguments)); >+} >+ >+} // namespace JSC >+ >+#endif // ENABLE(STREAMS_API) >diff --git a/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyConstructor.h b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyConstructor.h >new file mode 100644 >index 0000000000000000000000000000000000000000..d3d1ef0a3cb2e6a6e835c8e860261e3c93be6330 >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyConstructor.h >@@ -0,0 +1,67 @@ >+/* >+ * Copyright (C) 2015 Canon Inc. >+ * Copyright (C) 2015 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted, provided that the following conditions >+ * are required to be met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Canon Inc. nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR >+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef StreamsCountQueuingStrategyConstructor_h >+#define StreamsCountQueuingStrategyConstructor_h >+ >+#if ENABLE(STREAMS_API) >+ >+#include "InternalFunction.h" >+ >+namespace JSC { >+ >+class StreamsCountQueuingStrategy; >+class StreamsCountQueuingStrategyPrototype; >+ >+class StreamsCountQueuingStrategyConstructor : public InternalFunction { >+public: >+ typedef InternalFunction Base; >+ static const unsigned StructureFlags = Base::StructureFlags; >+ >+ static StreamsCountQueuingStrategyConstructor* create(VM&, Structure*, StreamsCountQueuingStrategyPrototype*); >+ static Structure* createStructure(VM&, JSGlobalObject*, JSValue); >+ >+ DECLARE_INFO; >+ >+protected: >+ void finishCreation(VM&, StreamsCountQueuingStrategyPrototype*); >+ >+private: >+ StreamsCountQueuingStrategyConstructor(VM&, Structure*); >+ static ConstructType getConstructData(JSCell*, ConstructData&); >+ static CallType getCallData(JSCell*, CallData&); >+}; >+ >+StreamsCountQueuingStrategy* constructCountQueuingStrategy(ExecState*, JSGlobalObject*, JSFunction*); >+ >+} // namespace JSC >+ >+#endif // ENABLE(STREAMS_API) >+ >+#endif // StreamsCountQueuingStrategyConstructor_h >diff --git a/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyPrototype.cpp b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyPrototype.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..cd9eb17d1e5a421278ec3e284c404b6f4ef2b916 >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyPrototype.cpp >@@ -0,0 +1,86 @@ >+/* >+ * Copyright (C) 2015 Canon Inc. >+ * Copyright (C) 2015 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted, provided that the following conditions >+ * are required to be met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Canon Inc. nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR >+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "StreamsCountQueuingStrategyPrototype.h" >+ >+#if ENABLE(STREAMS_API) >+ >+#include "Error.h" >+#include "JSCBuiltins.h" >+#include "JSCJSValueInlines.h" >+#include "JSCellInlines.h" >+#include "JSGlobalObject.h" >+#include "JSPromise.h" >+#include "Microtask.h" >+#include "StructureInlines.h" >+ >+namespace JSC { >+ >+STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(StreamsCountQueuingStrategyPrototype); >+ >+} >+ >+namespace JSC { >+ >+const ClassInfo StreamsCountQueuingStrategyPrototype::s_info = { "CountQueuingStrategyPrototype", &JSNonFinalObject::s_info, 0, CREATE_METHOD_TABLE(StreamsCountQueuingStrategyPrototype) }; >+ >+StreamsCountQueuingStrategyPrototype* StreamsCountQueuingStrategyPrototype::create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure) >+{ >+ VM& vm = exec->vm(); >+ StreamsCountQueuingStrategyPrototype* object = new (NotNull, allocateCell<StreamsCountQueuingStrategyPrototype>(vm.heap)) StreamsCountQueuingStrategyPrototype(exec, structure); >+ object->finishCreation(vm, globalObject); >+ return object; >+} >+ >+Structure* StreamsCountQueuingStrategyPrototype::createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) >+{ >+ return Structure::create(vm, globalObject, prototype, TypeInfo(ObjectType, StructureFlags), info()); >+} >+ >+StreamsCountQueuingStrategyPrototype::StreamsCountQueuingStrategyPrototype(ExecState* exec, Structure* structure) >+ : JSNonFinalObject(exec->vm(), structure) >+{ >+} >+ >+static EncodedJSValue JSC_HOST_CALL streamsCountQueuingStrategyProtoFuncSize(ExecState*) >+{ >+ return JSValue::encode(jsNumber(1)); >+} >+ >+void StreamsCountQueuingStrategyPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject) >+{ >+ Base::finishCreation(vm); >+ >+ JSC_NATIVE_FUNCTION(vm.propertyNames->size, streamsCountQueuingStrategyProtoFuncSize, DontEnum, 1); >+} >+ >+} // namespace JSC >+ >+#endif // ENABLE(STREAMS_API) >diff --git a/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyPrototype.h b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyPrototype.h >new file mode 100644 >index 0000000000000000000000000000000000000000..94da43f954eeca2d2cffc9c4156402c7abe5a074 >--- /dev/null >+++ b/Source/JavaScriptCore/runtime/StreamsCountQueuingStrategyPrototype.h >@@ -0,0 +1,60 @@ >+/* >+ * Copyright (C) 2015 Canon Inc. >+ * Copyright (C) 2015 Igalia S.L. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted, provided that the following conditions >+ * are required to be met: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * 3. Neither the name of Canon Inc. nor the names of >+ * its contributors may be used to endorse or promote products derived >+ * from this software without specific prior written permission. >+ * >+ * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR >+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef StreamsCountQueuingStrategyPrototype_h >+#define StreamsCountQueuingStrategyPrototype_h >+ >+#if ENABLE(STREAMS_API) >+ >+#include "JSObject.h" >+ >+namespace JSC { >+ >+class StreamsCountQueuingStrategyPrototype : public JSNonFinalObject { >+public: >+ typedef JSNonFinalObject Base; >+ static const unsigned StructureFlags = Base::StructureFlags; >+ >+ static StreamsCountQueuingStrategyPrototype* create(ExecState*, JSGlobalObject*, Structure*); >+ static Structure* createStructure(VM&, JSGlobalObject*, JSValue); >+ >+ DECLARE_INFO; >+ >+protected: >+ void finishCreation(VM&, JSGlobalObject*); >+ >+private: >+ StreamsCountQueuingStrategyPrototype(ExecState*, Structure*); >+}; >+ >+} // namespace JSC >+ >+#endif // ENABLE(STREAMS_API) >+ >+#endif // StreamsCountQueuingStrategyPrototype_h >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index f2313df33128b0f0a908b4e020e62594984e7e9f..a12cea302b7b2d0029f7d7f975f46a74dc035690 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2015-07-20 Xabier Rodriguez Calvar <calvaris@igalia.com> >+ >+ [Streams API] Create CountQueuingStrategy object as per spec >+ https://bugs.webkit.org/show_bug.cgi?id=146594 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * streams/reference-implementation/brand-checks.html: >+ * streams/reference-implementation/count-queuing-strategy.html: Removed references to count-queuing-strategy.js. >+ * streams/reference-implementation/resources/count-queuing-strategy.js: Removed. >+ (CountQueuingStrategy): Deleted. >+ (CountQueuingStrategy.prototype.size): Deleted. >+ > 2015-07-18 Saam barati <saambarati1@gmail.com> > > [ES6] Add support for block scope const >diff --git a/LayoutTests/streams/reference-implementation/brand-checks.html b/LayoutTests/streams/reference-implementation/brand-checks.html >index 197b8a6ccd50ea96bcf05f363382d532778953d3..1a57af751a0da34cf7bae5b0b48e5f2043c74d36 100644 >--- a/LayoutTests/streams/reference-implementation/brand-checks.html >+++ b/LayoutTests/streams/reference-implementation/brand-checks.html >@@ -2,7 +2,6 @@ > <script src='../../resources/testharness.js'></script> > <script src='../../resources/testharnessreport.js'></script> > <script src='resources/streams-utils.js'></script> >-<script src='resources/count-queuing-strategy.js'></script> > <script src='resources/byte-length-queuing-strategy.js'></script> > <script> > var ReadableStreamReader; >diff --git a/LayoutTests/streams/reference-implementation/count-queuing-strategy.html b/LayoutTests/streams/reference-implementation/count-queuing-strategy.html >index 555ca515eded75d6775d29fa7e93b559e95c1f86..1353c0f2d104ec8a887dd82b38041d200bef0168 100644 >--- a/LayoutTests/streams/reference-implementation/count-queuing-strategy.html >+++ b/LayoutTests/streams/reference-implementation/count-queuing-strategy.html >@@ -2,7 +2,6 @@ > <script src='../../resources/testharness.js'></script> > <script src='../../resources/testharnessreport.js'></script> > <script src='resources/streams-utils.js'></script> >-<script src='resources/count-queuing-strategy.js'></script> > <script> > test(function() { > new CountQueuingStrategy({ highWaterMark: 4 }); >diff --git a/LayoutTests/streams/reference-implementation/resources/count-queuing-strategy.js b/LayoutTests/streams/reference-implementation/resources/count-queuing-strategy.js >deleted file mode 100644 >index 5fc21f2ffc2b7ef348c8776e8ef4037fa328a73e..0000000000000000000000000000000000000000 >--- a/LayoutTests/streams/reference-implementation/resources/count-queuing-strategy.js >+++ /dev/null >@@ -1,11 +0,0 @@ >-// FIXME: Remove this file when implemented in WebCore. >- >-function CountQueuingStrategy({ highWaterMark }) { >- createDataProperty(this, 'highWaterMark', highWaterMark); >-} >- >-CountQueuingStrategy.prototype = { >- size: function(chunk) { >- return 1; >- } >-}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 146594
:
256109
|
256298
|
256972
|
257087
|
257091
|
257094
|
257113
|
257168
|
257177
|
257192
|
257260
|
257348
|
257647
|
257649
|
257752
|
257949
|
257955
|
258061
|
258169
|
258480
|
258481
|
258484
|
258485
|
258489
|
258490
|
258491
|
258493
|
258494
|
258497
|
258498