Changeset 186113 in webkit


Ignore:
Timestamp:
Jun 30, 2015 2:53:40 AM (9 years ago)
Author:
calvaris@igalia.com
Message:

[Streams API] Finish pulling must always be done asynchronously as it is the expected promise behavior (according to the spec)
https://bugs.webkit.org/show_bug.cgi?id=146408

Reviewed by Darin Adler.

Source/WebCore:

Current tests cover the case already.

  • Modules/streams/ReadableStream.cpp:

(WebCore::ReadableStream::pull): Call finishPull() in a postTask to delay it and simulate the promise
resolution.

LayoutTests:

  • streams/reference-implementation/readable-stream-expected.txt: Updated expectation to PASS
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r186112 r186113  
     12015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [Streams API] Finish pulling must always be done asynchronously as it is the expected promise behavior (according to the spec)
     4        https://bugs.webkit.org/show_bug.cgi?id=146408
     5
     6        Reviewed by Darin Adler.
     7
     8        * streams/reference-implementation/readable-stream-expected.txt: Updated expectation to PASS
     9
    1102015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
    211
  • trunk/LayoutTests/streams/reference-implementation/readable-stream-expected.txt

    r186024 r186113  
    1414PASS ReadableStream: if pull rejects, it should error the stream
    1515PASS ReadableStream: should only call pull once upon starting the stream
    16 FAIL ReadableStream: should call pull when trying to read from a started, empty stream assert_equals: pull should be called again in reaction to calling read expected 2 but got 3
     16PASS ReadableStream: should call pull when trying to read from a started, empty stream
    1717PASS ReadableStream: should only call pull once on a non-empty stream read from before start fulfills
    1818PASS ReadableStream: should only call pull once on a non-empty stream read from after start fulfills
  • trunk/Source/WebCore/ChangeLog

    r186112 r186113  
     12015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        [Streams API] Finish pulling must always be done asynchronously as it is the expected promise behavior (according to the spec)
     4        https://bugs.webkit.org/show_bug.cgi?id=146408
     5
     6        Reviewed by Darin Adler.
     7
     8        Current tests cover the case already.
     9
     10        * Modules/streams/ReadableStream.cpp:
     11        (WebCore::ReadableStream::pull): Call finishPull() in a postTask to delay it and simulate the promise
     12        resolution.
     13
    1142015-06-30  Youenn Fablet  <youenn.fablet@crf.canon.fr> and Xabier Rodriguez Calvar  <calvaris@igalia.com>
    215
  • trunk/Source/WebCore/Modules/streams/ReadableStream.cpp

    r186111 r186113  
    3535#include "ExceptionCode.h"
    3636#include "ReadableStreamReader.h"
     37#include "ScriptExecutionContext.h"
    3738#include <runtime/JSCJSValueInlines.h>
    3839#include <wtf/RefCountedLeakCounter.h>
     
    133134
    134135    m_isPulling = true;
    135     if (doPull())
    136         finishPulling();
     136    if (doPull()) {
     137        RefPtr<ReadableStream> protectedStream(this);
     138        scriptExecutionContext()->postTask([protectedStream](ScriptExecutionContext&) {
     139            protectedStream->finishPulling();
     140        });
     141    }
    137142}
    138143
Note: See TracChangeset for help on using the changeset viewer.