| 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()));
|
|
|