Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Unified Diff: webkit/fileapi/webfilewriter_base.cc

Issue 9764018: Fix a FileWriter abort race by turning an assert into a soft check. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/webfilewriter_base.cc
diff --git a/webkit/fileapi/webfilewriter_base.cc b/webkit/fileapi/webfilewriter_base.cc
index 7621a4fae8e5e42ad5e569ed56582b11677d43f1..26774038c60a22c3423690ec5529052d460a8745 100644
--- a/webkit/fileapi/webfilewriter_base.cc
+++ b/webkit/fileapi/webfilewriter_base.cc
@@ -54,7 +54,9 @@ void WebFileWriterBase::write(
// thing to come back is the cancel response. We only notify the
// AsyncFileWriterClient when it's all over.
void WebFileWriterBase::cancel() {
- DCHECK(kOperationWrite == operation_ || kOperationTruncate == operation_);
+ // Check for the cancel passing the previous operation's return in-flight.
+ if (kOperationWrite != operation_ && kOperationTruncate != operation_)
+ return;
if (kCancelNotInProgress != cancel_state_)
return;
cancel_state_ = kCancelSent;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698