Commit a38715e5 authored by Benoit Lize's avatar Benoit Lize Committed by Commit Bot

content: Remove a too-stringent CHECK().

File creation can fail, and does in fact (see linked bug). Since the
file is not needed to continue, remove a CHECK() and continue without
it.

Bug: 1029320, 1091181
Change-Id: I8fc14299dd6b2a9694b7fdfef12db7e542ece781
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2230624Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#775077}
parent 9fa1a0c8
...@@ -5145,18 +5145,22 @@ void RenderProcessHostImpl::ProvideSwapFileForRenderer() { ...@@ -5145,18 +5145,22 @@ void RenderProcessHostImpl::ProvideSwapFileForRenderer() {
base::ThreadPool::PostTaskAndReplyWithResult( base::ThreadPool::PostTaskAndReplyWithResult(
FROM_HERE, {base::MayBlock()}, base::BindOnce([]() { FROM_HERE, {base::MayBlock()}, base::BindOnce([]() {
base::FilePath path; base::FilePath path;
CHECK(base::CreateTemporaryFile(&path)); if (!base::CreateTemporaryFile(&path))
return base::File();
int flags = base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_READ | int flags = base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_READ |
base::File::FLAG_WRITE | base::File::FLAG_DELETE_ON_CLOSE; base::File::FLAG_WRITE | base::File::FLAG_DELETE_ON_CLOSE;
auto file = base::File(base::FilePath(path), flags); return base::File(base::FilePath(path), flags);
CHECK(file.IsValid());
return file;
}), }),
base::BindOnce( base::BindOnce(
[](mojo::Remote<blink::mojom::DiskAllocator> allocator, [](mojo::Remote<blink::mojom::DiskAllocator> allocator,
base::File file) { base::File file) {
allocator->ProvideTemporaryFile(std::move(file)); // File creation failed in the background. In this case, don't
// provide a file, the renderer will not wait for one (see the
// incognito case above, the renderer deals with no file being
// provided).
if (file.IsValid())
allocator->ProvideTemporaryFile(std::move(file));
}, },
std::move(allocator))); std::move(allocator)));
} }
......
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