[Streams API] Implement a barebone ReadableStream interface
authorcalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Feb 2015 10:19:05 +0000 (10:19 +0000)
committercalvaris@igalia.com <calvaris@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Feb 2015 10:19:05 +0000 (10:19 +0000)
commit22afb3e97f59f1487199f3428fc787b6ef096285
tree1cc3f3776605db182e897d1d1d817bd86e24325f
parent108ac5cef79a5dca9aacd40fa48432e930995bca
[Streams API] Implement a barebone ReadableStream interface
https://bugs.webkit.org/show_bug.cgi?id=141045

Reviewed by Benjamin Poulain.

.:

* Source/cmake/WebKitFeatures.cmake:
* Source/cmakeconfig.h.cmake: Made streams API compilation on by default.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

This patch implements the ReadableStream IDL (https://streams.spec.whatwg.org/#rs-model).
No functionality is yet added.
ReadableStreamSource is expected to be implemented for native sources (such as HTTP sources)
as well as JavaScript source through ReadableStreamJSSource.

Test: streams/readablestream-constructor.html

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/streams/ReadableStream.cpp: Added.
(WebCore::ReadableStream::create):
(WebCore::ReadableStream::ReadableStream):
(WebCore::ReadableStream::~ReadableStream):
(WebCore::ReadableStream::state):
(WebCore::ReadableStream::closed):
(WebCore::ReadableStream::ready):
* Modules/streams/ReadableStream.h: Added.
* Modules/streams/ReadableStream.idl: Added.
* Modules/streams/ReadableStreamSource.h: Added.
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.vcxproj/WebCoreCommon.props:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSReadableStreamCustom.cpp: Added.
(WebCore::JSReadableStream::read):
(WebCore::JSReadableStream::ready):
(WebCore::JSReadableStream::closed):
(WebCore::JSReadableStream::cancel):
(WebCore::JSReadableStream::pipeTo):
(WebCore::JSReadableStream::pipeThrough):
(WebCore::constructJSReadableStream):
* bindings/js/ReadableStreamJSSource.cpp: Added.
(WebCore::ReadableStreamJSSource::create):
(WebCore::ReadableStreamJSSource::ReadableStreamJSSource):
(WebCore::ReadableStreamJSSource::setInternalError):
* bindings/JSReadableStreamJSSource.h: Added.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* Scripts/webkitperl/FeatureList.pm: Added streams-api compilation switch.

LayoutTests:

Added readablestream-constructor test that checks ReadableStream properties and state.
Rebased global-constructor-attributes.html expectations to add ReadableStream description.

* 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-mountainlion/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:
* streams/readablestream-constructor-expected.txt: Added.
* streams/readablestream-constructor.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
42 files changed:
ChangeLog
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-mountainlion/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/readablestream-constructor-expected.txt [new file with mode: 0644]
LayoutTests/streams/readablestream-constructor.html [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WTF/ChangeLog
Source/WTF/wtf/FeatureDefines.h
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/DerivedSources.cpp
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/streams/ReadableStream.cpp [new file with mode: 0644]
Source/WebCore/Modules/streams/ReadableStream.h [new file with mode: 0644]
Source/WebCore/Modules/streams/ReadableStream.idl [new file with mode: 0644]
Source/WebCore/Modules/streams/ReadableStreamSource.h [new file with mode: 0644]
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.vcxproj/WebCoreCommon.props
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/js/JSBindingsAllInOne.cpp
Source/WebCore/bindings/js/JSReadableStreamCustom.cpp [new file with mode: 0644]
Source/WebCore/bindings/js/ReadableStreamJSSource.cpp [new file with mode: 0644]
Source/WebCore/bindings/js/ReadableStreamJSSource.h [new file with mode: 0644]
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig
Source/cmake/WebKitFeatures.cmake
Source/cmakeconfig.h.cmake
Tools/ChangeLog
Tools/Scripts/webkitperl/FeatureList.pm