Source/JavaScriptCore/ChangeLog

 12015-01-26 Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
 2
 3 [Streams API] Implement ReadableStream
 4 https://bugs.webkit.org/show_bug.cgi?id=138967
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * Configurations/FeatureDefines.xcconfig: Added ENAGBLE_STREAMS_API flag.
 9 * runtime/JSPromiseDeferred.h:
 10 * runtime/JSPromiseDeferred.cpp:
 11 (JSC::resolvePromise): Helper to resolve a promise from C++ given
 12 both resolution and rejection JS functions.
 13
1142015-01-23 Joseph Pecoraro <pecoraro@apple.com>
215
316 Web Inspector: Rename InjectedScriptHost::type to subtype

Source/WTF/ChangeLog

 12015-01-26 Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
 2
 3 [Streams API] Implement ReadableStream
 4 https://bugs.webkit.org/show_bug.cgi?id=138967
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * wtf/FeatureDefines.h: Added ENABLE_STREAMS_API flag.
 9
1102015-01-24 Chris Dumez <cdumez@apple.com>
211
312 Provide implementation for WTF::DefaultHash<bool>

Source/WebCore/ChangeLog

 12015-01-26 Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
 2
 3 [Streams API] Implement ReadableStream
 4 https://bugs.webkit.org/show_bug.cgi?id=138967
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 This patch implements the ReadableStream construct
 9 (https://streams.spec.whatwg.org/#rs-model).
 10 ReadableStream can be used by native data sources
 11 (network, sensors) to stream data. In that case, the data is
 12 stored within a queue of opaque binary data within ReadableStream.
 13 ReadableStream can also be used to stream JavaScript objects, in
 14 which case the queue (of JSC::JSValue) is stored within
 15 JSReadableStreamSource.
 16
 17 ReadableStream implements the core functionality,
 18 in particular backpressure checking.
 19 ReadableStreamSource encapsulates stream data sources.
 20 They can be either JS sources or native sources.
 21 JSReadableStreamSource is the class that encapsulates JavaScript data sources.
 22 Callbacks provided as part of the JSReadableStream constructor are used to fill data.
 23
 24 Tests: fast/streams/readablestreams-api-cancel-error.html
 25 fast/streams/readablestreams-api-cancel.html
 26 fast/streams/readablestreams-api-cancel-infinite-stream.html
 27 fast/streams/readablestreams-api-cancel-no-chunks.html
 28 fast/streams/readablestreams-api-cancel-promise.html
 29 fast/streams/readablestreams-api-cancel-throw-exception.html
 30 fast/streams/readablestreams-api-count-queueing-strategy.html
 31 fast/streams/readablestreams-api-pull-close.html
 32 fast/streams/readablestreams-api-pull.html
 33 fast/streams/readablestreams-api-read-errored-stream.html
 34 fast/streams/readablestreams-api-start.html
 35 fast/streams/readablestreams-api-start-promise.html
 36 fast/streams/readablestreams-api-start-throws.html
 37 fast/streams/readablestreams-api-wrong-arguments.html
 38
 39 * CMakeLists.txt:
 40 * Configurations/FeatureDefines.xcconfig:
 41 * DerivedSources.cpp:
 42 * DerivedSources.make: Added compilation structure for Streams
 43 API.
 44 * Modules/streams/ReadableStream.cpp: Added.
 45 (WebCore::ReadableStream::create): Creates a ReadableStream.
 46 (WebCore::ReadableStream::ReadableStream): Constructs a
 47 ReadableStream.
 48 (WebCore::ReadableStream::~ReadableStream): Destroys a
 49 ReadableStream.
 50 (WebCore::ReadableStream::setError): Sets an error and sets the
 51 state to Errored.
 52 (WebCore::ReadableStream::state): Returns the state of the stream.
 53 (WebCore::ReadableStream::resolveReadyCallback): Defers the ready
 54 callback to the main thread.
 55 (WebCore::ReadableStream::resolveClosedCallback): Defers the
 56 closed callback to the main thread.
 57 (WebCore::ReadableStream::notifyCancel): Defers the success or
 58 error in case or errored stream to the main thread.
 59 (WebCore::ReadableStream::cancel): Cancels, clears the stream,
 60 runs the callbacks and sets its state to closed.
 61 (WebCore::ReadableStream::closed): Resolves the closed callback.
 62 (WebCore::ReadableStream::ready): Resolves the ready callback.
 63 (WebCore::ReadableStream::queueSize): Returns the stored queue
 64 total size.
 65 (WebCore::ReadableStream::shouldApplyBackpressure): Asks the
 66 source if backpressure should be applied.
 67 (WebCore::ReadableStream::start): Starts the stream by attempting
 68 to pull.
 69 (WebCore::ReadableStream::canPull): Checked if the streams is in
 70 pullable state.
 71 (WebCore::ReadableStream::callReadableStreamPull): Performs the
 72 pull process, being checkes and deferring to the source.
 73 (WebCore::ReadableStream::read): Performs the process of reading
 74 an array buffer chunk.
 75 (WebCore::ReadableStream::notifyFinish): Notifies the stream
 76 closing or erroring.
 77 (WebCore::ReadableStream::createReadableStreamCloseFunction):
 78 Closes the stream and runs the callbacks if needed.
 79 (WebCore::ReadableStream::createReadableStreamErrorFunction): Sets
 80 the stream as errored and runs the callbacks.
 81 (WebCore::ReadableStream::canEnqueue): Checks if the stream is
 82 still able to take chunks.
 83 (WebCore::ReadableStream::enqueue): Adds a chung to the queue.
 84 * Modules/streams/ReadableStream.h: Added.
 85 (WebCore::ReadableStream::activeDOMObjectName): Returns
 86 "ReadableStream".
 87 (WebCore::ReadableStream::source): Returns the source.
 88 (WebCore::ReadableStream::error): Returns the stored error.
 89 * Modules/streams/ReadableStream.idl: Added. Defines the JS
 90 interface for the ReadableStream.
 91 * Modules/streams/ReadableStreamSource.h: Added. Contains the
 92 interface the different readable stream sources should implement.
 93 * WebCore.vcxproj/WebCore.vcxproj:
 94 * WebCore.vcxproj/WebCore.vcxproj.filters:
 95 * WebCore.vcxproj/WebCoreCommon.props:
 96 * WebCore.xcodeproj/project.pbxproj:
 97 * bindings/js/JSBindingsAllInOne.cpp: Added compilation structure
 98 for Streams API.
 99 * bindings/js/JSReadableStreamCustom.cpp: Added.
 100 (WebCore::JSReadableStream::read): Reads a chunk as an array
 101 buffer or as a JS object, depending on the source.
 102 (WebCore::JSReadableStream::ready): Wraps the success callback as
 103 a promise.
 104 (WebCore::JSReadableStream::closed): Wraps the closed callback as
 105 a promise.
 106 (WebCore::JSReadableStream::cancel): Wraps the success and failure
 107 callbacks as as promise.
 108 (WebCore::constructJSReadableStream): Constructs the
 109 JSReadableStream from the promise based constructor.
 110 * bindings/js/JSReadableStreamSource.cpp: Added.
 111 (WebCore::getSlotFromObject): Helper to get the value stored in a
 112 slot of a JSObject.
 113 (WebCore::setSlotToObject): Helper to set a value in a JSObject.
 114 (WebCore::getJSReadableStream): Helper to get the ReadableStream
 115 from the corresponding object.
 116 (WebCore::getPropertyFromObject): Helper to get a property value
 117 from an object.
 118 (WebCore::JSReadableStreamSource::callFunction): Helper to call a
 119 JavaScript function from C++.
 120 (WebCore::errorFromValueReadableStream): Sets an error both to the
 121 stream and the source and runs the error process in the stream.
 122 (WebCore::JSReadableStreamSource::JSReadableStreamSource):
 123 Constructs a JSReadableStream by checking the JS constructor
 124 arguments.
 125 (WebCore::JSReadableStreamSource::chunkSize): Helper to invoke the
 126 JS chunkSize function. It provides the default to 1 in case it
 127 had not been provided when constructing.
 128 (WebCore::enqueueReadableStreamFunction): Runs the steps according
 129 to the spec to enqueue a chunk.
 130 (WebCore::createReadableStreamEnqueueFunction): Creates the JS
 131 enqueue function, based on WebCore::enqueueReadableStreamFunction.
 132 (WebCore::closeReadableStreamFunction): Defers closing the stream
 133 to itself.
 134 (WebCore::createReadableStreamCloseFunction): Creates the JS close
 135 function based on WebCore::closeReadableStreamFunction.
 136 (WebCore::errorReadableStreamFunction): Function called from JS to
 137 set the stream error.
 138 (WebCore::createReadableStreamErrorFunction): Creates the JS error
 139 function based on WebCore::errorReadableStreamFunction.
 140 (WebCore::JSReadableStreamSource::setStream): Sets the JS stream
 141 to the JS source, sets the functions and sets the stream as slot
 142 to the function objects so that the stream is reachable from
 143 inside them.
 144 (WebCore::JSReadableStreamSource::create): Creates a
 145 JSReadableStreamSource.
 146 (WebCore::cancelResultFulfilled): Tells the stream to notify the
 147 cancellation.
 148 (WebCore::createCancelResultFulfilledFunction): Creates the JS
 149 function based on WebCore::cancelResultFulfilled.
 150 (WebCore::cancelResultRejected): Sets and error and tells the
 151 stream to notify the cancellation.
 152 (WebCore::createCancelResultRejectedFunction): Creates the JS
 153 Function based on WebCore::cancelResultRejected.
 154 (WebCore::JSReadableStreamSource::pull): Calls the stored JS pull
 155 function. Does no-op if there is none.
 156 (WebCore::JSReadableStreamSource::cancel): Calls js JS cancel
 157 function if any, and resolves the promise.
 158 (WebCore::JSReadableStreamSource::shouldApplyBackpressure): Calls
 159 the stream JS strategy function from the constructor and does the
 160 default strategy if there is none stored.
 161 (WebCore::startResultFulfilled): Starts the stream.
 162 (WebCore::createStartResultFulfilledFunction): Creates the JS
 163 function based on WebCore::startResultFulfilled.
 164 (WebCore::startResultRejected): Sets the stream to errored.
 165 (WebCore::createStartResultRejectedFunction): Creates the JS
 166 function based on WebCore::startResultRejected.
 167 (WebCore::JSReadableStreamSource::start): Calls the stored JS
 168 start function.
 169 (WebCore::JSReadableStreamSource::enqueue): Queues a JS value
 170 chunk.
 171 (WebCore::JSReadableStreamSource::read): Takes a chunk from the
 172 queue.
 173 * bindings/js/JSReadableStreamSource.h: Added.
 174
11752015-01-26 Michael Catanzaro <mcatanzaro@igalia.com>
2176
3177 [GTK] gtkdoc does not appear in DevHelp

Source/WebKit/mac/ChangeLog

 12015-01-26 Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
 2
 3 [Streams API] Implement ReadableStream
 4 https://bugs.webkit.org/show_bug.cgi?id=138967
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * Configurations/FeatureDefines.xcconfig: Added ENABLE_STREAMS_API flag.
 9
1102015-01-23 Timothy Horton <timothy_horton@apple.com>
211
312 QLPreviewMenuItem popovers don't close when the page scrolls

Source/WebKit2/ChangeLog

 12015-01-26 Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
 2
 3 [Streams API] Implement ReadableStream
 4 https://bugs.webkit.org/show_bug.cgi?id=138967
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * CMakeLists.txt: Added streams dir.
 9 * Configurations/FeatureDefines.xcconfig: Added ENABLE_STREAMS_API flag.
 10
1112015-01-26 Michael Catanzaro <mcatanzaro@igalia.com>
212
313 [GTK] gtkdoc does not appear in DevHelp

Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig

@@ENABLE_RESOLUTION_MEDIA_QUERY = ;
165165ENABLE_RUBBER_BANDING[sdk=macosx*] = ENABLE_RUBBER_BANDING;
166166ENABLE_CSS_SCROLL_SNAP = ENABLE_CSS_SCROLL_SNAP;
167167ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 168ENABLE_STREAMS_API = ENABLE_STREAMS_API;
168169ENABLE_SUBTLE_CRYPTO[sdk=iphone*] = ENABLE_SUBTLE_CRYPTO;
169170ENABLE_SUBTLE_CRYPTO[sdk=macosx*] = $(ENABLE_SUBTLE_CRYPTO_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
170171ENABLE_SUBTLE_CRYPTO_macosx_1080 = ;

@@ENABLE_LLINT_C_LOOP = ;
226227
227228ENABLE_SATURATED_LAYOUT_ARITHMETIC = ENABLE_SATURATED_LAYOUT_ARITHMETIC;
228229
229 FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_ES6_CLASS_SYNTAX) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RUBBER_BANDING) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_OTF_CONVERTER) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(ENABLE_SATURATED_LAYOUT_ARITHMETIC) $(ENABLE_VIDEO_PRESENTATION_MODE);
 230FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_ES6_CLASS_SYNTAX) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RUBBER_BANDING) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_OTF_CONVERTER) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(ENABLE_SATURATED_LAYOUT_ARITHMETIC) $(ENABLE_VIDEO_PRESENTATION_MODE);

Source/JavaScriptCore/runtime/JSPromiseDeferred.cpp

11/*
22 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 * Copyright (C) 2015 Canon Inc.
 4 * Copyright (C) 2015 Igalia S.L.
35 *
46 * Redistribution and use in source and binary forms, with or without
57 * modification, are permitted provided that the following conditions

@@ThenableStatus updateDeferredFromPotentialThenable(ExecState* exec, JSValue x, J
197199 return WasAThenable;
198200}
199201
 202bool resolvePromise(ExecState* exec, JSValue result, JSValue fulfilledFunction, JSValue rejectedFunction)
 203{
 204 JSLockHolder lock(exec);
 205
 206 JSPromise* promise = jsDynamicCast<JSPromise*>(result);
 207
 208 if (!promise)
 209 return false;
 210
 211 JSValue C = promise->constructor();
 212 JSValue deferredValue = createJSPromiseDeferredFromConstructor(exec, C);
 213 JSPromiseDeferred* deferred = jsCast<JSPromiseDeferred*>(deferredValue);
 214 ThenableStatus updateResult = updateDeferredFromPotentialThenable(exec, result, deferred);
 215 if (exec->hadException() || updateResult == NotAThenable)
 216 return false;
 217
 218 JSObject* deferredPromise = deferred->promise();
 219
 220 JSValue thenValue = deferredPromise->get(exec, exec->vm().propertyNames->then);
 221 if (exec->hadException())
 222 return false;
 223
 224 CallData thenCallData;
 225 CallType thenCallType = getCallData(thenValue, thenCallData);
 226 if (thenCallType == CallTypeNone)
 227 return false;
 228
 229 MarkedArgumentBuffer arguments;
 230 arguments.append(fulfilledFunction);
 231 arguments.append(rejectedFunction);
 232
 233 call(exec, thenValue, thenCallType, thenCallData, deferredPromise, arguments);
 234
 235 return true;
 236}
 237
200238void performDeferredResolve(ExecState* exec, JSPromiseDeferred* deferred, JSValue argument)
201239{
202240 JSValue deferredResolve = deferred->resolve();

Source/JavaScriptCore/runtime/JSPromiseDeferred.h

11/*
22 * Copyright (C) 2013 Apple Inc. All rights reserved.
 3 * Copyright (C) 2015 Canon Inc.
 4 * Copyright (C) 2015 Igalia S.L.
35 *
46 * Redistribution and use in source and binary forms, with or without
57 * modification, are permitted provided that the following conditions

@@enum ThenableStatus {
7072
7173JSValue createJSPromiseDeferredFromConstructor(ExecState*, JSValue constructor);
7274ThenableStatus updateDeferredFromPotentialThenable(ExecState*, JSValue, JSPromiseDeferred*);
 75JS_EXPORT_PRIVATE bool resolvePromise(ExecState*, JSValue promise, JSValue fullfilFunction, JSValue rejectFunction);
7376
7477void performDeferredResolve(ExecState*, JSPromiseDeferred*, JSValue argument);
7578void performDeferredReject(ExecState*, JSPromiseDeferred*, JSValue argument);

Source/WTF/wtf/FeatureDefines.h

@@the public iOS SDK. We will also need to update the FeatureDefines.xcconfig file
653653#define ENABLE_SPELLCHECK 0
654654#endif
655655
 656#if !defined(ENABLE_STREAMS_API)
 657#define ENABLE_STREAMS_API 0
 658#endif
 659
656660#if !defined(ENABLE_SVG_FONTS)
657661#define ENABLE_SVG_FONTS 1
658662#endif

Source/WebCore/CMakeLists.txt

@@set(WebCore_INCLUDE_DIRECTORIES
1717 "${WEBCORE_DIR}/Modules/proximity"
1818 "${WEBCORE_DIR}/Modules/quota"
1919 "${WEBCORE_DIR}/Modules/speech"
 20 "${WEBCORE_DIR}/Modules/streams"
2021 "${WEBCORE_DIR}/Modules/vibration"
2122 "${WEBCORE_DIR}/Modules/webaudio"
2223 "${WEBCORE_DIR}/Modules/webdatabase"

@@set(WebCore_IDL_INCLUDES
142143 Modules/proximity
143144 Modules/quota
144145 Modules/speech
 146 Modules/streams
145147 Modules/vibration
146148 Modules/webaudio
147149 Modules/webdatabase

@@set(WebCore_NON_SVG_IDL_FILES
269271 Modules/speech/SpeechSynthesisUtterance.idl
270272 Modules/speech/SpeechSynthesisVoice.idl
271273
 274 Modules/streams/ReadableStream.idl
 275
272276 Modules/vibration/NavigatorVibration.idl
273277
274278 Modules/webaudio/AnalyserNode.idl

@@set(WebCore_SOURCES
900904 Modules/speech/SpeechSynthesisUtterance.cpp
901905 Modules/speech/SpeechSynthesisVoice.cpp
902906
 907 Modules/streams/ReadableStream.cpp
 908
903909 Modules/vibration/NavigatorVibration.cpp
904910 Modules/vibration/Vibration.cpp
905911

@@set(WebCore_SOURCES
11271133 bindings/js/JSRTCPeerConnectionCustom.cpp
11281134 bindings/js/JSRTCSessionDescriptionCustom.cpp
11291135 bindings/js/JSRTCStatsResponseCustom.cpp
 1136 bindings/js/JSReadableStreamCustom.cpp
 1137 bindings/js/JSReadableStreamSource.cpp
11301138 bindings/js/JSRequestAnimationFrameCallbackCustom.cpp
11311139 bindings/js/JSSQLResultSetRowListCustom.cpp
11321140 bindings/js/JSSQLTransactionCustom.cpp

Source/WebCore/Configurations/FeatureDefines.xcconfig

@@ENABLE_RESOLUTION_MEDIA_QUERY = ;
165165ENABLE_RUBBER_BANDING[sdk=macosx*] = ENABLE_RUBBER_BANDING;
166166ENABLE_CSS_SCROLL_SNAP = ENABLE_CSS_SCROLL_SNAP;
167167ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 168ENABLE_STREAMS_API = ENABLE_STREAMS_API;
168169ENABLE_SUBTLE_CRYPTO[sdk=iphone*] = ENABLE_SUBTLE_CRYPTO;
169170ENABLE_SUBTLE_CRYPTO[sdk=macosx*] = $(ENABLE_SUBTLE_CRYPTO_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
170171ENABLE_SUBTLE_CRYPTO_macosx_1080 = ;

@@ENABLE_LLINT_C_LOOP = ;
226227
227228ENABLE_SATURATED_LAYOUT_ARITHMETIC = ENABLE_SATURATED_LAYOUT_ARITHMETIC;
228229
229 FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_ES6_CLASS_SYNTAX) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RUBBER_BANDING) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_OTF_CONVERTER) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(ENABLE_SATURATED_LAYOUT_ARITHMETIC) $(ENABLE_VIDEO_PRESENTATION_MODE);
 230FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_ES6_CLASS_SYNTAX) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RUBBER_BANDING) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_OTF_CONVERTER) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(ENABLE_SATURATED_LAYOUT_ARITHMETIC) $(ENABLE_VIDEO_PRESENTATION_MODE);

Source/WebCore/DerivedSources.cpp

300300#include "JSRadioNodeList.cpp"
301301#include "JSRange.cpp"
302302#include "JSRangeException.cpp"
 303#if ENABLE(STREAMS_API)
 304#include "JSReadableStream.cpp"
 305#endif
303306#include "JSRect.cpp"
304307#include "JSRequestAnimationFrameCallback.cpp"
305308#include "JSRGBColor.cpp"

Source/WebCore/DerivedSources.make

@@VPATH = \
4141 $(WebCore)/Modules/plugins \
4242 $(WebCore)/Modules/quota \
4343 $(WebCore)/Modules/speech \
 44 $(WebCore)/Modules/streams \
4445 $(WebCore)/Modules/webaudio \
4546 $(WebCore)/Modules/webdatabase \
4647 $(WebCore)/Modules/websockets \

@@NON_SVG_BINDING_IDLS = \
167168 $(WebCore)/Modules/speech/SpeechSynthesisEvent.idl \
168169 $(WebCore)/Modules/speech/SpeechSynthesisUtterance.idl \
169170 $(WebCore)/Modules/speech/SpeechSynthesisVoice.idl \
 171 $(WebCore)/Modules/streams/ReadableStream.idl \
170172 $(WebCore)/Modules/webaudio/AudioBuffer.idl \
171173 $(WebCore)/Modules/webaudio/AudioBufferCallback.idl \
172174 $(WebCore)/Modules/webaudio/AudioBufferSourceNode.idl \

Source/WebCore/Modules/streams/ReadableStream.cpp

 1/*
 2 * Copyright (C) 2015 Canon Inc.
 3 * Copyright (C) 2015 Igalia S.L.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted, provided that the following conditions
 7 * are required to be met:
 8 *
 9 * 1. Redistributions of source code must retain the above copyright
 10 * notice, this list of conditions and the following disclaimer.
 11 * 2. Redistributions in binary form must reproduce the above copyright
 12 * notice, this list of conditions and the following disclaimer in the
 13 * documentation and/or other materials provided with the distribution.
 14 * 3. Neither the name of Canon Inc. nor the names of
 15 * its contributors may be used to endorse or promote products derived
 16 * from this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 21 * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
 22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 28 */
 29
 30#include "config.h"
 31
 32#if ENABLE(STREAMS_API)
 33#include "ReadableStream.h"
 34
 35#include "Blob.h"
 36#include "ExceptionCode.h"
 37#include "Logging.h"
 38#include <cmath>
 39#include <wtf/Forward.h>
 40#include <wtf/HashMap.h>
 41#include <wtf/MainThread.h>
 42#include <wtf/NeverDestroyed.h>
 43#include <wtf/RefCountedLeakCounter.h>
 44#include <wtf/text/AtomicString.h>
 45#include <wtf/text/StringHash.h>
 46#include <wtf/text/WTFString.h>
 47
 48namespace WebCore {
 49
 50DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, readableStreamCounter, ("ReadableStream"));
 51
 52PassRefPtr<ReadableStream> ReadableStream::create(ScriptExecutionContext& scriptExecutionContext, PassRefPtr<ReadableStreamSource> source)
 53{
 54 RefPtr<ReadableStream> readableStream(adoptRef(new ReadableStream(scriptExecutionContext, source)));
 55 readableStream->suspendIfNeeded();
 56
 57 return readableStream.release();
 58}
 59
 60ReadableStream::ReadableStream(ScriptExecutionContext& scriptExecutionContext, PassRefPtr<ReadableStreamSource> source)
 61 : ActiveDOMObject(&scriptExecutionContext)
 62 , m_state(Waiting)
 63 , m_isDraining(false)
 64 , m_isPulling(false)
 65 , m_isStarted(false)
 66 , m_source(source)
 67 , m_totalQueueSize(0)
 68{
 69#ifndef NDEBUG
 70 readableStreamCounter.increment();
 71#endif
 72}
 73
 74ReadableStream::~ReadableStream()
 75{
 76#ifndef NDEBUG
 77 readableStreamCounter.decrement();
 78#endif
 79}
 80
 81void ReadableStream::setError(const String& error)
 82{
 83 m_state = Errored;
 84 m_error = error;
 85}
 86
 87String ReadableStream::state() const
 88{
 89 switch (m_state) {
 90 case Waiting:
 91 return ASCIILiteral("waiting");
 92 case Closed:
 93 return ASCIILiteral("closed");
 94 case Readable:
 95 return ASCIILiteral("readable");
 96 case Errored:
 97 return ASCIILiteral("errored");
 98 }
 99 return ASCIILiteral("");
 100}
 101
 102void ReadableStream::resolveReadyCallback()
 103{
 104 if (!m_readyCallback)
 105 return;
 106
 107 SuccessCallback callback = WTF::move(m_readyCallback);
 108 callOnMainThread([callback]() {
 109 callback(nullptr);
 110 });
 111}
 112
 113void ReadableStream::resolveClosedCallback()
 114{
 115 ASSERT(m_state == Closed || m_state == Errored);
 116
 117 if (!m_closedCallback)
 118 return;
 119
 120 SuccessCallback callback = WTF::move(m_closedCallback);
 121 callOnMainThread([callback]() {
 122 callback(nullptr);
 123 });
 124}
 125
 126void ReadableStream::notifyCancel()
 127{
 128 if (m_state == Errored) {
 129 ErrorCallback localErrorCallback = WTF::move(m_cancelledErrorCallback);
 130 callOnMainThread([localErrorCallback, this]() {
 131 localErrorCallback(m_error);
 132 });
 133 return;
 134 }
 135 SuccessCallback localSuccessCallback = WTF::move(m_cancelledSuccessCallback);
 136 callOnMainThread([localSuccessCallback]() {
 137 localSuccessCallback(nullptr);
 138 });
 139}
 140
 141void ReadableStream::cancel(const String& reason, SuccessCallback successCallback, ErrorCallback errorCallback)
 142{
 143 if (m_state == Closed) {
 144 SuccessCallback localSuccessCallback = WTF::move(successCallback);
 145 callOnMainThread([localSuccessCallback]() {
 146 localSuccessCallback(nullptr);
 147 });
 148 return;
 149 }
 150
 151 if (m_state == Errored) {
 152 ErrorCallback localErrorCallback = WTF::move(errorCallback);
 153 callOnMainThread([localErrorCallback, this]() {
 154 localErrorCallback(m_error);
 155 });
 156 return;
 157 }
 158
 159 if (m_state == Waiting)
 160 resolveReadyCallback();
 161
 162
 163 m_queue.shrink(0);
 164 m_sizeQueue.shrink(0);
 165 m_totalQueueSize = 0;
 166
 167 m_state = Closed;
 168
 169 resolveClosedCallback();
 170
 171 m_cancelledSuccessCallback = WTF::move(successCallback);
 172 m_cancelledErrorCallback = WTF::move(errorCallback);
 173 if (m_source && !m_source->cancel(reason)) {
 174 // Wait for underlying source to call notifyCancel.
 175 return;
 176 }
 177 notifyCancel();
 178}
 179
 180void ReadableStream::closed(SuccessCallback callback)
 181{
 182 m_closedCallback = WTF::move(callback);
 183
 184 if (m_state == Closed || m_state == Errored)
 185 resolveClosedCallback();
 186}
 187
 188void ReadableStream::ready(SuccessCallback callback)
 189{
 190 m_readyCallback = WTF::move(callback);
 191 if (m_state != Waiting)
 192 resolveReadyCallback();
 193}
 194
 195unsigned ReadableStream::queueSize()
 196{
 197 return m_totalQueueSize;
 198}
 199
 200bool ReadableStream::shouldApplyBackpressure()
 201{
 202 bool shouldApplyBackpressureAsBool = m_source->shouldApplyBackpressure(this->queueSize());
 203
 204 // In case of rethrow, stop pulling and exit, hence returning true here.
 205 if (m_source->hadError())
 206 return true;
 207
 208 return shouldApplyBackpressureAsBool;
 209}
 210
 211void ReadableStream::start()
 212{
 213 m_isStarted = true;
 214 callReadableStreamPull();
 215}
 216
 217bool ReadableStream::canPull()
 218{
 219 return !m_isPulling && !m_isDraining && m_isStarted && m_state != Closed && m_state != Errored;
 220}
 221
 222void ReadableStream::callReadableStreamPull()
 223{
 224 if (!canPull())
 225 return;
 226
 227 if (this->shouldApplyBackpressure())
 228 return;
 229
 230 m_isPulling = true;
 231
 232 m_source->pull();
 233}
 234
 235PassRefPtr<JSC::ArrayBuffer> ReadableStream::read(ExceptionCode& exceptionCode)
 236{
 237 if (m_state == Waiting || m_state == Closed) {
 238 exceptionCode = TypeError;
 239 return nullptr;
 240 }
 241
 242 // 2. If this@[[state]] is "errored", throw this@[[storedError]].
 243 if (m_state == Errored)
 244 return nullptr;
 245
 246 ASSERT(m_state == Readable);
 247 ASSERT(m_totalQueueSize > 0);
 248
 249 m_totalQueueSize = m_totalQueueSize - m_sizeQueue.takeLast();
 250 // m_queue is empty if the readable stream is handling JSValue (JS source) and not array buffers (native sources).
 251 // Queued JSValue is retrieved from the corresponding JSReadableStreamSource in JSReadableStream::read.
 252 RefPtr<SharedBuffer> buffer = m_queue.size() ? m_queue.takeLast() : nullptr;
 253
 254 if (!m_totalQueueSize) {
 255 if (m_isDraining) {
 256 m_state = Closed;
 257 resolveClosedCallback();
 258 } else
 259 m_state = Waiting;
 260 }
 261
 262 callReadableStreamPull();
 263 if (m_source->hadError())
 264 return nullptr;
 265
 266 // FIXME: We should optimize the array buffer pipeline.
 267 return buffer ? buffer->createArrayBuffer() : nullptr;
 268}
 269
 270void ReadableStream::notifyFinish()
 271{
 272 (m_state == Errored) ? createReadableStreamErrorFunction() : createReadableStreamCloseFunction();
 273}
 274
 275void ReadableStream::createReadableStreamCloseFunction()
 276{
 277 if (m_state == Waiting) {
 278 m_state = Closed;
 279 resolveReadyCallback();
 280 resolveClosedCallback();
 281 } else if (m_state == Readable)
 282 m_isDraining = true;
 283}
 284
 285void ReadableStream::createReadableStreamErrorFunction()
 286{
 287 // Cleaning current buffer.
 288 m_queue.shrink(0);
 289 m_sizeQueue.shrink(0);
 290 m_totalQueueSize = 0;
 291
 292 m_state = Errored;
 293 resolveReadyCallback();
 294 resolveClosedCallback();
 295}
 296
 297bool ReadableStream::canEnqueue(String &error)
 298{
 299 if (m_state == Errored) {
 300 error = m_error;
 301 return false;
 302 }
 303
 304 if (m_state == Closed) {
 305 error = ASCIILiteral("tried to enqueue data in a closed stream");
 306 return false;
 307 }
 308
 309 if (m_isDraining) {
 310 error = ASCIILiteral("tried to enqueue data in a draining stream");
 311 return false;
 312 }
 313 return true;
 314}
 315
 316bool ReadableStream::enqueue(const char* chunkValue, unsigned valueLength, unsigned chunkSize)
 317{
 318 m_isPulling = false;
 319
 320 m_state = Readable;
 321
 322 if (chunkValue)
 323 m_queue.insert(0, SharedBuffer::create(chunkValue, valueLength));
 324
 325 m_sizeQueue.insert(0, chunkSize);
 326 m_totalQueueSize += chunkSize;
 327
 328 resolveReadyCallback();
 329
 330 return shouldApplyBackpressure();
 331}
 332
 333}
 334
 335#endif

Source/WebCore/Modules/streams/ReadableStream.h

 1/*
 2 * Copyright (C) 2015 Canon Inc.
 3 * Copyright (C) 2015 Igalia S.L.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted, provided that the following conditions
 7 * are required to be met:
 8 *
 9 * 1. Redistributions of source code must retain the above copyright
 10 * notice, this list of conditions and the following disclaimer.
 11 * 2. Redistributions in binary form must reproduce the above copyright
 12 * notice, this list of conditions and the following disclaimer in the
 13 * documentation and/or other materials provided with the distribution.
 14 * 3. Neither the name of Canon Inc. nor the names of
 15 * its contributors may be used to endorse or promote products derived
 16 * from this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 21 * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
 22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 28 */
 29
 30#ifndef ReadableStream_h
 31#define ReadableStream_h
 32
 33#if ENABLE(STREAMS_API)
 34
 35#include "ActiveDOMObject.h"
 36#include "ReadableStreamSource.h"
 37#include "ScriptWrappable.h"
 38#include "SharedBuffer.h"
 39#include <functional>
 40#include <wtf/PassRefPtr.h>
 41#include <wtf/RefCounted.h>
 42#include <wtf/RefPtr.h>
 43#include <wtf/Vector.h>
 44
 45namespace WebCore {
 46
 47typedef int ExceptionCode;
 48
 49class ScriptExecutionContext;
 50
 51
 52// ReadableStream implements the core of the streams API ReadableStream functionality.
 53// It handles in particular the backpressure according the queue size.
 54// ReadableStream is using a ReadableStreamSource to get data in its queue.
 55class ReadableStream : public ActiveDOMObject, public ScriptWrappable, public RefCounted<ReadableStream> {
 56public:
 57
 58 enum State {
 59 Waiting,
 60 Closed,
 61 Readable,
 62 Errored
 63 };
 64
 65 static PassRefPtr<ReadableStream> create(ScriptExecutionContext&, PassRefPtr<ReadableStreamSource>);
 66 virtual ~ReadableStream();
 67
 68 virtual const char* activeDOMObjectName() const override { return "ReadableStream"; }
 69
 70 // Data feeders.
 71 void notifyError();
 72 void notifyFinish();
 73 void notifyCancel();
 74
 75 // JS API implementation.
 76 String state() const;
 77 PassRefPtr<JSC::ArrayBuffer> read(ExceptionCode&);
 78
 79 typedef std::function<void(const String&)> ErrorCallback;
 80 typedef std::function<void(RefPtr<ReadableStream>)> SuccessCallback;
 81
 82 virtual void cancel(const String&, SuccessCallback, ErrorCallback);
 83 virtual void closed(SuccessCallback);
 84 void ready(SuccessCallback);
 85
 86 // API used from the JS binding.
 87 void start();
 88
 89 ReadableStreamSource* source() { return m_source.get(); }
 90 unsigned queueSize();
 91
 92 void createReadableStreamCloseFunction();
 93 void createReadableStreamErrorFunction();
 94
 95 bool canEnqueue(String &);
 96 // FIXME: Enqueue directly a SharedBuffer or ArrayBuffer.
 97 bool enqueue(const char*, unsigned, unsigned /*chunkSize*/);
 98
 99 void setError(const String&);
 100 const String& error() { return m_error; }
 101
 102private:
 103
 104 ReadableStream(ScriptExecutionContext&, PassRefPtr<ReadableStreamSource>);
 105 void resolveReadyCallback();
 106 void resolveClosedCallback();
 107
 108 void callReadableStreamPull();
 109 bool shouldApplyBackpressure();
 110 bool canPull();
 111
 112 State m_state;
 113
 114 bool m_isDraining;
 115 bool m_isPulling;
 116 bool m_isStarted;
 117
 118 RefPtr<ReadableStreamSource> m_source;
 119
 120 // Queue dedicated to bytes, that may come from native objects like HTTP backend.
 121 Vector<RefPtr<SharedBuffer>> m_queue;
 122 // Queue of chunk size to implement the backpressure.
 123 Vector<unsigned> m_sizeQueue;
 124 unsigned m_totalQueueSize;
 125
 126 SuccessCallback m_readyCallback;
 127 SuccessCallback m_closedCallback;
 128 SuccessCallback m_cancelledSuccessCallback;
 129
 130 ErrorCallback m_cancelledErrorCallback;
 131
 132 String m_error;
 133};
 134
 135}
 136
 137#endif
 138
 139#endif // ReadableStream_h

Source/WebCore/Modules/streams/ReadableStream.idl

 1/*
 2 * Copyright (C) 2015 Canon Inc.
 3 * Copyright (C) 2015 Igalia S.L.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted, provided that the following conditions
 7 * are required to be met:
 8 *
 9 * 1. Redistributions of source code must retain the above copyright
 10 * notice, this list of conditions and the following disclaimer.
 11 * 2. Redistributions in binary form must reproduce the above copyright
 12 * notice, this list of conditions and the following disclaimer in the
 13 * documentation and/or other materials provided with the distribution.
 14 * 3. Neither the name of Canon Inc. nor the names of
 15 * its contributors may be used to endorse or promote products derived
 16 * from this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 21 * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
 22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 28 */
 29
 30enum ReadableStreamStateType { "readable", "waiting", "closed", "errored" };
 31
 32[
 33 CustomConstructor(any properties),
 34 Conditional=STREAMS_API
 35] interface ReadableStream {
 36 readonly attribute ReadableStreamStateType state;
 37
 38 [Custom] Promise cancel(DOMString reason);
 39 [Custom, RaisesException] Object read();
 40 [Custom, RaisesException] Object pipeTo(any streams, any options);
 41 [Custom, RaisesException] Object pipeThrough(any dest, any options);
 42
 43 [GetterRaisesException, CustomGetter] readonly attribute Promise closed;
 44 [GetterRaisesException, CustomGetter] readonly attribute Promise ready;
 45
 46};

Source/WebCore/Modules/streams/ReadableStreamSource.h

 1/*
 2 * Copyright (C) 2015 Canon Inc.
 3 * Copyright (C) 2015 Igalia S.L.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted, provided that the following conditions
 7 * are required to be met:
 8 *
 9 * 1. Redistributions of source code must retain the above copyright
 10 * notice, this list of conditions and the following disclaimer.
 11 * 2. Redistributions in binary form must reproduce the above copyright
 12 * notice, this list of conditions and the following disclaimer in the
 13 * documentation and/or other materials provided with the distribution.
 14 * 3. Neither the name of Canon Inc. nor the names of
 15 * its contributors may be used to endorse or promote products derived
 16 * from this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 21 * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
 22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 28 */
 29
 30#ifndef ReadableStreamSource_h
 31#define ReadableStreamSource_h
 32
 33#if ENABLE(STREAMS_API)
 34
 35#include "ExceptionCode.h"
 36#include <wtf/RefCounted.h>
 37#include <wtf/text/WTFString.h>
 38
 39namespace WebCore {
 40
 41// ReadableStreamSource is the interface used by ReadableStream to pull data.
 42class ReadableStreamSource: public RefCounted<ReadableStreamSource> {
 43
 44public:
 45 virtual ~ReadableStreamSource() { }
 46
 47 virtual void pull() { }
 48 virtual bool shouldApplyBackpressure(unsigned queueSize)
 49 {
 50 UNUSED_PARAM(queueSize);
 51 return true;
 52 }
 53
 54 // Return true if cancelled (sync case) and false in async case.
 55 virtual bool cancel(const String& reason)
 56 {
 57 UNUSED_PARAM(reason);
 58 return true;
 59 }
 60
 61 virtual bool hadError() { return false; }
 62};
 63
 64}
 65
 66#endif
 67
 68#endif // ReadableStreamSource_h

Source/WebCore/WebCore.vcxproj/WebCore.vcxproj

39713971 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
39723972 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
39733973 </ClCompile>
 3974 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSReadableStream.cpp">
 3975 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 3976 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 3977 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 3978 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 3979 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 3980 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 3981 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 3982 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 3983 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 3984 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 3985 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 3986 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 3987 </ClCompile>
39743988 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSRect.cpp">
39753989 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
39763990 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>

68316845 <ClCompile Include="..\Modules\notifications\Notification.cpp" />
68326846 <ClCompile Include="..\Modules\notifications\NotificationCenter.cpp" />
68336847 <ClCompile Include="..\Modules\notifications\WorkerGlobalScopeNotifications.cpp" />
 6848 <ClCompile Include="..\Modules\streams\ReadableStream.cpp" />
68346849 <ClCompile Include="..\Modules\webdatabase\ChangeVersionWrapper.cpp" />
68356850 <ClCompile Include="..\Modules\webdatabase\Database.cpp" />
68366851 <ClCompile Include="..\Modules\webdatabase\DatabaseAuthorizer.cpp" />

1732017335 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
1732117336 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
1732217337 </ClCompile>
 17338 <ClCompile Include="..\bindings\js\JSReadableStreamCustom.cpp">
 17339 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 17340 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 17341 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 17342 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 17343 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 17344 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 17345 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 17346 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 17347 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 17348 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 17349 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 17350 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 17351 </ClCompile>
 17352 <ClCompile Include="..\bindings\js\JSReadableStreamSource.cpp">
 17353 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
 17354 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
 17355 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'">true</ExcludedFromBuild>
 17356 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'">true</ExcludedFromBuild>
 17357 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'">true</ExcludedFromBuild>
 17358 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='DebugSuffix|x64'">true</ExcludedFromBuild>
 17359 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
 17360 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
 17361 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'">true</ExcludedFromBuild>
 17362 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'">true</ExcludedFromBuild>
 17363 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|Win32'">true</ExcludedFromBuild>
 17364 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Production|x64'">true</ExcludedFromBuild>
 17365 </ClCompile>
1732317366 <ClCompile Include="..\bindings\js\JSRequestAnimationFrameCallbackCustom.cpp">
1732417367 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
1732517368 <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>

1855118594 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSRadioNodeList.h" />
1855218595 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSRange.h" />
1855318596 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSRangeException.h" />
 18597 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSReadableStream.h" />
1855418598 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSRect.h" />
1855518599 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSRequestAnimationFrameCallback.h" />
1855618600 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSRGBColor.h" />

1906719111 <ClInclude Include="..\Modules\notifications\NotificationClient.h" />
1906819112 <ClInclude Include="..\Modules\notifications\WorkerGlobalScopeNotifications.h" />
1906919113 <ClInclude Include="..\Modules\plugins\PluginReplacement.h" />
 19114 <ClInclude Include="..\Modules\streams\ReadableStream.h" />
 19115 <ClInclude Include="..\Modules\streams\ReadableStreamSource.h" />
1907019116 <ClInclude Include="..\Modules\webdatabase\AbstractDatabaseServer.h" />
1907119117 <ClInclude Include="..\Modules\webdatabase\ChangeVersionData.h" />
1907219118 <ClInclude Include="..\Modules\webdatabase\ChangeVersionWrapper.h" />

Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters

3434 <Filter Include="Modules\notifications">
3535 <UniqueIdentifier>{a595ffcf-fa22-48a9-91ad-c528a75a62e5}</UniqueIdentifier>
3636 </Filter>
 37 <Filter Include="Modules\streams">
 38 <UniqueIdentifier>{d67ba5bd-6574-42f3-9da3-55f550747863}</UniqueIdentifier>
 39 </Filter>
3740 <Filter Include="Modules\webdatabase">
3841 <UniqueIdentifier>{5e0e9582-b4b4-452d-a6de-7c6b31f614e7}</UniqueIdentifier>
3942 </Filter>

462465 <ClCompile Include="..\Modules\notifications\WorkerGlobalScopeNotifications.cpp">
463466 <Filter>Modules\notifications</Filter>
464467 </ClCompile>
 468 <ClCompile Include="..\Modules\streams\ReadableStream.cpp">
 469 <Filter>Modules\streams</Filter>
 470 </ClCompile>
465471 <ClCompile Include="..\Modules\webdatabase\ChangeVersionWrapper.cpp">
466472 <Filter>Modules\webdatabase</Filter>
467473 </ClCompile>

43984404 <ClCompile Include="..\bindings\js\JSPluginElementFunctions.cpp">
43994405 <Filter>bindings\js</Filter>
44004406 </ClCompile>
 4407 <ClCompile Include="..\bindings\js\JSReadableStreamCustom.cpp">
 4408 <Filter>bindings\js</Filter>
 4409 </ClCompile>
 4410 <ClCompile Include="..\bindings\js\JSReadableStreamSource.cpp">
 4411 <Filter>bindings\js</Filter>
 4412 </ClCompile>
44014413 <ClCompile Include="..\bindings\js\JSRequestAnimationFrameCallbackCustom.cpp">
44024414 <Filter>bindings\js</Filter>
44034415 </ClCompile>

56775689 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSRangeException.cpp">
56785690 <Filter>DerivedSources</Filter>
56795691 </ClCompile>
 5692 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSReadableStream.cpp">
 5693 <Filter>DerivedSources</Filter>
 5694 </ClCompile>
56805695 <ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSRect.cpp">
56815696 <Filter>DerivedSources</Filter>
56825697 </ClCompile>

1356813583 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources\JSWorkerNavigator.h">
1356913584 <Filter>DerivedSources</Filter>
1357013585 </ClInclude>
 13586 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSReadableStream.h">
 13587 <Filter>DerivedSources</Filter>
 13588 </ClInclude>
1357113589 <ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSXMLHttpRequest.h">
1357213590 <Filter>DerivedSources</Filter>
1357313591 </ClInclude>

Source/WebCore/WebCore.vcxproj/WebCoreCommon.props

77 </PropertyGroup>
88 <ItemDefinitionGroup>
99 <ClCompile>
10  <AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\encryptedmedia;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\gamepad;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\plugins;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\cssjit;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\audio;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\icu;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\replay;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\crypto\keys;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
 10 <AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\encryptedmedia;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\gamepad;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\plugins;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\streams;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\cssjit;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\audio;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\icu;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\replay;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\crypto\keys;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
1111 <PreprocessorDefinitions>DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
1212 <PrecompiledHeader>Use</PrecompiledHeader>
1313 <PrecompiledHeaderFile>WebCorePrefix.h</PrecompiledHeaderFile>

Source/WebCore/WebCore.xcodeproj/project.pbxproj

14851485 418F88050FF957AF0080F045 /* JSAbstractWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 418F88030FF957AE0080F045 /* JSAbstractWorker.h */; };
14861486 419BC2DE1685329900D64D6D /* VisitedLinkState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 419BC2DC1685329900D64D6D /* VisitedLinkState.cpp */; };
14871487 419BC2DF1685329900D64D6D /* VisitedLinkState.h in Headers */ = {isa = PBXBuildFile; fileRef = 419BC2DD1685329900D64D6D /* VisitedLinkState.h */; };
 1488 41A023EF1A39DB7A00F722CF /* ReadableStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41A023EB1A39DB7900F722CF /* ReadableStream.cpp */; };
 1489 41A023F01A39DB7A00F722CF /* ReadableStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 41A023EC1A39DB7900F722CF /* ReadableStream.h */; };
 1490 41A023F21A39DB7A00F722CF /* ReadableStreamSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41A023EE1A39DB7A00F722CF /* ReadableStreamSource.h */; };
 1491 41A023F61A39DBCB00F722CF /* JSReadableStreamCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41A023F31A39DBCB00F722CF /* JSReadableStreamCustom.cpp */; };
 1492 41A023F81A39DBCB00F722CF /* JSReadableStreamSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 41A023F51A39DBCB00F722CF /* JSReadableStreamSource.h */; };
 1493 41A024171A39FADC00F722CF /* JSReadableStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41A024151A39FADC00F722CF /* JSReadableStream.cpp */; };
 1494 41A024181A39FADC00F722CF /* JSReadableStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 41A024161A39FADC00F722CF /* JSReadableStream.h */; };
 1495 41A17A2C1A448BC6006A4FCD /* JSReadableStreamSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41A17A2B1A448B71006A4FCD /* JSReadableStreamSource.cpp */; };
14881496 41A3D58E101C152D00316D07 /* DedicatedWorkerThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41A3D58C101C152D00316D07 /* DedicatedWorkerThread.cpp */; };
14891497 41A3D58F101C152D00316D07 /* DedicatedWorkerThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 41A3D58D101C152D00316D07 /* DedicatedWorkerThread.h */; };
14901498 41BF700C0FE86F49005E8DEC /* MessagePortChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 41BF700A0FE86F49005E8DEC /* MessagePortChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };

85378545 418F88030FF957AE0080F045 /* JSAbstractWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAbstractWorker.h; sourceTree = "<group>"; };
85388546 419BC2DC1685329900D64D6D /* VisitedLinkState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisitedLinkState.cpp; sourceTree = "<group>"; };
85398547 419BC2DD1685329900D64D6D /* VisitedLinkState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisitedLinkState.h; sourceTree = "<group>"; };
 8548 41A023EB1A39DB7900F722CF /* ReadableStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStream.cpp; sourceTree = "<group>"; };
 8549 41A023EC1A39DB7900F722CF /* ReadableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStream.h; sourceTree = "<group>"; };
 8550 41A023ED1A39DB7900F722CF /* ReadableStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadableStream.idl; sourceTree = "<group>"; };
 8551 41A023EE1A39DB7A00F722CF /* ReadableStreamSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReadableStreamSource.h; sourceTree = "<group>"; };
 8552 41A023F31A39DBCB00F722CF /* JSReadableStreamCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamCustom.cpp; sourceTree = "<group>"; };
 8553 41A023F51A39DBCB00F722CF /* JSReadableStreamSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamSource.h; sourceTree = "<group>"; };
 8554 41A024151A39FADC00F722CF /* JSReadableStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStream.cpp; sourceTree = "<group>"; };
 8555 41A024161A39FADC00F722CF /* JSReadableStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStream.h; sourceTree = "<group>"; };
 8556 41A17A2B1A448B71006A4FCD /* JSReadableStreamSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamSource.cpp; sourceTree = "<group>"; };
85408557 41A3D58C101C152D00316D07 /* DedicatedWorkerThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DedicatedWorkerThread.cpp; path = workers/DedicatedWorkerThread.cpp; sourceTree = "<group>"; };
85418558 41A3D58D101C152D00316D07 /* DedicatedWorkerThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DedicatedWorkerThread.h; path = workers/DedicatedWorkerThread.h; sourceTree = "<group>"; };
85428559 41BF700A0FE86F49005E8DEC /* MessagePortChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessagePortChannel.h; sourceTree = "<group>"; };

1495514972 BC9854460CD3DA5F00069BC1 /* Ranges */,
1495614973 AA7FEE9B16A491A1004C0C33 /* Speech */,
1495714974 A83B79150CCB0078000B0825 /* Storage */,
 14975 41A023FA1A39F13A00F722CF /* Streams */,
1495814976 A83B790A0CCAFF47000B0825 /* SVG */,
1495914977 417DA71213735D90007C57FB /* Testing */,
1496014978 E1C8BE4B0E8BD0D10064CB7D /* Threads */,

1569115709 path = js;
1569215710 sourceTree = "<group>";
1569315711 };
 15712 41A023EA1A39DB7900F722CF /* streams */ = {
 15713 isa = PBXGroup;
 15714 children = (
 15715 41A023EB1A39DB7900F722CF /* ReadableStream.cpp */,
 15716 41A023EC1A39DB7900F722CF /* ReadableStream.h */,
 15717 41A023ED1A39DB7900F722CF /* ReadableStream.idl */,
 15718 41A023EE1A39DB7A00F722CF /* ReadableStreamSource.h */,
 15719 );
 15720 path = streams;
 15721 sourceTree = "<group>";
 15722 };
 15723 41A023FA1A39F13A00F722CF /* Streams */ = {
 15724 isa = PBXGroup;
 15725 children = (
 15726 41A024151A39FADC00F722CF /* JSReadableStream.cpp */,
 15727 41A024161A39FADC00F722CF /* JSReadableStream.h */,
 15728 );
 15729 name = Streams;
 15730 sourceTree = "<group>";
 15731 };
1569415732 439046C212DA25CE00AF80A2 /* mathml */ = {
1569515733 isa = PBXGroup;
1569615734 children = (

1813018168 072AE1DE183C0513000A5988 /* plugins */,
1813118169 89F60B08157F68350075E157 /* quota */,
1813218170 AA2A5AB716A485A400975A25 /* speech */,
 18171 41A023EA1A39DB7900F722CF /* streams */,
1813318172 FD315FA212B025B100C1A359 /* webaudio */,
1813418173 97BC69D51505F054001B74AC /* webdatabase */,
1813518174 97AABCF714FA09B5007457AE /* websockets */,

2090420943 C6F420A116B7164E0052A9F2 /* JSMutationCallback.h */,
2090520944 93B70D4F09EB0C7C009D8468 /* JSPluginElementFunctions.cpp */,
2090620945 93B70D5009EB0C7C009D8468 /* JSPluginElementFunctions.h */,
 20946 41A023F51A39DBCB00F722CF /* JSReadableStreamSource.h */,
 20947 41A17A2B1A448B71006A4FCD /* JSReadableStreamSource.cpp */,
2090720948 E1C36D320EB0A094007410BC /* JSWorkerGlobalScopeBase.cpp */,
2090820949 E1C36D330EB0A094007410BC /* JSWorkerGlobalScopeBase.h */,
2090920950 BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */,

2107021111 FDBD1DFB167FE27D0051A11E /* JSOscillatorNodeCustom.cpp */,
2107121112 FD8AA63D169514A700D2EA68 /* JSPannerNodeCustom.cpp */,
2107221113 A85F22081430377D007CC884 /* JSPopStateEventCustom.cpp */,
 21114 41A023F31A39DBCB00F722CF /* JSReadableStreamCustom.cpp */,
2107321115 4998AED313FC417F0090B1AA /* JSRequestAnimationFrameCallbackCustom.cpp */,
2107421116 4AE0BF881836083100F3852D /* JSRTCIceCandidateCustom.cpp */,
2107521117 07CA120D182D67D800D12197 /* JSRTCPeerConnectionCustom.cpp */,

2508325125 B658FFA21522EF3A00DD5595 /* JSRadioNodeList.h in Headers */,
2508425126 65DF320209D1CC60000BE325 /* JSRange.h in Headers */,
2508525127 D23CA55D0AB0EAAE005108A5 /* JSRangeException.h in Headers */,
 25128 41A024181A39FADC00F722CF /* JSReadableStream.h in Headers */,
 25129 41A023F81A39DBCB00F722CF /* JSReadableStreamSource.h in Headers */,
2508625130 BCFE2F120C1B58380020235F /* JSRect.h in Headers */,
2508725131 4998AECE13F9D6C90090B1AA /* JSRequestAnimationFrameCallback.h in Headers */,
2508825132 BC74DA491013F468007987AD /* JSRGBColor.h in Headers */,

2576325807 F55B3DCE1251F12D003EF269 /* RangeInputType.h in Headers */,
2576425808 6E84E9E117668BF100815B68 /* RasterShape.h in Headers */,
2576525809 A84D827C11D333ED00972990 /* RawDataDocumentParser.h in Headers */,
 25810 41A023F01A39DB7A00F722CF /* ReadableStream.h in Headers */,
 25811 41A023F21A39DB7A00F722CF /* ReadableStreamSource.h in Headers */,
2576625812 FD31603C12B0267600C1A359 /* RealtimeAnalyser.h in Headers */,
2576725813 BC4368E80C226E32005EFB5F /* Rect.h in Headers */,
2576825814 FD45A958175D414C00C21EC8 /* RectangleShape.h in Headers */,

2863628682 B658FFA11522EF3A00DD5595 /* JSRadioNodeList.cpp in Sources */,
2863728683 65DF320109D1CC60000BE325 /* JSRange.cpp in Sources */,
2863828684 D23CA55F0AB0EAB6005108A5 /* JSRangeException.cpp in Sources */,
 28685 41A024171A39FADC00F722CF /* JSReadableStream.cpp in Sources */,
 28686 41A023F61A39DBCB00F722CF /* JSReadableStreamCustom.cpp in Sources */,
 28687 41A17A2C1A448BC6006A4FCD /* JSReadableStreamSource.cpp in Sources */,
2863928688 BCFE2F110C1B58370020235F /* JSRect.cpp in Sources */,
2864028689 4998AECD13F9D6C90090B1AA /* JSRequestAnimationFrameCallback.cpp in Sources */,
2864128690 4998AED413FC417F0090B1AA /* JSRequestAnimationFrameCallbackCustom.cpp in Sources */,

2925929308 978D07BA145A0F3C0096908D /* RangeException.cpp in Sources */,
2926029309 F55B3DCD1251F12D003EF269 /* RangeInputType.cpp in Sources */,
2926129310 6E84E9E017668BEE00815B68 /* RasterShape.cpp in Sources */,
 29311 41A023EF1A39DB7A00F722CF /* ReadableStream.cpp in Sources */,
2926229312 FD31603B12B0267600C1A359 /* RealtimeAnalyser.cpp in Sources */,
2926329313 FD45A95A175D417100C21EC8 /* RectangleShape.cpp in Sources */,
2926429314 BCAB418113E356E800D8AAF3 /* Region.cpp in Sources */,

3010830158 51D719FB181106E00016DC51 /* WorkerGlobalScopeIndexedDatabase.cpp in Sources */,
3010930159 97F8E665151D4A4B00D2D181 /* WorkerGlobalScopeNotifications.cpp in Sources */,
3011030160 6F995A151A70756200A735F4 /* WebGLSync.cpp in Sources */,
 30161 41A023F71A39DBCB00F722CF /* JSReadableStreamUnderlyingSource.cpp in Sources */,
3011130162 F36E07A41358A8BE00AACBC9 /* WorkerInspectorController.cpp in Sources */,
3011230163 2E43464C0F546A8200B0F1BA /* WorkerLocation.cpp in Sources */,
3011330164 2E43464F0F546A8200B0F1BA /* WorkerMessagingProxy.cpp in Sources */,

Source/WebCore/bindings/js/JSBindingsAllInOne.cpp

111111#include "JSNodeListCustom.cpp"
112112#include "JSPluginElementFunctions.cpp"
113113#include "JSPopStateEventCustom.cpp"
 114#if ENABLE(STREAMS_API)
 115#include "JSReadableStreamCustom.cpp"
 116#include "JSReadableStreamSource.cpp"
 117#endif
114118#include "JSRequestAnimationFrameCallbackCustom.cpp"
115119#include "JSSQLResultSetRowListCustom.cpp"
116120#include "JSSQLTransactionCustom.cpp"

Source/WebCore/bindings/js/JSReadableStreamCustom.cpp

 1/*
 2 * Copyright (C) 2015 Canon Inc.
 3 * Copyright (C) 2015 Igalia S.L.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted, provided that the following conditions
 7 * are required to be met:
 8 *
 9 * 1. Redistributions of source code must retain the above copyright
 10 * notice, this list of conditions and the following disclaimer.
 11 * 2. Redistributions in binary form must reproduce the above copyright
 12 * notice, this list of conditions and the following disclaimer in the
 13 * documentation and/or other materials provided with the distribution.
 14 * 3. Neither the name of Canon Inc. nor the names of
 15 * its contributors may be used to endorse or promote products derived
 16 * from this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 21 * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
 22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 28 */
 29
 30#include "config.h"
 31
 32#if ENABLE(STREAMS_API)
 33#include "JSReadableStream.h"
 34
 35#include "ExceptionCode.h"
 36#include "JSDOMPromise.h"
 37#include "JSReadableStreamSource.h"
 38#include "ReadableStream.h"
 39
 40using namespace JSC;
 41
 42
 43namespace WebCore {
 44
 45JSValue JSReadableStream::read(ExecState* exec)
 46{
 47 ExceptionCode ec = 0;
 48 RefPtr<JSC::ArrayBuffer> chunk = impl().read(ec);
 49 if (ec) {
 50 setDOMException(exec, ec);
 51 return jsUndefined();
 52 }
 53
 54 // Chunk may be null in case the queue is storing JSValue and the queue is managed directly within JSReadableStreamSource.
 55 if (chunk)
 56 return toJS(exec, globalObject(), chunk.release());
 57
 58 // FIXME: Ensure that the JSReadableStream source is a JSReadableStreamSource,
 59 // Maybe using JSObjectGetPrivate/JSObjectSetPrivate migration to express the link between JS source and JSReadableStream.
 60 JSReadableStreamSource* source = static_cast<JSReadableStreamSource*>(impl().source());
 61
 62 JSValue error = source->error();
 63 if (!error.isUndefined())
 64 return exec->vm().throwException(exec, error);
 65
 66 return source->read();
 67}
 68
 69JSValue JSReadableStream::ready(ExecState* exec) const
 70{
 71 DeferredWrapper wrapper(exec, globalObject());
 72 auto successCallback = [wrapper](RefPtr<ReadableStream> stream) mutable {
 73 wrapper.resolve(stream.get());
 74 };
 75 impl().ready(WTF::move(successCallback));
 76
 77 return wrapper.promise();
 78}
 79
 80JSValue JSReadableStream::closed(ExecState* exec) const
 81{
 82 DeferredWrapper wrapper(exec, globalObject());
 83 auto successCallback = [wrapper](RefPtr<ReadableStream> stream) mutable {
 84 wrapper.resolve(stream.get());
 85 };
 86 impl().closed(WTF::move(successCallback));
 87
 88 return wrapper.promise();
 89}
 90
 91JSValue JSReadableStream::cancel(ExecState* exec)
 92{
 93 DeferredWrapper wrapper(exec, globalObject());
 94 auto successCallback = [wrapper](RefPtr<ReadableStream> stream) mutable {
 95 wrapper.resolve(stream.get());
 96 };
 97 auto failureCallback = [wrapper](const String &message) mutable {
 98 wrapper.reject(message);
 99 };
 100
 101 JSValue reason = exec->argument(0);
 102 impl().cancel(reason.toString(exec)->value(exec), WTF::move(successCallback), WTF::move(failureCallback));
 103
 104 return wrapper.promise();
 105}
 106
 107JSValue JSReadableStream::pipeTo(ExecState* exec)
 108{
 109 JSValue error = createError(exec, ASCIILiteral("pipeTo is not implemented"));
 110 return exec->vm().throwException(exec, error);
 111}
 112
 113JSValue JSReadableStream::pipeThrough(ExecState* exec)
 114{
 115 JSValue error = createError(exec, ASCIILiteral("pipeTo is not implemented"));
 116 return exec->vm().throwException(exec, error);
 117}
 118
 119EncodedJSValue JSC_HOST_CALL constructJSReadableStream(ExecState* exec)
 120{
 121 DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec->callee());
 122 ASSERT(jsConstructor);
 123 ScriptExecutionContext* scriptExecutionContext = jsConstructor->scriptExecutionContext();
 124
 125 RefPtr<ReadableStream> readableStream = ReadableStream::create(*scriptExecutionContext, JSReadableStreamSource::create(exec));
 126 JSReadableStreamSource* source = static_cast<JSReadableStreamSource*>(readableStream->source());
 127
 128 JSValue sourceError = source->error();
 129 if (!sourceError.isUndefined())
 130 return throwVMError(exec, sourceError);
 131
 132 VM& vm = exec->vm();
 133 JSGlobalObject* globalObject = exec->callee()->globalObject();
 134 JSReadableStream* jsReadableStream = JSReadableStream::create(JSReadableStream::createStructure(vm, globalObject, JSReadableStream::createPrototype(vm, globalObject)), jsCast<JSDOMGlobalObject*>(globalObject), readableStream);
 135
 136 source->setStream(exec, jsReadableStream);
 137 source->start();
 138
 139 sourceError = source->error();
 140 if (!sourceError.isUndefined() && readableStream->error().isEmpty())
 141 return throwVMError(exec, sourceError);
 142
 143 return JSValue::encode(jsReadableStream);
 144}
 145
 146} // namespace WebCore
 147
 148#endif

Source/WebCore/bindings/js/JSReadableStreamSource.cpp

 1/*
 2 * Copyright (C) 2015 Canon Inc.
 3 * Copyright (C) 2015 Igalia S.L.
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted, provided that the following conditions
 7 * are required to be met:
 8 *
 9 * 1. Redistributions of source code must retain the above copyright
 10 * notice, this list of conditions and the following disclaimer.
 11 * 2. Redistributions in binary form must reproduce the above copyright
 12 * notice, this list of conditions and the following disclaimer in the
 13 * documentation and/or other materials provided with the distribution.
 14 * 3. Neither the name of Canon Inc. nor the names of
 15 * its contributors may be used to endorse or promote products derived
 16 * from this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 21 * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
 22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 28 */
 29
 30#include "config.h"
 31
 32#if ENABLE(STREAMS_API)
 33#include "JSReadableStreamSource.h"
 34
 35#include "ExceptionCode.h"
 36#include "JSDOMPromise.h"
 37#include "JSReadableStream.h"
 38#include "ReadableStream.h"
 39#include <runtime/Error.h>
 40#include <runtime/JSArrayBuffer.h>
 41#include <runtime/JSCJSValueInlines.h>
 42#include <runtime/JSPromise.h>
 43#include <runtime/JSPromiseDeferred.h>
 44#include <runtime/JSString.h>
 45#include <runtime/StructureInlines.h>
 46#include <wtf/MainThread.h>
 47
 48using namespace JSC;
 49
 50
 51namespace WebCore {
 52
 53// FIXME: Should we migrate to JSObjectGetPrivate/JSObjectSetPrivate in lieu of slots?
 54static JSValue getSlotFromObject(ExecState* exec, JSValue objectValue, const char* identifier)
 55{
 56 JSObject* object = objectValue.toObject(exec);
 57 PropertySlot propertySlot(objectValue);
 58 PropertyName propertyName = Identifier(exec, identifier);
 59 if (!object->getOwnPropertySlot(object, exec, propertyName, propertySlot))
 60 return jsUndefined();
 61 return propertySlot.getValue(exec, propertyName);
 62}
 63
 64// We use setSlotToObject on JS functions so that we can retrieve the JSReadableStream object inside the corresponding JS function.
 65static void setSlotToObject(ExecState* exec, JSValue objectValue, const char* identifier, JSValue value)
 66{
 67 JSObject* object = objectValue.toObject(exec);
 68 PutPropertySlot propertySlot(objectValue);
 69 object->put(object, exec, Identifier(exec, identifier), value, propertySlot);
 70}
 71
 72static JSReadableStream* getJSReadableStream(ExecState* exec)
 73{
 74 JSReadableStream* jsReadableStream = jsDynamicCast<JSReadableStream*>(getSlotFromObject(exec, exec->callee(), "ReadableStream"));
 75 ASSERT(jsReadableStream);
 76 return jsReadableStream;
 77}
 78
 79inline static JSValue getPropertyFromObject(ExecState* exec, JSObject* object, const char* identifier)
 80{
 81 return object->get(exec, Identifier(exec, identifier));
 82}
 83
 84JSValue JSReadableStreamSource::callFunction(ExecState* exec, JSValue jsFunction, const ArgList& arguments, JSValue thisValue)
 85{
 86 JSLockHolder lock(exec);
 87
 88 CallData callData;
 89 CallType callType = getCallData(jsFunction, callData);
 90
 91 JSValue exception;
 92
 93 JSValue value = call(exec, jsFunction, callType, callData, thisValue.isUndefined() ? m_readableStream : thisValue, arguments, &exception);
 94
 95 if (exception) {
 96 m_error = exception;
 97 return value;
 98 }
 99
 100 if (callType == CallTypeNone) {
 101 m_error = createError(exec, ASCIILiteral("Abrupt call."));
 102 return value;
 103 }
 104
 105 return value;
 106}
 107
 108static void errorFromValueReadableStream(ExecState* exec, JSValue error)
 109{
 110 ASSERT(!error.isUndefined());
 111
 112 JSReadableStream* jsReadableStream = getJSReadableStream(exec);
 113
 114 String errorDescription = error.toString(exec)->value(exec);
 115 static_cast<JSReadableStreamSource*>(jsReadableStream->impl().source())->setError(error);
 116
 117 jsReadableStream->impl().setError(errorDescription);
 118 jsReadableStream->impl().createReadableStreamErrorFunction();
 119}
 120
 121JSReadableStreamSource::JSReadableStreamSource(JSC::ExecState* exec)
 122 : m_readableStream(nullptr)
 123 , m_error(jsUndefined())
 124{
 125 m_startFunction.set(exec->vm(), jsUndefined());
 126 m_pullFunction.set(exec->vm(), jsUndefined());
 127 m_cancelFunction.set(exec->vm(), jsUndefined());
 128 m_strategy.set(exec->vm(), jsUndefined());
 129
 130 if (!exec->argumentCount())
 131 return;
 132
 133 if (!exec->argument(0).isObject()) {
 134 m_error = createTypeError(exec, ASCIILiteral("ReadableStream constructor should get an object as argument."));
 135 return;
 136 }
 137
 138 JSValue argumentValue = exec->argument(0);
 139 JSObject* argument = argumentValue.getObject();
 140
 141 JSValue startFunction = getPropertyFromObject(exec, argument, "start");
 142 if (!startFunction.isUndefined() && !startFunction.isFunction()) {
 143 m_error = createTypeError(exec, ASCIILiteral("ReadableStream constructor object start property should be functions."));
 144 return;
 145 }
 146
 147 JSValue pullFunction = getPropertyFromObject(exec, argument, "pull");
 148 if (!pullFunction.isUndefined() && !pullFunction.isFunction()) {
 149 m_error = createTypeError(exec, ASCIILiteral("ReadableStream constructor object pull property should be functions."));
 150 return;
 151 }
 152
 153 JSValue cancelFunction = getPropertyFromObject(exec, argument, "cancel");
 154 if (!cancelFunction.isUndefined() && !cancelFunction.isFunction()) {
 155 m_error = createTypeError(exec, ASCIILiteral("ReadableStream constructor object cancel property should be functions."));
 156 return;
 157 }
 158
 159 JSValue strategy = getPropertyFromObject(exec, argument, "strategy");
 160 if (!strategy.isUndefined() && !strategy.isObject()) {
 161 m_error = createTypeError(exec, ASCIILiteral("ReadableStream constructor strategy should be an object."));
 162 return;
 163 }
 164
 165 m_startFunction.set(exec->vm(), startFunction);
 166 m_pullFunction.set(exec->vm(), pullFunction);
 167 m_cancelFunction.set(exec->vm(), cancelFunction);
 168 m_strategy.set(exec->vm(), strategy);
 169}
 170
 171unsigned JSReadableStreamSource::chunkSize(ExecState* exec, JSValue chunk)
 172{
 173 // If we do not have a stored strategy, we return 1 as default.
 174 if (!m_strategy.get().isObject())
 175 return 1;
 176
 177 JSValue sizeFunction = m_strategy.get().getObject()->get(exec, Identifier(exec, "size"));
 178
 179 if (!sizeFunction.isFunction()) {
 180 m_error = createError(exec, ASCIILiteral("No chunk size JS callback"));
 181 return 0;
 182 }
 183
 184 MarkedArgumentBuffer arguments;
 185 arguments.append(chunk);
 186 JSValue sizeValue = callFunction(exec, sizeFunction, arguments, m_strategy.get());
 187
 188 if (!m_error.isUndefined())
 189 return 0;
 190
 191 int32_t value = sizeValue.toInt32(exec);
 192 if (value < 0) {
 193 m_error = createError(exec, ASCIILiteral("Incorrect value."));
 194 return 0;
 195 }
 196 return value;
 197}
 198
 199static EncodedJSValue JSC_HOST_CALL enqueueReadableStreamFunction(ExecState* exec)
 200{
 201 JSReadableStream* jsReadableStream = getJSReadableStream(exec);
 202 JSReadableStreamSource* source = static_cast<JSReadableStreamSource*>(jsReadableStream->impl().source());
 203
 204 if (!source)
 205 return throwVMError(exec, createTypeError(exec, ASCIILiteral("Unable to enqueue.")));
 206
 207 String errorDescription;
 208 if (!jsReadableStream->impl().canEnqueue(errorDescription))
 209 return throwVMError(exec, createTypeError(exec, errorDescription));
 210
 211 JSValue chunk = exec->argument(0);
 212
 213 unsigned chunkSize = source->chunkSize(exec, chunk);
 214 JSValue sourceError = source->error();
 215 if (!sourceError.isUndefined())
 216 return throwVMError(exec, sourceError);
 217
 218 source->enqueue(chunk);
 219 bool shouldApplyBackpressure = jsReadableStream->impl().enqueue(nullptr, 0, chunkSize);
 220
 221 return JSValue::encode(jsBoolean(!shouldApplyBackpressure));
 222}
 223
 224static JSFunction* createReadableStreamEnqueueFunction(ExecState* exec)
 225{
 226 return JSFunction::create(exec->vm(), exec->callee()->globalObject(), 1, ASCIILiteral("CreateReadableStreamEnqueueFunction"), enqueueReadableStreamFunction);
 227}
 228
 229static EncodedJSValue JSC_HOST_CALL closeReadableStreamFunction(ExecState* exec)
 230{
 231 JSReadableStream* jsReadableStream = getJSReadableStream(exec);
 232 jsReadableStream->impl().createReadableStreamCloseFunction();
 233 return JSValue::encode(jsUndefined());
 234}
 235
 236static JSFunction* createReadableStreamCloseFunction(ExecState* exec)
 237{
 238 return JSFunction::create(exec->vm(), exec->callee()->globalObject(), 0, ASCIILiteral("CreateReadableStreamCloseFunction"), closeReadableStreamFunction);
 239}
 240
 241static EncodedJSValue JSC_HOST_CALL errorReadableStreamFunction(ExecState* exec)
 242{
 243 JSValue error = exec->argumentCount() ? exec->argument(0) : createError(exec, ASCIILiteral("Error function called."));
 244
 245 errorFromValueReadableStream(exec, error);
 246
 247 return JSValue::encode(jsUndefined());
 248}
 249
 250static JSFunction* createReadableStreamErrorFunction(ExecState* exec)
 251{
 252 return JSFunction::create(exec->vm(), exec->callee()->globalObject(), 1, ASCIILiteral("CreateReadableStreamErrorFunction"), errorReadableStreamFunction);
 253}
 254
 255void JSReadableStreamSource::setStream(ExecState* exec, JSReadableStream* readableStream)
 256{
 257 m_readableStream = readableStream;
 258
 259 JSValue enqueueFunction = createReadableStreamEnqueueFunction(exec);
 260 JSValue closeFunction = createReadableStreamCloseFunction(exec);
 261 JSValue errorFunction = createReadableStreamErrorFunction(exec);
 262
 263 m_enqueueFunction.set(exec->vm(), enqueueFunction);
 264 m_closeFunction.set(exec->vm(), closeFunction);
 265 m_errorFunction.set(exec->vm(), errorFunction);
 266
 267 JSValue streamValue = m_readableStream;
 268 setSlotToObject(exec, m_enqueueFunction.get(), "ReadableStream", streamValue);
 269 setSlotToObject(exec, m_closeFunction.get(), "ReadableStream", streamValue);
 270 setSlotToObject(exec, m_errorFunction.get(), "ReadableStream", streamValue);
 271}
 272
 273PassRefPtr<ReadableStreamSource> JSReadableStreamSource::create(JSC::ExecState* exec)
 274{
 275 return (RefPtr<ReadableStreamSource>(adoptRef(new JSReadableStreamSource(exec)))).release();
 276}
 277
 278static EncodedJSValue JSC_HOST_CALL cancelResultFulfilled(ExecState* exec)
 279{
 280 getJSReadableStream(exec)->impl().notifyCancel();
 281 return JSValue::encode(jsUndefined());
 282}
 283
 284static JSFunction* createCancelResultFulfilledFunction(ExecState* exec)
 285{
 286 return JSFunction::create(exec->vm(), exec->callee()->globalObject(), 1, ASCIILiteral("CancelResultFulfilledFunction"), cancelResultFulfilled);
 287}
 288
 289static EncodedJSValue JSC_HOST_CALL cancelResultRejected(ExecState* exec)
 290{
 291 JSReadableStream* jsReadableStream = getJSReadableStream(exec);
 292 jsReadableStream->impl().setError(ASCIILiteral("Cancel promise rejected."));
 293 jsReadableStream->impl().notifyCancel();
 294 return JSValue::encode(jsUndefined());
 295}
 296
 297static JSFunction* createCancelResultRejectedFunction(ExecState* exec)
 298{
 299 return JSFunction::create(exec->vm(), exec->callee()->globalObject(), 1, ASCIILiteral("CancelResultRejectedFunction"), cancelResultRejected);
 300}
 301
 302void JSReadableStreamSource::pull()
 303{
 304 // If we do not have a pull function stored, we do nothing as default.
 305 if (m_pullFunction.get().isUndefined())
 306 return;
 307
 308 MarkedArgumentBuffer arguments;
 309 arguments.append(m_enqueueFunction.get());
 310 arguments.append(m_closeFunction.get());
 311 arguments.append(m_errorFunction.get());
 312
 313 ExecState* exec = m_readableStream->globalObject()->globalExec();
 314 callFunction(exec, m_pullFunction.get(), arguments);
 315}
 316
 317bool JSReadableStreamSource::cancel(const String& errorReason)
 318{
 319 // If we do not have a cancel function stored, we do nothing as default.
 320 if (m_cancelFunction.get().isUndefined())
 321 return true;
 322
 323 ExecState* exec = m_readableStream->globalObject()->globalExec();
 324
 325 JSValue cancelResultFulfilledFunction = createCancelResultFulfilledFunction(exec);
 326 setSlotToObject(exec, cancelResultFulfilledFunction, "ReadableStream", m_readableStream);
 327 JSValue cancelResultRejectedFunction = createCancelResultRejectedFunction(exec);
 328 setSlotToObject(exec, cancelResultRejectedFunction, "ReadableStream", m_readableStream);
 329
 330 MarkedArgumentBuffer arguments;
 331 arguments.append(jsString(exec, errorReason));
 332
 333 JSValue result = callFunction(exec, m_cancelFunction.get(), arguments);
 334
 335 if (!m_error.isUndefined()) {
 336 // FIXME: We should reject the cancel promise with m_error.
 337 m_readableStream->impl().setError(ASCIILiteral("Cancel callback exception."));
 338 return true;
 339 }
 340
 341 if (result.isUndefined())
 342 return true;
 343
 344 if (!resolvePromise(exec, result, cancelResultFulfilledFunction, cancelResultRejectedFunction)) {
 345 m_readableStream->impl().setError(ASCIILiteral("Cancel promise resolution failed."));
 346 return true;
 347 }
 348
 349 return false;
 350}
 351
 352bool JSReadableStreamSource::shouldApplyBackpressure(unsigned queueSize)
 353{
 354 // Apply default strategy.
 355 if (!m_strategy.get().isObject())
 356 return queueSize > 1;
 357
 358 ExecState* exec = m_readableStream->globalObject()->globalExec();
 359 JSValue shouldApplyBackpressureFunction = getPropertyFromObject(exec, m_strategy.get().getObject(), "shouldApplyBackpressure");
 360
 361 if (!shouldApplyBackpressureFunction.isFunction()) {
 362 m_error = createError(exec, ASCIILiteral("No back pressure JS callback."));
 363 return true;
 364 }
 365
 366 MarkedArgumentBuffer arguments;
 367 arguments.append(jsNumber(queueSize));
 368 JSValue shouldApplyBackpressure = callFunction(exec, shouldApplyBackpressureFunction, arguments, m_strategy.get());
 369
 370 if (!m_error.isUndefined())
 371 return false;
 372
 373 return shouldApplyBackpressure.toBoolean(exec);
 374}
 375
 376static EncodedJSValue JSC_HOST_CALL startResultFulfilled(ExecState* exec)
 377{
 378 JSReadableStream* jsReadableStream = getJSReadableStream(exec);
 379 jsReadableStream->impl().start();
 380 return JSValue::encode(jsUndefined());
 381}
 382
 383static JSFunction* createStartResultFulfilledFunction(ExecState* exec)
 384{
 385 return JSFunction::create(exec->vm(), exec->callee()->globalObject(), 1, ASCIILiteral("CreateStartResultFulfilledFunction"), startResultFulfilled);
 386}
 387
 388static EncodedJSValue JSC_HOST_CALL startResultRejected(ExecState* exec)
 389{
 390 JSReadableStream* jsReadableStream = getJSReadableStream(exec);
 391 jsReadableStream->impl().setError(ASCIILiteral("Start promise rejected."));
 392 jsReadableStream->impl().createReadableStreamErrorFunction();
 393 return JSValue::encode(jsUndefined());
 394}
 395
 396static JSFunction* createStartResultRejectedFunction(ExecState* exec)
 397{
 398 return JSFunction::create(exec->vm(), exec->callee()->globalObject(), 1, ASCIILiteral("CreateStartResultRejectedFunction"), startResultRejected);
 399}
 400
 401void JSReadableStreamSource::start()
 402{
 403 // No-op function?
 404 if (m_startFunction.get().isUndefined()) {
 405 // Resolve the promise asynchronously.
 406 callOnMainThread([this] {
 407 m_readableStream->impl().start();
 408 });
 409 return;
 410 }
 411
 412 ExecState* exec = m_readableStream->globalObject()->globalExec();
 413
 414 MarkedArgumentBuffer arguments;
 415 arguments.append(m_enqueueFunction.get());
 416 arguments.append(m_closeFunction.get());
 417 arguments.append(m_errorFunction.get());
 418
 419 JSValue startResultFulfilledFunction = createStartResultFulfilledFunction(exec);
 420 setSlotToObject(exec, startResultFulfilledFunction, "ReadableStream", m_readableStream);
 421 JSValue startResultRejectedFunction = createStartResultRejectedFunction(exec);
 422 setSlotToObject(exec, startResultRejectedFunction, "ReadableStream", m_readableStream);
 423
 424 JSValue result = callFunction(exec, m_startFunction.get(), arguments);
 425
 426 if (!m_error.isUndefined())
 427 return;
 428
 429 if (result.isUndefined()) {
 430 // Resolve the promise asynchronously.
 431 callOnMainThread([this] {
 432 m_readableStream->impl().start();
 433 });
 434 return;
 435 }
 436
 437 if (!resolvePromise(exec, result, startResultFulfilledFunction, startResultRejectedFunction))
 438 m_error = createError(exec, ASCIILiteral("Start promise resolution failed."));
 439}
 440
 441
 442void JSReadableStreamSource::enqueue(JSValue value)
 443{
 444 ExecState* exec = m_readableStream->globalObject()->globalExec();
 445 m_jsChunkQueue.insert(0, JSC::Strong<JSC::Unknown>(exec->vm(), value));
 446}
 447
 448JSValue JSReadableStreamSource::read()
 449{
 450 return m_jsChunkQueue.takeLast().get();
 451}
 452
 453} // namespace WebCore
 454
 455#endif

Source/WebCore/bindings/js/JSReadableStreamSource.h

 1/*
 2 * Copyright (C) 2O15 Canon Inc. 2015
 3 * Copyright (C) 2015 Igalia S.L. 2015
 4 *
 5 * Redistribution and use in source and binary forms, with or without
 6 * modification, are permitted, provided that the following conditions
 7 * are required to be met:
 8 *
 9 * 1. Redistributions of source code must retain the above copyright
 10 * notice, this list of conditions and the following disclaimer.
 11 * 2. Redistributions in binary form must reproduce the above copyright
 12 * notice, this list of conditions and the following disclaimer in the
 13 * documentation and/or other materials provided with the distribution.
 14 * 3. Neither the name of Canon Inc. nor the names of
 15 * its contributors may be used to endorse or promote products derived
 16 * from this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY CANON INC. AND ITS CONTRIBUTORS "AS IS" AND ANY
 19 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 20 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 21 * DISCLAIMED. IN NO EVENT SHALL CANON INC. AND ITS CONTRIBUTORS BE LIABLE FOR
 22 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 28 */
 29
 30#ifndef JSReadableStreamSource_h
 31#define JSReadableStreamSource_h
 32
 33#if ENABLE(STREAMS_API)
 34
 35#include "ExceptionCode.h"
 36#include "JSDOMBinding.h"
 37#include "ReadableStreamSource.h"
 38#include <heap/Strong.h>
 39#include <heap/StrongInlines.h>
 40#include <runtime/JSCJSValue.h>
 41#include <runtime/JSFunction.h>
 42#include <wtf/PassRefPtr.h>
 43#include <wtf/Vector.h>
 44#include <wtf/text/WTFString.h>
 45
 46namespace WebCore {
 47
 48class JSReadableStream;
 49
 50class JSReadableStreamSource: public ReadableStreamSource {
 51
 52public:
 53
 54 static PassRefPtr<ReadableStreamSource> create(JSC::ExecState*);
 55 ~JSReadableStreamSource() { }
 56
 57 void setStream(JSC::ExecState*, JSReadableStream*);
 58
 59 // ReadableStreamSource API.
 60 void pull();
 61 bool cancel(const String&);
 62 bool shouldApplyBackpressure(unsigned);
 63 void start();
 64
 65 JSC::JSValue error() { return m_error; }
 66 void setError(JSC::JSValue error) { m_error = error; }
 67
 68 unsigned chunkSize(JSC::ExecState*, JSC::JSValue);
 69
 70 void enqueue(JSC::JSValue);
 71 JSC::JSValue read();
 72
 73 virtual bool hadError() { return !m_error.isUndefined(); }
 74
 75private:
 76
 77 JSReadableStreamSource(JSC::ExecState*);
 78 JSC::JSValue callFunction(JSC::ExecState*, JSC::JSValue, const JSC::ArgList&, JSC::JSValue thisValue = JSC::jsUndefined());
 79
 80 JSReadableStream* m_readableStream;
 81
 82 JSC::JSValue m_error;
 83
 84 JSC::Strong<JSC::Unknown> m_cancelFunction;
 85 JSC::Strong<JSC::Unknown> m_startFunction;
 86 JSC::Strong<JSC::Unknown> m_pullFunction;
 87
 88 JSC::Strong<JSC::Unknown> m_strategy;
 89
 90 JSC::Strong<JSC::Unknown> m_enqueueFunction;
 91 JSC::Strong<JSC::Unknown> m_closeFunction;
 92 JSC::Strong<JSC::Unknown> m_errorFunction;
 93
 94 Vector<JSC::Strong<JSC::Unknown>> m_jsChunkQueue;
 95};
 96
 97} // namespace WebCore
 98
 99#endif // ENABLE(STREAMS_API)
 100
 101#endif // JSReadableStreamSource_h

Source/WebKit/mac/Configurations/FeatureDefines.xcconfig

@@ENABLE_RESOLUTION_MEDIA_QUERY = ;
165165ENABLE_RUBBER_BANDING[sdk=macosx*] = ENABLE_RUBBER_BANDING;
166166ENABLE_CSS_SCROLL_SNAP = ENABLE_CSS_SCROLL_SNAP;
167167ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 168ENABLE_STREAMS_API = ENABLE_STREAMS_API;
168169ENABLE_SUBTLE_CRYPTO[sdk=iphone*] = ENABLE_SUBTLE_CRYPTO;
169170ENABLE_SUBTLE_CRYPTO[sdk=macosx*] = $(ENABLE_SUBTLE_CRYPTO_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
170171ENABLE_SUBTLE_CRYPTO_macosx_1080 = ;

@@ENABLE_LLINT_C_LOOP = ;
226227
227228ENABLE_SATURATED_LAYOUT_ARITHMETIC = ENABLE_SATURATED_LAYOUT_ARITHMETIC;
228229
229 FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_ES6_CLASS_SYNTAX) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RUBBER_BANDING) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_OTF_CONVERTER) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(ENABLE_SATURATED_LAYOUT_ARITHMETIC) $(ENABLE_VIDEO_PRESENTATION_MODE);
 230FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_ES6_CLASS_SYNTAX) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RUBBER_BANDING) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_OTF_CONVERTER) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(ENABLE_SATURATED_LAYOUT_ARITHMETIC) $(ENABLE_VIDEO_PRESENTATION_MODE);

Source/WebKit2/CMakeLists.txt

@@set(WebKit2_INCLUDE_DIRECTORIES
7373 "${WEBCORE_DIR}/Modules/mediastream"
7474 "${WEBCORE_DIR}/Modules/networkinfo"
7575 "${WEBCORE_DIR}/Modules/notifications"
 76 "${WEBCORE_DIR}/Modules/streams"
7677 "${WEBCORE_DIR}/Modules/vibration"
7778 "${WEBCORE_DIR}/Modules/webdatabase"
7879 "${WEBCORE_DIR}/accessibility"

Source/WebKit2/Configurations/FeatureDefines.xcconfig

@@ENABLE_RESOLUTION_MEDIA_QUERY = ;
165165ENABLE_RUBBER_BANDING[sdk=macosx*] = ENABLE_RUBBER_BANDING;
166166ENABLE_CSS_SCROLL_SNAP = ENABLE_CSS_SCROLL_SNAP;
167167ENABLE_SPEECH_SYNTHESIS = ENABLE_SPEECH_SYNTHESIS;
 168ENABLE_STREAMS_API = ENABLE_STREAMS_API;
168169ENABLE_SUBTLE_CRYPTO[sdk=iphone*] = ENABLE_SUBTLE_CRYPTO;
169170ENABLE_SUBTLE_CRYPTO[sdk=macosx*] = $(ENABLE_SUBTLE_CRYPTO_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
170171ENABLE_SUBTLE_CRYPTO_macosx_1080 = ;

@@ENABLE_LLINT_C_LOOP = ;
226227
227228ENABLE_SATURATED_LAYOUT_ARITHMETIC = ENABLE_SATURATED_LAYOUT_ARITHMETIC;
228229
229 FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_ES6_CLASS_SYNTAX) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RUBBER_BANDING) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_OTF_CONVERTER) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(ENABLE_SATURATED_LAYOUT_ARITHMETIC) $(ENABLE_VIDEO_PRESENTATION_MODE);
 230FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CANVAS_PATH) $(ENABLE_CANVAS_PROXY) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_ES6_CLASS_SYNTAX) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_GRID_LAYOUT) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_SHAPES) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS3_TEXT_LINE_BREAK) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM4_EVENTS_CONSTRUCTOR) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_ENCRYPTED_MEDIA_V2) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FONT_LOAD_EVENTS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GAMEPAD_DEPRECATED) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_ICONDATABASE) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INDIE_UI) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_COLOR_POPOVER) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_IOS_AIRPLAY) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TEXT_AUTOSIZING) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LETTERPRESS) $(ENABLE_LINK_PREFETCH) $(ENABLE_MATHML) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NAVIGATOR_HWCONCURRENCY) $(ENABLE_NOTIFICATIONS) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PROMISES) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_REQUEST_AUTOCOMPLETE) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RUBBER_BANDING) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SUBTLE_CRYPTO) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_OTF_CONVERTER) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_DATACUE_VALUE) $(ENABLE_VIEW_MODE_CSS_MEDIA) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_REPLAY) $(ENABLE_WEB_SOCKETS) $(ENABLE_PICTURE_SIZES) $(ENABLE_WEB_TIMING) $(ENABLE_WEBVTT_REGIONS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT) $(ENABLE_FTL_JIT) $(ENABLE_LLINT_C_LOOP) $(ENABLE_SATURATED_LAYOUT_ARITHMETIC) $(ENABLE_VIDEO_PRESENTATION_MODE);

Source/cmake/WebKitFeatures.cmake

@@macro(WEBKIT_OPTION_BEGIN)
123123 WEBKIT_OPTION_DEFINE(ENABLE_SERVICE_CONTROLS "Toggle service controls support" OFF)
124124 WEBKIT_OPTION_DEFINE(ENABLE_SPEECH_SYNTHESIS "Toggle Speech Synthesis API support)" OFF)
125125 WEBKIT_OPTION_DEFINE(ENABLE_SPELLCHECK "Toggle Spellchecking support (requires Enchant)" OFF)
 126 WEBKIT_OPTION_DEFINE(ENABLE_STREAMS_API "Toggle Streams API support" ON)
126127 WEBKIT_OPTION_DEFINE(ENABLE_SUBTLE_CRYPTO "Toggle subtle crypto support" OFF)
127128 WEBKIT_OPTION_DEFINE(ENABLE_SVG_FONTS "Toggle SVG fonts support (imples SVG support)" ON)
128129 WEBKIT_OPTION_DEFINE(ENABLE_TELEPHONE_NUMBER_DETECTION "Toggle telephone number detection support" OFF)

Source/cmakeconfig.h.cmake

111111#cmakedefine01 ENABLE_SATURATED_LAYOUT_ARITHMETIC
112112#cmakedefine01 ENABLE_SMOOTH_SCROLLING
113113#cmakedefine01 ENABLE_SPELLCHECK
 114#cmakedefine01 ENABLE_STREAMS_API
114115#cmakedefine01 ENABLE_SUBTLE_CRYPTO
115116#cmakedefine01 ENABLE_SVG_FONTS
116117#cmakedefine01 ENABLE_TELEPHONE_NUMBER_DETECTION

Tools/ChangeLog

 12015-01-26 Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
 2
 3 [Streams API] Implement ReadableStream
 4 https://bugs.webkit.org/show_bug.cgi?id=138967
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * Scripts/webkitperl/FeatureList.pm: Added streams-api compilation switch.
 9
1102015-01-26 Michael Catanzaro <mcatanzaro@igalia.com> and Carlos Garcia Campos <cgarcia@igalia.com>
211
312 [GTK] gtkdoc does not appear in DevHelp

Tools/Scripts/webkitperl/FeatureList.pm

@@my (
117117 $resourceTimingSupport,
118118 $scriptedSpeechSupport,
119119 $seccompFiltersSupport,
 120 $streamsAPISupport,
120121 $styleScopedSupport,
121122 $subtleCrypto,
122123 $suidLinuxSandbox,

@@my @features = (
360361 { option => "scripted-speech", desc => "Toggle Scripted Speech support",
361362 define => "ENABLE_SCRIPTED_SPEECH", default => 0, value => \$scriptedSpeechSupport },
362363
 364 { option => "streams-api", desc => "Toggle Streams API support",
 365 define => "ENABLE_STREAMS_API", default => 1, value => \$streamsAPISupport },
 366
363367 { option => "subtle-crypto", desc => "Toggle WebCrypto Subtle-Crypto support",
364368 define => "ENABLE_SUBTLE_CRYPTO", default => (isGtk() || isEfl() || isAppleMacWebKit() || isIOSWebKit()), value => \$subtleCrypto },
365369

LayoutTests/ChangeLog

 12015-01-26 Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
 2
 3 [Streams API] Implement ReadableStream
 4 https://bugs.webkit.org/show_bug.cgi?id=138967
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * fast/streams/readablestreams-api-cancel-error-expected.txt: Added.
 9 * fast/streams/readablestreams-api-cancel-error.html: Added.
 10 * fast/streams/readablestreams-api-cancel-expected.txt: Added.
 11 * fast/streams/readablestreams-api-cancel-infinite-stream-expected.txt: Added.
 12 * fast/streams/readablestreams-api-cancel-infinite-stream.html: Added.
 13 * fast/streams/readablestreams-api-cancel-no-chunks-expected.txt: Added.
 14 * fast/streams/readablestreams-api-cancel-no-chunks.html: Added.
 15 * fast/streams/readablestreams-api-cancel-promise-expected.txt: Added.
 16 * fast/streams/readablestreams-api-cancel-promise.html: Added.
 17 * fast/streams/readablestreams-api-cancel-throw-exception-expected.txt: Added.
 18 * fast/streams/readablestreams-api-cancel-throw-exception.html: Added.
 19 * fast/streams/readablestreams-api-cancel.html: Added.
 20 * fast/streams/readablestreams-api-count-queueing-strategy-expected.txt: Added.
 21 * fast/streams/readablestreams-api-count-queueing-strategy.html: Added.
 22 * fast/streams/readablestreams-api-pull-close-expected.txt: Added.
 23 * fast/streams/readablestreams-api-pull-close.html: Added.
 24 * fast/streams/readablestreams-api-pull-expected.txt: Added.
 25 * fast/streams/readablestreams-api-pull.html: Added.
 26 * fast/streams/readablestreams-api-read-errored-stream-expected.txt: Added.
 27 * fast/streams/readablestreams-api-read-errored-stream.html: Added.
 28 * fast/streams/readablestreams-api-start-expected.txt: Added.
 29 * fast/streams/readablestreams-api-start-promise-expected.txt: Added.
 30 * fast/streams/readablestreams-api-start-promise.html: Added.
 31 * fast/streams/readablestreams-api-start-throws-expected.txt: Added.
 32 * fast/streams/readablestreams-api-start-throws.html: Added.
 33 * fast/streams/readablestreams-api-start.html: Added.
 34 * fast/streams/readablestreams-api-wrong-arguments-expected.txt: Added.
 35 * fast/streams/readablestreams-api-wrong-arguments.html: Added.
 36 * fast/streams/resources/streams-utils.js: Added.
 37 (RandomPushSource): Class to create a random push source.
 38 (RandomPushSource.prototype.readStart.writeChunk): Writes a chunk
 39 to the stream.
 40 (RandomPushSource.prototype.readStart): Manages that the source
 41 begins to produce chunks.
 42 (RandomPushSource.prototype.readStop): Stops the source from
 43 producing chunks.
 44 (randomChunk): Provides a random chunk of a given size.
 45 (readableStreamToArray.pump): Pumps the stream while it is
 46 readable and waits until is readable again.
 47 (readableStreamToArray): Helper to read up a whole stream.
 48 (SequentialPullSource): Class to create a sequential pull source.
 49 (SequentialPullSource.prototype.open): Opens the stream and calls
 50 the callback.
 51 (SequentialPullSource.prototype.read): Provides data if the limits
 52 was not reached yet.
 53 (SequentialPullSource.prototype.close): Close the stream and calls
 54 the callback
 55 * js/dom/global-constructors-attributes-expected.txt:
 56 * platform/efl/js/dom/global-constructors-attributes-expected.txt:
 57 * platform/gtk/js/dom/global-constructors-attributes-expected.txt:
 58 * platform/ios-sim-deprecated/js/dom/global-constructors-attributes-expected.txt:
 59 * platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
 60 * platform/mac-mountainlion/js/dom/global-constructors-attributes-expected.txt:
 61 * platform/mac/js/dom/global-constructors-attributes-expected.txt:
 62 * platform/win/js/dom/global-constructors-attributes-expected.txt:
 63 Adds the readable stream attributes to the expectations.
 64 * fast/xmlhttprequest/xmlhttprequest-responsetype-sync-request-expected.txt:
 65 * js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt:
 66 New baseline because of console messages.
 67 * resources/js-test-pre.js:
 68 (shouldBeGreaterThan): Helper to check if a something is strictly
 69 bigger than something else.
 70
1712015-01-26 Commit Queue <commit-queue@webkit.org>
272
373 Unreviewed, rolling out r179107.

LayoutTests/fast/streams/readablestreams-api-cancel-error-expected.txt

 1ReadableStream cancel should reject promise when in error state.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS state: errored
 7PASS received test
 8PASS successfullyParsed is true
 9
 10TEST COMPLETE
 11

LayoutTests/fast/streams/readablestreams-api-cancel-error.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5if (window.testRunner) {
 6 testRunner.dumpAsText()
 7 testRunner.waitUntilDone()
 8}
 9window.jsTestIsAsync = true;
 10
 11description('ReadableStream cancel should reject promise when in error state.')
 12
 13try {
 14
 15var potato = new ReadableStream({ start : function(enqueue, close, error) { error("test"); } } )
 16
 17testPassed("state: " + potato.state)
 18potato.cancel("test").then(
 19 function() {
 20 testFailed("received cancel fulfillment")
 21 finishJSTest()
 22}, function(e) {
 23 testPassed("received " + e)
 24 finishJSTest()
 25})
 26
 27} catch(e) {
 28 testFailed("received " + e)
 29 finishJSTest()
 30}
 31
 32</script>
 33<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-cancel-expected.txt

 1ReadableStream cancel should fullfil promise when cancel callback went fine.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS got cancel reason: test
 7PASS received cancel fulfillment
 8PASS successfullyParsed is true
 9
 10TEST COMPLETE
 11

LayoutTests/fast/streams/readablestreams-api-cancel-infinite-stream-expected.txt

 1ReadableStream cancel should fullfil promise when cancel callback went fine.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS rs.state is "closed"
 7PASS cancelationFinished is false
 8PASS storage.length is > 0
 9PASS chunkLengthRight is true
 10PASS successfullyParsed is true
 11
 12TEST COMPLETE
 13

LayoutTests/fast/streams/readablestreams-api-cancel-infinite-stream.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script src="resources/streams-utils.js"></script>
 4<script>
 5
 6if (window.testRunner) {
 7 testRunner.dumpAsText()
 8 testRunner.waitUntilDone()
 9}
 10window.jsTestIsAsync = true;
 11
 12description('ReadableStream cancel should fullfil promise when cancel callback went fine.')
 13
 14randomSource = new RandomPushSource();
 15
 16cancelationFinished = false;
 17chunkLengthRight = true;
 18
 19rs = new ReadableStream({
 20 start: function(enqueue, close, error) {
 21 randomSource.ondata = enqueue;
 22 randomSource.onend = close;
 23 randomSource.onerror = error;
 24 },
 25
 26 pull: function() {
 27 randomSource.readStart();
 28 },
 29
 30 cancel: function() {
 31 randomSource.readStop();
 32 randomSource.onend();
 33
 34 return new Promise(function(resolve) {
 35 setTimeout(function() {
 36 cancelationFinished = true;
 37 resolve();
 38 }, 50)
 39 });
 40 }
 41});
 42
 43readableStreamToArray(rs).then(
 44 function(chunks) {
 45 storage = chunks;
 46 shouldBeEqualToString('rs.state', 'closed'); // Stream should be closed.
 47 shouldBeFalse('cancelationFinished'); // It did not wait for the cancellation process to finish before closing.
 48 shouldBeGreaterThan('storage.length', '0'); // Should have gotten some data written through the pipe.
 49 for (var i = 0; i < storage.length && chunkLengthRight; i++) {
 50 if (storage[i].length != 128) // Each chunk has 128 bytes.
 51 chunkLengthRight = false;
 52 }
 53 shouldBeTrue('chunkLengthRight');
 54 finishJSTest();
 55 },
 56 function() {
 57 testFailed('The stream should be successfully read to the end');
 58 finishJSTest();
 59 }
 60);
 61
 62setTimeout(function() {
 63 rs.cancel().then(function() {
 64 shouldBeTrue('cancelationFinished'); // It returns a promise that is fulfilled when the cancellation finishes.
 65 finishJSTest();
 66 },
 67 function() {
 68 testFailed('Stream cancellation should not fail');
 69 finishJSTest();
 70 });
 71}, 150);
 72
 73</script>
 74<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-cancel-no-chunks-expected.txt

 1ReadableStream cancel should fulfill promise when cancel before queueing chunk.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS rs.state is "closed"
 7PASS ready promise vended before the cancellation should fulfill
 8PASS closed promise vended before the cancellation should fulfill
 9PASS closed promise vended after the cancellation should fulfill
 10PASS ready promise vended after the cancellation should fulfill
 11PASS successfullyParsed is true
 12
 13TEST COMPLETE
 14

LayoutTests/fast/streams/readablestreams-api-cancel-no-chunks.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script src="resources/streams-utils.js"></script>
 4<script>
 5
 6if (window.testRunner) {
 7 testRunner.dumpAsText()
 8 testRunner.waitUntilDone()
 9}
 10window.jsTestIsAsync = true;
 11
 12description('ReadableStream cancel should fulfill promise when cancel before queueing chunk.')
 13
 14rs = sequentialReadableStream(5);
 15
 16rs.closed.then(
 17 function() {
 18 testPassed('closed promise vended before the cancellation should fulfill');
 19 },
 20 function() {
 21 testFailed('closed promise vended before the cancellation should not be rejected');
 22 finishJSTest();
 23 }
 24 );
 25
 26rs.ready.then(
 27 function() {
 28 testPassed('ready promise vended before the cancellation should fulfill');
 29 },
 30 function() {
 31 testFailed('ready promise vended before the cancellation should not be rejected');
 32 finishJSTest();
 33 }
 34);
 35
 36rs.cancel();
 37
 38shouldBeEqualToString('rs.state', 'closed'); // State should be closed.
 39
 40rs.closed.then(
 41 function() {
 42 testPassed('closed promise vended after the cancellation should fulfill');
 43 },
 44 function() {
 45 testFailed('closed promise vended after the cancellation should not be rejected');
 46 finishJSTest();
 47 }
 48);
 49
 50rs.ready.then(
 51 function() {
 52 testPassed('ready promise vended after the cancellation should fulfill');
 53 finishJSTest();
 54 },
 55 function() {
 56 testFailed('ready promise vended after the cancellation should not be rejected');
 57 finishJSTest();
 58 }
 59);
 60
 61</script>
 62<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-cancel-promise-expected.txt

 1ReadableStream cancel should fullfil promise when cancel callback went fine after returning a promise.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS got cancel reason: test
 7PASS received cancel fulfillment
 8PASS successfullyParsed is true
 9
 10TEST COMPLETE
 11

LayoutTests/fast/streams/readablestreams-api-cancel-promise.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5if (window.testRunner) {
 6 testRunner.dumpAsText()
 7 testRunner.waitUntilDone()
 8}
 9window.jsTestIsAsync = true;
 10
 11description('ReadableStream cancel should fullfil promise when cancel callback went fine after returning a promise.')
 12
 13var potato = new ReadableStream({ cancel: function(error) {
 14 testPassed('got cancel reason: ' + error)
 15 return new Promise(function(resolve, reject) {
 16 setTimeout(function() { resolve() }, 50)
 17 })
 18 }})
 19
 20potato.cancel("test").then(
 21 function() {
 22 testPassed("received cancel fulfillment")
 23 finishJSTest()
 24}, function(e) {
 25 testFailed("FAILED: received " + e)
 26 finishJSTest()
 27})
 28
 29</script>
 30<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-cancel-throw-exception-expected.txt

 1ReadableStream cancel should reject promise when cancel callback raises an exception.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS received cancel rejection: Cancel callback exception.
 7PASS successfullyParsed is true
 8
 9TEST COMPLETE
 10

LayoutTests/fast/streams/readablestreams-api-cancel-throw-exception.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5if (window.testRunner) {
 6 testRunner.dumpAsText()
 7 testRunner.waitUntilDone()
 8}
 9window.jsTestIsAsync = true;
 10
 11description('ReadableStream cancel should reject promise when cancel callback raises an exception.')
 12
 13var potato = new ReadableStream({ cancel: function(error) { throw new Error(error) } })
 14
 15potato.cancel("test").then(
 16 function() {
 17 testFailed("FAILED: cancel should failed")
 18 finishJSTest()
 19 }, function(e) {
 20 testPassed("received cancel rejection: " + e)
 21 finishJSTest()
 22 })
 23
 24</script>
 25<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-cancel.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5if (window.testRunner) {
 6 testRunner.dumpAsText()
 7 testRunner.waitUntilDone()
 8}
 9window.jsTestIsAsync = true;
 10
 11description('ReadableStream cancel should fullfil promise when cancel callback went fine.')
 12
 13var potato = new ReadableStream({ cancel: function(error) { testPassed('got cancel reason: ' + error); } })
 14
 15potato.cancel("test").then(
 16 function() {
 17 testPassed("received cancel fulfillment")
 18 finishJSTest()
 19}, function(e) {
 20 testFailed("FAILED: received " + e)
 21 finishJSTest()
 22})
 23
 24</script>
 25<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-count-queueing-strategy-expected.txt

 1ReadableStream with a count queueing strategy.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS Testing with highWaterMark 0
 7PASS enqueue('a'); is false
 8PASS enqueue('b'); is false
 9PASS enqueue('c'); is false
 10PASS enqueue('d'); is false
 11PASS rs.read(); is "a"
 12PASS rs.read(); is "b"
 13PASS rs.read(); is "c"
 14PASS enqueue('e'); is false
 15PASS rs.read(); is "d"
 16PASS rs.read(); is "e"
 17PASS enqueue('f'); is false
 18PASS enqueue('g'); is false
 19PASS Testing with highWaterMark 1
 20PASS enqueue('a'); is true
 21PASS enqueue('b'); is false
 22PASS enqueue('c'); is false
 23PASS enqueue('d'); is false
 24PASS rs.read(); is "a"
 25PASS rs.read(); is "b"
 26PASS rs.read(); is "c"
 27PASS enqueue('e'); is false
 28PASS rs.read(); is "d"
 29PASS rs.read(); is "e"
 30PASS enqueue('f'); is true
 31PASS enqueue('g'); is false
 32PASS Testing with highWaterMark 4
 33PASS enqueue('a'); is true
 34PASS enqueue('b'); is true
 35PASS enqueue('c'); is true
 36PASS enqueue('d'); is true
 37PASS enqueue('e'); is false
 38PASS enqueue('f'); is false
 39PASS rs.read(); is "a"
 40PASS rs.read(); is "b"
 41PASS enqueue('g'); is false
 42PASS rs.read(); is "c"
 43PASS rs.read(); is "d"
 44PASS rs.read(); is "e"
 45PASS rs.read(); is "f"
 46PASS enqueue('h'); is true
 47PASS enqueue('i'); is true
 48PASS enqueue('j'); is true
 49PASS enqueue('k'); is false
 50PASS successfullyParsed is true
 51
 52TEST COMPLETE
 53

LayoutTests/fast/streams/readablestreams-api-count-queueing-strategy.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5function CountQueuingStrategy(highWaterMark) {
 6 highWaterMark = Number(highWaterMark);
 7
 8 this._highWaterMark = highWaterMark;
 9}
 10
 11CountQueuingStrategy.prototype = {
 12
 13 shouldApplyBackpressure: function(queueSize) {
 14 return queueSize > this._highWaterMark;
 15 },
 16 size: function(chunk) {
 17 return 1;
 18 },
 19}
 20
 21function createReadableStream(highWaterMark) {
 22 testPassed("Testing with highWaterMark " + highWaterMark);
 23
 24 enqueue = undefined;
 25 rs = new ReadableStream({
 26 start: function(enqueue_) { enqueue = enqueue_; },
 27 strategy: new CountQueuingStrategy(highWaterMark)
 28 });
 29}
 30
 31if (window.testRunner) {
 32 testRunner.dumpAsText()
 33}
 34
 35description('ReadableStream with a count queueing strategy.')
 36
 37function test0() {
 38 createReadableStream(0);
 39
 40 shouldBeFalse("enqueue('a');"); // 'After 0 reads, 1st enqueue should return false (queue now contains 1 chunk)');
 41 shouldBeFalse("enqueue('b');"); // 'After 0 reads, 2nd enqueue should return false (queue now contains 2 chunks)');
 42 shouldBeFalse("enqueue('c');"); // 'After 0 reads, 3rd enqueue should return false (queue now contains 3 chunks)');
 43 shouldBeFalse("enqueue('d');"); // 'After 0 reads, 4th enqueue should return false (queue now contains 4 chunks)');
 44
 45 shouldBeEqualToString("rs.read();", 'a'); // '1st read gives back the 1st chunk enqueued (queue now contains 3 chunks)');
 46 shouldBeEqualToString("rs.read();", 'b'); // '2nd read gives back the 2nd chunk enqueued (queue now contains 2 chunks)');
 47 shouldBeEqualToString("rs.read();", 'c'); // '3rd read gives back the 2nd chunk enqueued (queue now contains 1 chunk)');
 48
 49 shouldBeFalse("enqueue('e');"); // 'After 3 reads, 5th enqueue should return false (queue now contains 2 chunks)');
 50
 51 shouldBeEqualToString("rs.read();", 'd'); // '4th read gives back the 3rd chunk enqueued (queue now contains 1 chunks)');
 52 shouldBeEqualToString("rs.read();", 'e'); // '5th read gives back the 4th chunk enqueued (queue now contains 0 chunks)');
 53
 54 shouldBeFalse("enqueue('f');"); // 'After 5 reads, 6th enqueue should return false (queue now contains 1 chunk)');
 55 shouldBeFalse("enqueue('g');"); // 'After 5 reads, 7th enqueue should return false (queue now contains 2 chunks)');
 56}
 57test0();
 58
 59function test1() {
 60 createReadableStream(1);
 61
 62 shouldBeTrue("enqueue('a');"); // 'After 0 reads, 1st enqueue should return true (queue now contains 1 chunk)');
 63 shouldBeFalse("enqueue('b');"); // 'After 0 reads, 2nd enqueue should return false (queue now contains 2 chunks)');
 64 shouldBeFalse("enqueue('c');"); // 'After 0 reads, 3rd enqueue should return false (queue now contains 3 chunks)');
 65 shouldBeFalse("enqueue('d');"); // 'After 0 reads, 4th enqueue should return false (queue now contains 4 chunks)');
 66
 67 shouldBeEqualToString("rs.read();", 'a'); // '1st read gives back the 1st chunk enqueued (queue now contains 3 chunks)');
 68 shouldBeEqualToString("rs.read();", 'b'); // '2nd read gives back the 2nd chunk enqueued (queue now contains 2 chunks)');
 69 shouldBeEqualToString("rs.read();", 'c'); // '3rd read gives back the 2nd chunk enqueued (queue now contains 1 chunk)');
 70
 71 shouldBeFalse("enqueue('e');"); // 'After 3 reads, 5th enqueue should return false (queue now contains 2 chunks)');
 72
 73 shouldBeEqualToString("rs.read();", 'd'); // '4th read gives back the 3rd chunk enqueued (queue now contains 1 chunks)');
 74 shouldBeEqualToString("rs.read();", 'e'); // '5th read gives back the 4th chunk enqueued (queue now contains 0 chunks)');
 75
 76 shouldBeTrue("enqueue('f');"); // 'After 5 reads, 6th enqueue should return true (queue now contains 1 chunk)');
 77 shouldBeFalse("enqueue('g');"); // 'After 5 reads, 7th enqueue should return false (queue now contains 2 chunks)');
 78}
 79test1();
 80
 81function test4() {
 82 createReadableStream(4);
 83
 84 shouldBeTrue("enqueue('a');"); // 'After 0 reads, 1st enqueue should return true (queue now contains 1 chunk)');
 85 shouldBeTrue("enqueue('b');"); // 'After 0 reads, 2nd enqueue should return true (queue now contains 2 chunks)');
 86 shouldBeTrue("enqueue('c');"); // 'After 0 reads, 3rd enqueue should return true (queue now contains 3 chunks)');
 87 shouldBeTrue("enqueue('d');"); // 'After 0 reads, 4th enqueue should return true (queue now contains 4 chunks)');
 88 shouldBeFalse("enqueue('e');"); // 'After 0 reads, 5th enqueue should return false (queue now contains 5 chunks)');
 89 shouldBeFalse("enqueue('f');"); // 'After 0 reads, 6th enqueue should return false (queue now contains 6 chunks)');
 90
 91 shouldBeEqualToString("rs.read();", 'a'); // '1st read gives back the 1st chunk enqueued (queue now contains 5 chunks)');
 92 shouldBeEqualToString("rs.read();", 'b'); // '2nd read gives back the 2nd chunk enqueued (queue now contains 4 chunks)');
 93
 94 shouldBeFalse("enqueue('g');"); // 'After 2 reads, 7th enqueue should return false (queue now contains 5 chunks)');
 95
 96 shouldBeEqualToString("rs.read();", 'c'); // '3rd read gives back the 3rd chunk enqueued (queue now contains 4 chunks)');
 97 shouldBeEqualToString("rs.read();", 'd'); // '4th read gives back the 4th chunk enqueued (queue now contains 3 chunks)');
 98 shouldBeEqualToString("rs.read();", 'e'); // '5th read gives back the 5th chunk enqueued (queue now contains 2 chunks)');
 99 shouldBeEqualToString("rs.read();", 'f'); // '6th read gives back the 6th chunk enqueued (queue now contains 1 chunk)');
 100
 101 shouldBeTrue("enqueue('h');"); // 'After 6 reads, 8th enqueue should return true (queue now contains 2 chunks)');
 102 shouldBeTrue("enqueue('i');"); // 'After 6 reads, 9th enqueue should return true (queue now contains 3 chunks)');
 103 shouldBeTrue("enqueue('j');"); // 'After 6 reads, 10th enqueue should return true (queue now contains 4 chunks)');
 104 shouldBeFalse("enqueue('k');"); // 'After 6 reads, 11th enqueue should return false (queue now contains 5 chunks)');
 105}
 106test4();
 107
 108</script>
 109<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-pull-close-expected.txt

 1ReadableStream pull should be able to close a stream.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS stream state: closed
 7PASS successfullyParsed is true
 8
 9TEST COMPLETE
 10

LayoutTests/fast/streams/readablestreams-api-pull-close.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5if (window.testRunner) {
 6 testRunner.dumpAsText()
 7 testRunner.waitUntilDone()
 8}
 9window.jsTestIsAsync = true;
 10
 11description('ReadableStream pull should be able to close a stream.')
 12function runTest() {
 13
 14 function pump() {
 15 while (potato.state === "readable") {
 16 var buffer = potato.read()
 17 var dataView = new DataView(buffer)
 18 testPassed("received data: " + dataView.getInt32(0).toString(4))
 19 testPassed("stream state: " + potato.state)
 20 finishJSTest()
 21 }
 22 if (potato.state === "closed") {
 23 testPassed("stream state: " + potato.state)
 24 finishJSTest()
 25 }
 26 else {
 27 potato.ready.then(pump)
 28 }
 29 }
 30
 31 var counter = 0
 32 function incrementCounter() {
 33 return counter++
 34 }
 35
 36 var potato = new ReadableStream(
 37 { pull:
 38 function(enqueue, close, error) {
 39 close()
 40 }
 41 }
 42
 43 )
 44 pump()
 45}
 46try {
 47 runTest()
 48} catch(e) {
 49 testFailed("got exception: " + e)
 50 finishJSTest()
 51}
 52
 53</script>
 54<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-pull-expected.txt

 1ReadableStream pull should be able to enqueue various types of JS values.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS stream state: waiting
 7PASS enqueuing
 8PASS stream state: readable
 9PASS received data: [object Object]
 10PASS successfullyParsed is true
 11
 12TEST COMPLETE
 13

LayoutTests/fast/streams/readablestreams-api-pull.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5if (window.testRunner) {
 6 testRunner.dumpAsText()
 7 testRunner.waitUntilDone()
 8}
 9window.jsTestIsAsync = true;
 10
 11description('ReadableStream pull should be able to enqueue various types of JS values.')
 12function runTest() {
 13
 14 function pump() {
 15 testPassed("stream state: " + potato.state)
 16 while (potato.state === "readable") {
 17 testPassed("received data: " + potato.read())
 18 finishJSTest()
 19 }
 20 if (potato.state === "closed") {
 21 testPassed("stream state: " + potato.state)
 22 finishJSTest()
 23 }
 24 else {
 25 potato.ready.then(pump)
 26 }
 27 }
 28
 29 var counter = 0
 30 function incrementCounter() {
 31 return counter++
 32 }
 33
 34 var potato = new ReadableStream(
 35 { pull:
 36 function(enqueue, close, error) {
 37 testPassed("enqueuing")
 38 enqueue({potato:"Give me more!"})
 39 enqueue("test")
 40 enqueue(1)
 41 if (incrementCounter() >= 0)
 42 close()
 43 }
 44 })
 45
 46 pump()
 47}
 48
 49try {
 50 runTest()
 51} catch(e) {
 52 testFailed("got exception: " + e)
 53 finishJSTest()
 54}
 55
 56</script>
 57<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-read-errored-stream-expected.txt

 1PASS rs is non-null.
 2PASS rs.state is "errored"
 3PASS rs.read(); threw exception Error: aaaugh!!.
 4PASS successfullyParsed is true
 5
 6TEST COMPLETE
 7

LayoutTests/fast/streams/readablestreams-api-read-errored-stream.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5if (window.testRunner) {
 6 testRunner.dumpAsText()
 7 testRunner.waitUntilDone()
 8}
 9window.jsTestIsAsync = true;
 10
 11var passedError = new Error('aaaugh!!');
 12
 13var rs = new ReadableStream({
 14 start: function(enqueue, close, error) {
 15 error(passedError);
 16 }
 17});
 18
 19shouldBeNonNull("rs");
 20shouldBeEqualToString("rs.state", "errored");
 21shouldThrow('rs.read();', passedError)
 22
 23finishJSTest()
 24
 25</script>
 26<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-start-expected.txt

 1ReadableStream start should be able to enqueue data and close the stream.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS received data: 1
 7PASS stream state: closed
 8PASS successfullyParsed is true
 9
 10TEST COMPLETE
 11

LayoutTests/fast/streams/readablestreams-api-start-promise-expected.txt

 1Check ReadableStream start promise
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS received data: 1
 7PASS stream state: closed
 8PASS successfullyParsed is true
 9
 10TEST COMPLETE
 11

LayoutTests/fast/streams/readablestreams-api-start-promise.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5if (window.testRunner) {
 6 testRunner.dumpAsText()
 7 testRunner.waitUntilDone()
 8}
 9window.jsTestIsAsync = true;
 10
 11description('Check ReadableStream start promise')
 12
 13try {
 14 var potato = new ReadableStream(
 15 { start:
 16 function(enqueue, close, error) {
 17 setTimeout(function() {
 18 var buffer = new ArrayBuffer(4)
 19 var dataView = new DataView(buffer)
 20 dataView.setInt32(0, 0x01);
 21 enqueue(buffer)
 22 close()
 23 }, 50)
 24 }
 25 })
 26
 27 potato.ready.then(function() {
 28 var buffer = potato.read();
 29 var dataView = new DataView(buffer);
 30 testPassed("received data: " + dataView.getInt32(0).toString(4))
 31 testPassed("stream state: " + potato.state)
 32 finishJSTest()
 33 })
 34} catch(e) {
 35 testFailed("received error: " + e)
 36 finishJSTest()
 37}
 38
 39</script>
 40<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-start-throws-expected.txt

 1If ReadableStream start is throwing, the error should be rethrown.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS var potato = new ReadableStream({ start: function(enqueue, close, error) { throw new Error("error") } }) threw exception Error: error.
 7PASS successfullyParsed is true
 8
 9TEST COMPLETE
 10

LayoutTests/fast/streams/readablestreams-api-start-throws.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5if (window.testRunner) {
 6 testRunner.dumpAsText()
 7 testRunner.waitUntilDone()
 8}
 9window.jsTestIsAsync = true;
 10
 11description('If ReadableStream start is throwing, the error should be rethrown.')
 12shouldThrow('var potato = new ReadableStream({ start: function(enqueue, close, error) { throw new Error("error") } })');
 13
 14finishJSTest()
 15
 16</script>
 17<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-start.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5if (window.testRunner) {
 6 testRunner.dumpAsText()
 7 testRunner.waitUntilDone()
 8}
 9window.jsTestIsAsync = true;
 10
 11try {
 12
 13description('ReadableStream start should be able to enqueue data and close the stream.')
 14var potato = new ReadableStream(
 15{ start:
 16 function(enqueue, close, error) {
 17 var buffer = new ArrayBuffer(4)
 18 var dataView = new DataView(buffer)
 19 dataView.setInt32(0, 0x01);
 20 enqueue(buffer)
 21 close()
 22 }
 23})
 24
 25potato.ready.then(function() {
 26 var buffer = potato.read();
 27 var dataView = new DataView(buffer);
 28 testPassed("received data: " + dataView.getInt32(0).toString(4))
 29 testPassed("stream state: " + potato.state)
 30 finishJSTest()
 31 })
 32
 33} catch(e) {
 34 testFailed("received error: " + e)
 35 finishJSTest()
 36}
 37
 38</script>
 39<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/readablestreams-api-wrong-arguments-expected.txt

 1Exceptions should be thrown when wrong arguments are passed to the ReadableStream constructor.
 2
 3On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 4
 5
 6PASS var potato = new ReadableStream() did not throw exception.
 7PASS var potato = new ReadableStream("potato") threw exception TypeError: ReadableStream constructor should get an object as argument..
 8PASS potato = new ReadableStream({ start: "potato" }) threw exception TypeError: ReadableStream constructor object start property should be functions..
 9PASS potato = new ReadableStream({ cancel: "2" }) threw exception TypeError: ReadableStream constructor object cancel property should be functions..
 10PASS potato = new ReadableStream({ pull: { } }) threw exception TypeError: ReadableStream constructor object pull property should be functions..
 11PASS successfullyParsed is true
 12
 13TEST COMPLETE
 14

LayoutTests/fast/streams/readablestreams-api-wrong-arguments.html

 1<!DOCTYPE html>
 2<script src="../../resources/js-test-pre.js"></script>
 3<script>
 4
 5description('Exceptions should be thrown when wrong arguments are passed to the ReadableStream constructor.');
 6
 7shouldNotThrow('var potato = new ReadableStream()', '"Empty ReadableStream constructor should not throw."')
 8shouldThrow('var potato = new ReadableStream("potato")', '"TypeError: ReadableStream constructor should get an object as argument."')
 9shouldThrow('potato = new ReadableStream({ start: "potato" })', '"TypeError: ReadableStream constructor object start property should be functions."')
 10shouldThrow('potato = new ReadableStream({ cancel: "2" })', '"TypeError: ReadableStream constructor object cancel property should be functions."')
 11shouldThrow('potato = new ReadableStream({ pull: { } })', '"TypeError: ReadableStream constructor object pull property should be functions."')
 12
 13</script>
 14<script src="../../resources/js-test-post.js"></script>

LayoutTests/fast/streams/resources/streams-utils.js

 1function RandomPushSource(toPush) {
 2 this.pushed = 0;
 3 this.toPush = toPush;
 4 this.started = false;
 5 this.paused = false;
 6 this.closed = false;
 7
 8 this._intervalHandle = null;
 9}
 10
 11RandomPushSource.prototype = {
 12
 13 readStart: function() {
 14 if (this.closed) {
 15 return;
 16 }
 17
 18 if (!this.started) {
 19 this._intervalHandle = setInterval(writeChunk, 23);
 20 this.started = true;
 21 }
 22
 23 if (this.paused) {
 24 this._intervalHandle = setInterval(writeChunk, 23);
 25 this.paused = false;
 26 }
 27
 28 var stream = this;
 29 function writeChunk() {
 30 if (stream.paused) {
 31 return;
 32 }
 33
 34 stream.pushed++;
 35
 36 if (stream.toPush > 0 && stream.pushed > stream.toPush) {
 37 if (stream._intervalHandle) {
 38 clearInterval(stream._intervalHandle);
 39 stream._intervalHandle = undefined;
 40 }
 41 stream.closed = true;
 42 stream.onend();
 43 }
 44 else {
 45 stream.ondata(randomChunk(128));
 46 }
 47 }
 48 },
 49
 50 readStop: function() {
 51 if (this.paused) {
 52 return;
 53 }
 54
 55 if (this.started) {
 56 this.paused = true;
 57 clearInterval(this._intervalHandle);
 58 this._intervalHandle = undefined;
 59 } else {
 60 throw new Error('Can\'t pause reading an unstarted source.');
 61 }
 62 },
 63}
 64
 65// http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript
 66function randomChunk(size) {
 67 var text = '';
 68 var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
 69
 70 for (var i = 0; i < size; i++) {
 71 text += possible.charAt(Math.floor(Math.random() * possible.length));
 72 }
 73
 74 return text;
 75}
 76
 77function readableStreamToArray(readable) {
 78 var chunks = [];
 79
 80 pump();
 81 return readable.closed.then(function() {
 82 return chunks;
 83 });
 84
 85 function pump() {
 86 while (readable.state === "readable") {
 87 chunks.push(readable.read());
 88 }
 89
 90 if (readable.state === "waiting") {
 91 readable.ready.then(pump);
 92 }
 93
 94 // Otherwise the stream is "closed" or "errored", which will be handled above.
 95 }
 96}
 97
 98function SequentialPullSource(limit, options) {
 99 this.current = 0;
 100 this.limit = limit;
 101 this.opened = false;
 102 this.closed = false;
 103
 104 this._exec = function(f) { f(); };
 105 // if (async) {
 106 // this._exec = f => setImmediate(f);
 107 // }
 108}
 109
 110SequentialPullSource.prototype = {
 111
 112 open: function(cb) {
 113 this._exec(function() {
 114 this.opened = true
 115 cb();
 116 });
 117 },
 118
 119 read: function(cb) {
 120 this._exec(function() {
 121 if (++this.current <= this.limit) {
 122 cb(null, false, this.current);
 123 } else {
 124 cb(null, true, null);
 125 }
 126 });
 127 },
 128
 129 close: function(cb) {
 130 this._exec(function() {
 131 this.closed = true;
 132 cb();
 133 });
 134 },
 135}
 136
 137function sequentialReadableStream(limit, options) {
 138 var sequentialSource = new SequentialPullSource(limit, options);
 139
 140 var stream = new ReadableStream({
 141 start: function() {
 142 return new Promise(function(resolve, reject) {
 143 sequentialSource.open(function(err) {
 144 if (err) {
 145 reject(err);
 146 }
 147 resolve();
 148 });
 149 });
 150 },
 151
 152 pull: function(enqueue, finish, error) {
 153 sequentialSource.read(function(err, done, chunk) {
 154 if (err) {
 155 error(err);
 156 } else if (done) {
 157 sequentialSource.close(function(err) {
 158 if (err) {
 159 error(err);
 160 }
 161 finish();
 162 });
 163 } else {
 164 enqueue(chunk);
 165 }
 166 });
 167 },
 168 });
 169
 170 stream.source = sequentialSource;
 171
 172 return stream;
 173};

LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-sync-request-expected.txt

1 CONSOLE MESSAGE: line 600: XMLHttpRequest.responseType cannot be changed for synchronous HTTP(S) requests made from the window context.
2 CONSOLE MESSAGE: line 600: XMLHttpRequest.responseType cannot be changed for synchronous HTTP(S) requests made from the window context.
 1CONSOLE MESSAGE: line 621: XMLHttpRequest.responseType cannot be changed for synchronous HTTP(S) requests made from the window context.
 2CONSOLE MESSAGE: line 621: XMLHttpRequest.responseType cannot be changed for synchronous HTTP(S) requests made from the window context.
33This tests that the XMLHttpRequest responseType attribute is not modifiable for synchronous HTTP(S) requests.
44
55On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

LayoutTests/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('g
993993PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('set') is false
994994PASS Object.getOwnPropertyDescriptor(global, 'RangeException').enumerable is false
995995PASS Object.getOwnPropertyDescriptor(global, 'RangeException').configurable is true
 996PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').value is ReadableStream
 997PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('get') is false
 998PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('set') is false
 999PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').enumerable is false
 1000PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').configurable is true
9961001PASS Object.getOwnPropertyDescriptor(global, 'Rect').value is Rect
9971002PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('get') is false
9981003PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('set') is false

LayoutTests/js/dom/shadow-navigator-geolocation-in-strict-mode-does-not-throw-expected.txt

1 CONSOLE MESSAGE: line 588: Deprecated attempt to set property 'geolocation' on a non-Navigator object.
 1CONSOLE MESSAGE: line 609: Deprecated attempt to set property 'geolocation' on a non-Navigator object.
22Tests that we don't throw a type error in strict mode when assigning to an instance attribute that shadows navigator.geolocation. See https://bugs.webkit.org/show_bug.cgi?id=133559
33
44On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

LayoutTests/platform/efl/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('g
993993PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('set') is false
994994PASS Object.getOwnPropertyDescriptor(global, 'RangeException').enumerable is false
995995PASS Object.getOwnPropertyDescriptor(global, 'RangeException').configurable is true
 996PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').value is ReadableStream
 997PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('get') is false
 998PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('set') is false
 999PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').enumerable is false
 1000PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').configurable is true
9961001PASS Object.getOwnPropertyDescriptor(global, 'Rect').value is Rect
9971002PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('get') is false
9981003PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('set') is false

LayoutTests/platform/gtk/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('g
10681068PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('set') is false
10691069PASS Object.getOwnPropertyDescriptor(global, 'RangeException').enumerable is false
10701070PASS Object.getOwnPropertyDescriptor(global, 'RangeException').configurable is true
 1071PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').value is ReadableStream
 1072PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('get') is false
 1073PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('set') is false
 1074PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').enumerable is false
 1075PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').configurable is true
10711076PASS Object.getOwnPropertyDescriptor(global, 'Rect').value is Rect
10721077PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('get') is false
10731078PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('set') is false

LayoutTests/platform/ios-sim-deprecated/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('g
998998PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('set') is false
999999PASS Object.getOwnPropertyDescriptor(global, 'RangeException').enumerable is false
10001000PASS Object.getOwnPropertyDescriptor(global, 'RangeException').configurable is true
 1001PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').value is ReadableStream
 1002PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('get') is false
 1003PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('set') is false
 1004PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').enumerable is false
 1005PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').configurable is true
10011006PASS Object.getOwnPropertyDescriptor(global, 'Rect').value is Rect
10021007PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('get') is false
10031008PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('set') is false

LayoutTests/platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('g
998998PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('set') is false
999999PASS Object.getOwnPropertyDescriptor(global, 'RangeException').enumerable is false
10001000PASS Object.getOwnPropertyDescriptor(global, 'RangeException').configurable is true
 1001PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').value is ReadableStream
 1002PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('get') is false
 1003PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('set') is false
 1004PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').enumerable is false
 1005PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').configurable is true
10011006PASS Object.getOwnPropertyDescriptor(global, 'Rect').value is Rect
10021007PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('get') is false
10031008PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('set') is false

LayoutTests/platform/mac-mountainlion/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('g
988988PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('set') is false
989989PASS Object.getOwnPropertyDescriptor(global, 'RangeException').enumerable is false
990990PASS Object.getOwnPropertyDescriptor(global, 'RangeException').configurable is true
 991PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').value is ReadableStream
 992PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('get') is false
 993PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('set') is false
 994PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').enumerable is false
 995PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').configurable is true
991996PASS Object.getOwnPropertyDescriptor(global, 'Rect').value is Rect
992997PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('get') is false
993998PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('set') is false

LayoutTests/platform/mac/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('g
10181018PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('set') is false
10191019PASS Object.getOwnPropertyDescriptor(global, 'RangeException').enumerable is false
10201020PASS Object.getOwnPropertyDescriptor(global, 'RangeException').configurable is true
 1021PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').value is ReadableStream
 1022PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('get') is false
 1023PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('set') is false
 1024PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').enumerable is false
 1025PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').configurable is true
10211026PASS Object.getOwnPropertyDescriptor(global, 'Rect').value is Rect
10221027PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('get') is false
10231028PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('set') is false

LayoutTests/platform/win/js/dom/global-constructors-attributes-expected.txt

@@PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('g
838838PASS Object.getOwnPropertyDescriptor(global, 'RangeException').hasOwnProperty('set') is false
839839PASS Object.getOwnPropertyDescriptor(global, 'RangeException').enumerable is false
840840PASS Object.getOwnPropertyDescriptor(global, 'RangeException').configurable is true
 841PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').value is ReadableStream
 842PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('get') is false
 843PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').hasOwnProperty('set') is false
 844PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').enumerable is false
 845PASS Object.getOwnPropertyDescriptor(global, 'ReadableStream').configurable is true
841846PASS Object.getOwnPropertyDescriptor(global, 'Rect').value is Rect
842847PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('get') is false
843848PASS Object.getOwnPropertyDescriptor(global, 'Rect').hasOwnProperty('set') is false

LayoutTests/resources/js-test-pre.js

@@function shouldBeGreaterThanOrEqual(_a, _b) {
575575 testPassed(_a + " is >= " + _b);
576576}
577577
 578function shouldBeGreaterThan(_a, _b) {
 579 if (typeof _a != "string" || typeof _b != "string")
 580 debug("WARN: shouldBeGreaterThan expects string arguments");
 581
 582 var exception;
 583 var _av;
 584 try {
 585 _av = eval(_a);
 586 } catch (e) {
 587 exception = e;
 588 }
 589 var _bv = eval(_b);
 590
 591 if (exception)
 592 testFailed(_a + " should be > " + _b + ". Threw exception " + exception);
 593 else if (typeof _av == "undefined" || _av <= _bv)
 594 testFailed(_a + " should be > " + _b + ". Was " + _av + " (of type " + typeof _av + ").");
 595 else
 596 testPassed(_a + " is > " + _b);
 597}
 598
578599function expectTrue(v, msg) {
579600 if (v) {
580601 testPassed(msg);

ChangeLog

 12015-01-26 Youenn Fablet <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar <calvaris@igalia.com>
 2
 3 [Streams API] Implement ReadableStream
 4 https://bugs.webkit.org/show_bug.cgi?id=138967
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * Source/cmake/WebKitFeatures.cmake:
 9 * Source/cmakeconfig.h.cmake: Made streams API compilation on by default.
 10
1112015-01-26 Michael Catanzaro <mcatanzaro@igalia.com>
212
313 [GTK] gtkdoc does not appear in DevHelp