Commit 1fd3a5f3 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

[Blobs] Fix BuildFromStreamResult histogram recording.

Only record in OnError if callback_ is still set. Otherwise every
success case will also result in recording "Aborted", via the destructor
of the class calling OnError.

Bug: 712693
Change-Id: I0d73119017b6d88fca4378687d5187ed96919b49
Reviewed-on: https://chromium-review.googlesource.com/994232
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548201}
parent 1c587bc5
...@@ -617,7 +617,6 @@ void BlobBuilderFromStream::DidWriteToExtendedFile( ...@@ -617,7 +617,6 @@ void BlobBuilderFromStream::DidWriteToExtendedFile(
} }
void BlobBuilderFromStream::OnError(Result result) { void BlobBuilderFromStream::OnError(Result result) {
RecordResult(result);
if (pending_quota_task_) if (pending_quota_task_)
pending_quota_task_->Cancel(); pending_quota_task_->Cancel();
...@@ -626,6 +625,7 @@ void BlobBuilderFromStream::OnError(Result result) { ...@@ -626,6 +625,7 @@ void BlobBuilderFromStream::OnError(Result result) {
if (!callback_) if (!callback_)
return; return;
RecordResult(result);
std::move(callback_).Run(this, nullptr); std::move(callback_).Run(this, nullptr);
} }
......
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