commit | c631f71be2e78da5d3ca2cb4dc1a05e08ac5930c | [log] [tgz] |
---|---|---|
author | Adam Rice <ricea@chromium.org> | Thu Mar 01 07:49:17 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Mar 01 07:49:17 2018 |
tree | 14a1e8f6008a7914310fe18f7a846ec221afa938 | |
parent | e091bb4fe9e5c1919c5f1a88b6e2a1bc9a27a19f [diff] |
Implement fetch() abort - Add an optional |signal| property to RequestInit - Add a |signal| property to Request, chained from RequestInit's signal - Create a chained AbortSignal in Request clone() - Add an Abort() method to FetchManager::Loader - Add an AbortSignal parameter to FetchManager::Fetch() - Add an AbortSignal member to FetchManager::Loader and BodyStreamBuffer The implementation closely follows the Fetch standard, particularly the initialisationn of |signal| in the Request constructor: https://fetch.spec.whatwg.org/#request-class and the signal-related steps in the fetch method: https://fetch.spec.whatwg.org/#fetch-method. The AbortSignal member of BodyStreamBuffer is only set for Response objects. It is not meaningful for Request objects. In addition, it is not set when a Response is created from a stream, as there is no associated Request that JS code could use to abort the response. The design doc is at https://docs.google.com/document/d/1OuoCG2uiijbAwbCw9jaS7tHEO0LBO_4gMNio1ox0qlY/edit. The Intent to Ship thread is at https://groups.google.com/a/chromium.org/d/msg/blink-dev/9vNZh4fhV2U/ZVxD2iQACgAJ. Known issues: when abort is signaled between a body access method like arrayBuffer() being called and the returned promise resolving, the promise will reject with a TypeError rather than an AbortError. See http://crbug.com/817687. BUG=750599 Change-Id: I19dfb311f55fcdc566b07449ef2c61ef7be301c7 Reviewed-on: https://chromium-review.googlesource.com/934542 Reviewed-by: Kent Tamura <tkent@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Yutaka Hirano <yhirano@chromium.org> Commit-Queue: Adam Rice <ricea@chromium.org> Cr-Commit-Position: refs/heads/master@{#540095}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .