Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2829923004: Fail when uploading blob is non-existant (Closed)
Patch Set: rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/blob_storage/chrome_blob_storage_context.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index c1985545a5d076620a10dddf229d21c150e60ced..cefafca497ab3de5ff69fa43fae80b4a0ee4341a 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1311,8 +1311,14 @@ void ResourceDispatcherHostImpl::ContinuePendingBeginRequest(
// Attaches the BlobDataHandles to request_body not to free the blobs
// and any attached shareable files until upload completion. These data
// will be used in UploadDataStream and ServiceWorkerURLRequestJob.
- AttachRequestBodyBlobDataHandles(request_data.request_body.get(),
- resource_context);
+ bool blobs_alive = AttachRequestBodyBlobDataHandles(
+ request_data.request_body.get(), resource_context);
+ if (!blobs_alive) {
+ AbortRequestBeforeItStarts(requester_info->filter(),
+ sync_result_handler, request_id,
+ std::move(url_loader_client));
+ return;
+ }
}
new_request->set_upload(UploadDataStreamBuilder::Build(
request_data.request_body.get(), blob_context,
@@ -2074,7 +2080,12 @@ void ResourceDispatcherHostImpl::BeginNavigationRequest(
// Resolve elements from request_body and prepare upload data.
ResourceRequestBodyImpl* body = info.common_params.post_data.get();
if (body) {
- AttachRequestBodyBlobDataHandles(body, resource_context);
+ bool blobs_alive = AttachRequestBodyBlobDataHandles(body, resource_context);
+ if (!blobs_alive) {
+ new_request->CancelWithError(net::ERR_INSUFFICIENT_RESOURCES);
+ loader->NotifyRequestFailed(false, net::ERR_ABORTED);
+ return;
+ }
new_request->set_upload(UploadDataStreamBuilder::Build(
body, blob_context, upload_file_system_context,
BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE).get()));
« no previous file with comments | « content/browser/blob_storage/chrome_blob_storage_context.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698