Changeset 203162 in webkit
- Timestamp:
- Jul 13, 2016 9:08:51 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r203153 r203162 1 2016-07-13 Youenn Fablet <youenn@apple.com> 2 3 [Fetch API] Response should not become disturbed on the ReadableStream creation 4 https://bugs.webkit.org/show_bug.cgi?id=159714 5 6 Reviewed by Alex Christensen. 7 8 * web-platform-tests/fetch/api/response/response-stream-disturbed-1-expected.txt: 9 1 10 2016-07-12 Youenn Fablet <youenn@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-stream-disturbed-1-expected.txt
r199641 r203162 1 1 2 FAIL Getting blob after getting the Response body - not disturbed, not locked promise_test: Unhandled rejection with value: object "TypeError: Type error" 3 FAIL Getting text after getting the Response body - not disturbed, not locked promise_test: Unhandled rejection with value: object "TypeError: Type error" 4 FAIL Getting json after getting the Response body - not disturbed, not locked promise_test: Unhandled rejection with value: object "TypeError: Type error" 5 FAIL Getting arrayBuffer after getting the Response body - not disturbed, not locked promise_test: Unhandled rejection with value: object "TypeError: Type error" 2 PASS Getting blob after getting the Response body - not disturbed, not locked 3 PASS Getting text after getting the Response body - not disturbed, not locked 4 PASS Getting json after getting the Response body - not disturbed, not locked 5 PASS Getting arrayBuffer after getting the Response body - not disturbed, not locked 6 6 -
trunk/Source/WebCore/ChangeLog
r203159 r203162 1 2016-07-13 Youenn Fablet <youenn@apple.com> 2 3 [Fetch API] Response should not become disturbed on the ReadableStream creation 4 https://bugs.webkit.org/show_bug.cgi?id=159714 5 6 Reviewed by Alex Christensen. 7 8 Covered by rebased test and existing tests. 9 10 * Modules/fetch/FetchResponse.cpp: 11 (WebCore::FetchResponse::stop): Making the response disturbed if cancelled. 12 * Modules/fetch/FetchResponseSource.cpp: 13 (WebCore::FetchResponseSource::firstReadCallback): Start enqueueing as soon as first read is made. 14 (WebCore::FetchResponseSource::doStart): Keep the start promise unresolved so that pull is not called. 15 FetchResponse is a push source. 16 * Modules/fetch/FetchResponseSource.h: 17 * Modules/streams/ReadableStreamInternals.js: 18 (readFromReadableStreamReader): Calling @firstReadCallback. 19 * Modules/streams/ReadableStreamSource.h: 20 (WebCore::ReadableStreamSource::firstReadCallback): Default implementation (does nothing). 21 * Modules/streams/ReadableStreamSource.idl: Adding firstReadCallback private method. 22 * bindings/js/WebCoreBuiltinNames.h: Adding @firstReadCallback. 23 1 24 2016-07-13 Philippe Normand <pnormand@igalia.com> 2 25 -
trunk/Source/WebCore/Modules/fetch/FetchResponse.cpp
r202910 r203162 288 288 return m_loader->startStreaming(); 289 289 } 290 291 void FetchResponse::cancel() 292 { 293 m_isDisturbed = true; 294 stop(); 295 } 296 290 297 #endif 291 298 -
trunk/Source/WebCore/Modules/fetch/FetchResponse.h
r202162 r203162 74 74 ReadableStreamSource* createReadableStreamSource(); 75 75 void consumeBodyAsStream(); 76 void cancel(); 76 77 #endif 77 78 -
trunk/Source/WebCore/Modules/fetch/FetchResponseSource.cpp
r199641 r203162 56 56 } 57 57 58 void FetchResponseSource::firstReadCallback() 59 { 60 m_response.consumeBodyAsStream(); 61 } 62 58 63 void FetchResponseSource::doStart() 59 64 { 60 // FIXME: We should consume body only if stream reader requested data, i.e. is disturbed. 61 // We might need a callback to be notified of the stream being disturbed. 62 m_response.consumeBodyAsStream(); 65 // startFinished should not be called as this is a push source, hence overriding default implementation. 63 66 } 67 64 68 65 69 void FetchResponseSource::doCancel() 66 70 { 67 71 m_isCancelling = true; 68 static_cast<ActiveDOMObject&>(m_response).stop();72 m_response.cancel(); 69 73 } 70 74 -
trunk/Source/WebCore/Modules/fetch/FetchResponseSource.h
r199641 r203162 27 27 */ 28 28 29 #ifndef FetchResponseSource_h 30 #define FetchResponseSource_h 29 #pragma once 31 30 32 31 #if ENABLE(FETCH_API) && ENABLE(STREAMS_API) … … 50 49 51 50 private: 51 void firstReadCallback() final; 52 52 void doStart() final; 53 53 void doCancel() final; … … 62 62 63 63 #endif // ENABLE(FETCH_API) && ENABLE(STREAMS_API) 64 65 #endif // FetchResponseSource_h -
trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js
r198776 r203162 342 342 const stream = reader.@ownerReadableStream; 343 343 @assert(!!stream); 344 345 // Native sources may want to start enqueueing at the time of the first read request. 346 if (!stream.@disturbed && stream.@underlyingSource.@firstReadCallback) 347 stream.@underlyingSource.@firstReadCallback(); 348 344 349 stream.@disturbed = true; 345 350 if (stream.@state === @streamClosed) -
trunk/Source/WebCore/Modules/streams/ReadableStreamSource.h
r201013 r203162 27 27 */ 28 28 29 30 #ifndef ReadableStreamSource_h 31 #define ReadableStreamSource_h 29 #pragma once 32 30 33 31 #if ENABLE(STREAMS_API) … … 47 45 typedef DOMPromise<std::nullptr_t> Promise; 48 46 47 virtual void firstReadCallback() { } 49 48 void start(ReadableStreamController&&, Promise&&); 50 49 void cancel(JSC::JSValue); … … 104 103 105 104 #endif // ENABLE(STREAMS_API) 106 107 #endif // ReadableStreamSource_h -
trunk/Source/WebCore/Modules/streams/ReadableStreamSource.idl
r199641 r203162 36 36 void cancel(any reason); 37 37 38 [PrivateIdentifier] void firstReadCallback(); 39 38 40 // Place holder to keep the controller linked to the source. 39 41 [CachedAttribute, CustomGetter] readonly attribute any controller; -
trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h
r203029 r203162 41 41 macro(disturbed) \ 42 42 macro(fillFromJS) \ 43 macro(firstReadCallback) \ 43 44 macro(getUserMediaFromJS) \ 44 45 macro(getRemoteStreams) \
Note: See TracChangeset
for help on using the changeset viewer.