Fix extraneous call to ContentVerifyJob::DispatchFailureCallback.
If ContentVerifyJob receives hashes (ContentVerifyJob::OnHashesReady) after the content is read (ContentVerifyJob::DoneReading), then it was possible for DispatchFailureCallback to be called more than once. This causes a DCHECK failure in DispatchFailureCallback (DCHECK(!failed_)). Bail out early in OnHashesReady if call to ContentVerifyJob::BytesRead leads to a ContentVerifyJob failure. Note that this isn't harmful in Release builds as DispatchFailureCallback tests ContentVerifyJob::failure_callback_ before calling the callback, which is reset once it is called. Nevertheless, this is incorrect behavior and this CL fixes that. Bug: 804630 Test: See bug description for repro steps. Change-Id: Icf3a5c8b4c0d01cb20e02de14b11aca4aeff03e5 Reviewed-on: https://chromium-review.googlesource.com/879961Reviewed-by:Devlin <rdevlin.cronin@chromium.org> Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org> Cr-Commit-Position: refs/heads/master@{#531755}
Showing
Please register or sign in to comment