At start time or after reading some data, a ReadableStream may want to pull data from its source until a limit. This mechanism should be implemented.
Created attachment 254556 [details] Patch
Created attachment 254557 [details] Rebasing
Created attachment 254569 [details] Fixed typo
Comment on attachment 254569 [details] Fixed typo View in context: https://bugs.webkit.org/attachment.cgi?id=254569&action=review > Source/WebCore/bindings/js/ReadableJSStream.cpp:108 > + ExecState& exec= *globalObject()->globalExec(); Missing space here before before the "=" sign. Also, lately I have been thinking we should start using “state” as the name for this rather then “exec”. > Source/WebCore/bindings/js/ReadableJSStream.cpp:153 > +bool ReadableJSStream::checkForException(JSC::ExecState& exec) I don’t think the name for this is exactly right; this does more than just “check for” an exception. It moves the exception from the execution state to the stream object. It’s a lot like “store error” in fact. I think maybe the storeError that doesn’t take an argument should just do this if there’s an exception in the exception state. I also think the idea of having this function do the hadException boolean check is so great. If the caller needs to distinguish that case, I think checking hadException at the call site makes no sense.
Comment on attachment 254569 [details] Fixed typo View in context: https://bugs.webkit.org/attachment.cgi?id=254569&action=review >> Source/WebCore/bindings/js/ReadableJSStream.cpp:108 >> + ExecState& exec= *globalObject()->globalExec(); > > Missing space here before before the "=" sign. Also, lately I have been thinking we should start using “state” as the name for this rather then “exec”. OK >> Source/WebCore/bindings/js/ReadableJSStream.cpp:153 >> +bool ReadableJSStream::checkForException(JSC::ExecState& exec) > > I don’t think the name for this is exactly right; this does more than just “check for” an exception. It moves the exception from the execution state to the stream object. It’s a lot like “store error” in fact. I think maybe the storeError that doesn’t take an argument should just do this if there’s an exception in the exception state. > > I also think the idea of having this function do the hadException boolean check is so great. If the caller needs to distinguish that case, I think checking hadException at the call site makes no sense. Initially, I did a first version doing everything in storeError(). The issue is that storeError() will always store an error, even if none is provided, in case of "controller.error()" for instance. We would need to do twice a exec.hadException() check if doing everything in storeError(). I plan to rewrite this using "void ReadableJSStream::storeException(ExecState&)" in lieu of checkForException. Please let me know if you have any better idea.
Created attachment 254590 [details] Patch for landing
Comment on attachment 254590 [details] Patch for landing Clearing flags on attachment: 254590 Committed r185406: <http://trac.webkit.org/changeset/185406>
All reviewed patches have been landed. Closing bug.