summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi
diff options
context:
space:
mode:
authorericu@chromium.org <ericu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-28 21:18:00 +0000
committerericu@chromium.org <ericu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-28 21:18:00 +0000
commitb825f4966b1c58dfab7caaf6a2f708df3077a585 (patch)
treeef57ce1c5a492508baaa154b76835ac82c4d21f6 /webkit/fileapi
parent7a1ec28a5ed31296639e95bdf69b844cb626a50f (diff)
downloadchromium_src-b825f4966b1c58dfab7caaf6a2f708df3077a585.zip
chromium_src-b825f4966b1c58dfab7caaf6a2f708df3077a585.tar.gz
chromium_src-b825f4966b1c58dfab7caaf6a2f708df3077a585.tar.bz2
Fix a FileWriter abort race by turning an assert into a soft check.
See https://bugs.webkit.org/show_bug.cgi?id=81861 for the other side of this. BUG=119417 TEST=existing tests get less flaky Review URL: http://codereview.chromium.org/9764018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129488 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r--webkit/fileapi/webfilewriter_base.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/webkit/fileapi/webfilewriter_base.cc b/webkit/fileapi/webfilewriter_base.cc
index 7621a4f..d03fbe8 100644
--- a/webkit/fileapi/webfilewriter_base.cc
+++ b/webkit/fileapi/webfilewriter_base.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -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;