[go: nahoru, domu]

CORS for sync redirects

Historically, synchronous fetches have had no associated ResourceClient.
This made no difference, because synchronous fetches blocked until the
fetch completed, so there would be no callbacks to listen to until the
function was ready to return anyway.

However, now we perform the synchronous fetch on a utility thread, and
https://chromium.googlesource.com/chromium/src.git/+/4bd024a4e885ced5d79f19c4e950c7ffb9ee29b0
allows us to unblock and re-block the requesting thread in order to
perform redirect checks. Before this CL, the redirect handling can only
process checks that don't require access to the ResourceClient (like CSP).
This CL allows DocumentThreadableLoader to register itself as a
ResourceClient on a sync fetch, so that it can perform CORS checks
on sync requests.

Because DocumentThreadableLoader now gets ResourceClient callbacks
for sync requests, DocumentThreadableLoader::LoadRequestSync is
substantially simpler.

Bug: 706331
Change-Id: I3031b8068b3501f7f8f7bf19e4ab46ad7b59e83a
Reviewed-on: https://chromium-review.googlesource.com/1067745
Commit-Queue: Nate Chapin <japhet@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562496}
17 files changed