Commit b85bbb8c authored by Austin Sullivan's avatar Austin Sullivan Committed by Chromium LUCI CQ

Add null check when SandboxFSWriter write fails

On write failure, the QuotaManagerProxy calls NotifyWriteFailed to
surface this failure to quota.

On filesystems which don't support quota, no check is currently
made that the manager exists before NotifyWriteFailed is called.

Bug: N/A
Change-Id: Iae14483fb9c395576102c82c3a5fa60fac9f1343
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2593745
Auto-Submit: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837642}
parent 59fc783c
...@@ -226,8 +226,11 @@ void SandboxFileStreamWriter::DidWrite(int write_response) { ...@@ -226,8 +226,11 @@ void SandboxFileStreamWriter::DidWrite(int write_response) {
if (write_response <= 0) { if (write_response <= 0) {
// TODO(crbug.com/1091792): Consider listening explicitly for out // TODO(crbug.com/1091792): Consider listening explicitly for out
// of space errors instead of surfacing all write errors to quota. // of space errors instead of surfacing all write errors to quota.
file_system_context_->quota_manager_proxy()->NotifyWriteFailed( QuotaManagerProxy* quota_manager_proxy =
url_.origin()); file_system_context_->quota_manager_proxy();
if (quota_manager_proxy) {
quota_manager_proxy->NotifyWriteFailed(url_.origin());
}
if (CancelIfRequested()) if (CancelIfRequested())
return; return;
std::move(write_callback_).Run(write_response); std::move(write_callback_).Run(write_response);
......
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