Commit 92d53202 authored by Eero Häkkinen's avatar Eero Häkkinen Committed by Commit Bot

Use completion callback instead of NOTREACHED for invalid offsets

This allows to simplify Write methods in NativeFileSystemFileHandleImpl.

Bug: 957214
Change-Id: I4e1ba58a7f904ebe5f60d355f20cdd6c5cb497bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1645782Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Commit-Queue: Eero Häkkinen <eero.hakkinen@intel.com>
Cr-Commit-Position: refs/heads/master@{#666624}
parent 7027a4a8
...@@ -136,10 +136,9 @@ void SandboxFileStreamWriter::DidCreateSnapshotFile( ...@@ -136,10 +136,9 @@ void SandboxFileStreamWriter::DidCreateSnapshotFile(
} }
file_size_ = file_info.size; file_size_ = file_info.size;
if (initial_offset_ > file_size_) { if (initial_offset_ > file_size_) {
LOG(ERROR) << initial_offset_ << ", " << file_size_; // We should not be writing pass the end of the file.
// This shouldn't happen as long as we check offset in the renderer. std::move(callback).Run(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE);
NOTREACHED(); return;
initial_offset_ = file_size_;
} }
DCHECK(!file_writer_.get()); DCHECK(!file_writer_.get());
......
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