Commit 8a556164 authored by Reilly Grant's avatar Reilly Grant Committed by Commit Bot

Reland "Bounce Blob URL revoking through the UI thread to give navigation a chance."

This is a reland of a3dd29b2.

Original change's description:
> Bounce Blob URL revoking through the UI thread to give navigation a chance.
>
> Navigation IPCs are handled on the UI thread so if a blob URL is revoked
> immediately after navigating the revocation will almost always happen before
> the navigation code has had a chance to post a task back to the IO thread to
> actually perform the request. With this change revocation is hopefully
> delayed just long enough to make navigation work again.
>
> Bug: 807639
> Change-Id: I2afde86dd203c61cbb03cc02ac62ec21c7e7d704
> Reviewed-on: https://chromium-review.googlesource.com/899666
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#534119}

TBR=mek@chromium.org,jochen@chromium.org

Bug: 807639,808759
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I5033422d57ac7672e761045f7871c6aed29368b9
Reviewed-on: https://chromium-review.googlesource.com/900191
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534257}
parent c41cbd7b
......@@ -89,6 +89,25 @@ void BlobDispatcherHost::OnRegisterPublicBlobURL(const GURL& public_url,
public_blob_urls_.insert(public_url);
}
namespace {
void RevokePublicBlobURLHelperIO(
scoped_refptr<ChromeBlobStorageContext> context,
const GURL& public_url) {
context->context()->RevokePublicBlobURL(public_url);
}
void RevokePublicBlobURLHelperUI(
scoped_refptr<ChromeBlobStorageContext> context,
const GURL& public_url) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::BindOnce(&RevokePublicBlobURLHelperIO,
std::move(context), public_url));
}
} // namespace
void BlobDispatcherHost::OnRevokePublicBlobURL(const GURL& public_url) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!public_url.is_valid()) {
......@@ -103,8 +122,10 @@ void BlobDispatcherHost::OnRevokePublicBlobURL(const GURL& public_url) {
BDH_TRACING_ENUM_LAST);
return;
}
context()->RevokePublicBlobURL(public_url);
public_blob_urls_.erase(public_url);
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::BindOnce(&RevokePublicBlobURLHelperUI,
blob_storage_context_, public_url));
}
storage::BlobStorageContext* BlobDispatcherHost::context() {
......
......@@ -15,6 +15,7 @@ var blob = new Blob(['hello world!'], {type: 'text/plain'});
var url = URL.createObjectURL(blob);
anchorElement.href = url;
anchorElement.click();
URL.revokeObjectURL(url);
</script>
</body>
</html>
......@@ -126,4 +126,7 @@
-CrossSiteDocumentBlockingTest.RangeRequest
# Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests__dbg__1_%2F69105%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_content_browsertests%2F0%2Flogs%2FWebContentsImplBrowserTest.DownloadImage_Allow_FileImage%2F0
-WebContentsImplBrowserTest.DownloadImage_Allow_FileImage
-WebContentsImplBrowserTest.DownloadImage_Allow_FileImage
# https://crbug.com/808759
-DownloadContentTest.DownloadAttributeBlobURL
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment