Skip to content

Commit c703590

Browse files
shaseleychromium-wpt-export-bot
authored andcommitted
Don't use AbortSignal::Follow in fetch and cache-storage
AbortSignal's "follow" algorithm is replaced with a new algorithm for creating a dependent abort signal ([1], [2]), which is implemented as a new AbortSignal constructor. This CL replaces Follow with the new ctor, behind the AbortSignalAny REF. There is a slight compat risk with the change (when the feature ships): 1. fetch: abort is propagated to dependent signals after abort event dispatch for a signal, whereas "follow" propagated abort before (as abort algorithms), which is observable. We could alternatively use weak abort algorithms in AbortSignal.any(), but that would be more complicated and partially limit GC optimizations. 2. cache: The use of "follow" in cache.addAll was not specced and could lead to abort events firing when they shouldn't have. The new behavior preserves the specced behavior (aborting outstanding requests on failure) without dispatching events when abort is triggered internally. Note: the virtual test expectations match the current expectations except for the test modified in fetch/api/abort/general.any.js. [1] whatwg/dom#1152 [2] whatwg/fetch#1646 Bug: 1323391 Low-Coverage-Reason: the uncovered lines in request.cc are covered by WPT tests Change-Id: I5c25048fcf9f8db759e2f0181ac338c8b603b451 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4515276 Reviewed-by: Nidhi Jaju <nidhijaju@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Commit-Queue: Scott Haseley <shaseley@chromium.org> Reviewed-by: Ben Kelly <wanderview@chromium.org> Cr-Commit-Position: refs/heads/main@{#1144953}
1 parent 25eb850 commit c703590

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fetch/api/abort/general.any.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ test(() => {
566566

567567
controller.abort();
568568

569-
assert_array_equals(log, ['clone-aborted', 'original-aborted'], "Abort events fired in correct order");
569+
assert_array_equals(log, ['original-aborted', 'clone-aborted'], "Abort events fired in correct order");
570570
assert_true(request.signal.aborted, 'Signal aborted');
571571
assert_true(clonedRequest.signal.aborted, 'Signal aborted');
572572
}, "Clone aborts with original controller");

0 commit comments

Comments
 (0)