[Streams API] Create CountQueuingStrategy object as per spec
authorcalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Aug 2015 16:35:43 +0000 (16:35 +0000)
committercalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Aug 2015 16:35:43 +0000 (16:35 +0000)
commit4c6801c02c4d01493f9c15ae8193108deb1fd6b6
tree3477e2f552e845da60dd225f3c98180627f1a9c3
parentbb29ea3583f63cc002f7d8b98eb7c86ec556dd95
[Streams API] Create CountQueuingStrategy object as per spec
https://bugs.webkit.org/show_bug.cgi?id=146594

Reviewed by Geoffrey Garen.

Source/WebCore:

CountQueuingStrategy is a class part of the Streams API that can be found at
https://streams.spec.whatwg.org/#cqs-class. We had it as js at the tests but the spec says we have to provide it
natively. The class is implemented in this patch by creating its corresponding IDL with the size method using
the [CustomBinding] attribute, that does not create any bindings against the object allowing us full control to
do what the spec requires (just returning 1 without any cast check). The constructor sets the highWaterMark
property taking it from the argument.

Covered by current tests
(LayoutTests/streams/reference-implementation/count-queuing-strategy.html and
LayoutTests/streams/reference-implementation/brand-checks.html).

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* PlatformMac.cmake:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp: Build infrastructure.
* Modules/streams/CountQueuingStrategy.h: Added.
(WebCore::CountQueuingStrategy::~CountQueuingStrategy): Created empty.
(WebCore::CountQueuingStrategy::size): Returns 1.
* Modules/streams/CountQueuingStrategy.idl: Added.
* bindings/js/JSCountQueuingStrategyCustom.cpp: Added.
(WebCore::jsCountQueuingStrategyPrototypeFunctionSize): Calls WebCore::CountQueuingStrategy::size.
(WebCore::constructJSCountQueuingStrategy): Constructs the strategy, copies the highWaterMark from the argument
and returns it.
* bindings/js/JSDOMBinding.h:
(WebCore::getPropertyFromObject): Moved from ReadableJSStream.cpp.
(WebCore::setPropertyToObject): Added to create a property into an object.
* bindings/js/ReadableJSStream.cpp:
(WebCore::getPropertyFromObject): Deleted.

LayoutTests:

* js/dom/global-constructors-attributes-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/ios-sim-deprecated/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt: Updated expectations with
CountQueuingStrategy constructor.
* streams/reference-implementation/brand-checks.html:
* streams/reference-implementation/count-queuing-strategy.html: Removed reference to count-queuing-strategy.js.
* streams/reference-implementation/resources/count-queuing-strategy.js: Removed.
(CountQueuingStrategy): Deleted.
(CountQueuingStrategy.prototype.size): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
LayoutTests/ChangeLog
LayoutTests/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/ios-sim-deprecated/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt
LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt
LayoutTests/streams/reference-implementation/brand-checks.html
LayoutTests/streams/reference-implementation/count-queuing-strategy.html
LayoutTests/streams/reference-implementation/resources/count-queuing-strategy.js [deleted file]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/streams/CountQueuingStrategy.h [new file with mode: 0644]
Source/WebCore/Modules/streams/CountQueuingStrategy.idl [new file with mode: 0644]
Source/WebCore/PlatformMac.cmake
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSCountQueuingStrategyCustom.cpp [new file with mode: 0644]
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/js/ReadableJSStream.cpp