Force callers to claim blob url before making a fetch request#43746
Conversation
|
🔨 Triggering try run (#23706408001) for Linux (WPT) |
|
|
|
|
🔨 Triggering try run (#23708152035) for Linux (WPT) |
|
|
|
🔨 Triggering try run (#23708823164) for Linux (WPT) |
|
Test results for linux-wpt from try job (#23708823164): Flaky unexpected result (33)
Stable unexpected results that are known to be intermittent (29)
Stable unexpected results (6)
|
|
|
e1daa8f to
88a6b20
Compare
|
🔨 Triggering try run (#23710426523) for Linux (WPT) |
|
Test results for linux-wpt from try job (#23710426523): Flaky unexpected result (32)
Stable unexpected results that are known to be intermittent (21)
|
|
✨ Try run (#23710426523) succeeded. |
2201e5e to
f4543ea
Compare
|
This is a really nice solution! |
|
@jdm Did you mean to approve this? |
|
No, I haven't had time to.look at it closely yet. Planning on doing that tomorrow. |
jdm
left a comment
There was a problem hiding this comment.
I love that this can be improved incrementally instead of all at once. Great job figuring out how to make progress here!
| } | ||
|
|
||
| impl BlobTokenCommunicator { | ||
| pub fn stub_for_testing() -> Arc<Mutex<Self>> { |
There was a problem hiding this comment.
We cannot, because the tests that use this are outside of the net crate, and cfg(test) is only set for the crate being tested (That's how I understand it at least).
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
f4543ea to
b462f19
Compare
|
Thank you for the review! |
9e674ee to
50efa77
Compare
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
50efa77 to
14d8955
Compare
Refer to #43746 for a description of the problem. This change ensures that video posters can be loaded from blob URLs, even if the URL is revoked right after. Testing: This change adds a test --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
blobURLs have a implicit blob URL entry attached, which stores the data contained in the blob. The specification requires this entry to be resolved as the URL is parsed. We only resolve it insidenetwhen loading the URL. That causes problems if the blob entry has been revoked in the meantime - see #25226.Ideally we would want to resolve blobs at parse-time as required. But because
ServoUrlis such a fundamental type, I've not managed to do this change without having to touch hundreds of files at once.Thus, we now require passing a
UrlWithBlobClaiminstead of aServoUrlwhenfetch-ing. This type proves that the caller has acquired the blob beforehand.As a temporary escape hatch, I've added
UrlWithBlobClaim::from_url_without_having_claimed_blob. That method logs a warning if its used unsafely. This method is currently used in most places to keep this change small. Only workers now acquire the blob beforehand.Testing: A new test starts to pass
Part of #43326
Part of #25226