Commit b825f496 authored by ericu@chromium.org's avatar ericu@chromium.org

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
parent 7a1ec28a
// 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 // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -54,7 +54,9 @@ void WebFileWriterBase::write( ...@@ -54,7 +54,9 @@ void WebFileWriterBase::write(
// thing to come back is the cancel response. We only notify the // thing to come back is the cancel response. We only notify the
// AsyncFileWriterClient when it's all over. // AsyncFileWriterClient when it's all over.
void WebFileWriterBase::cancel() { 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_) if (kCancelNotInProgress != cancel_state_)
return; return;
cancel_state_ = kCancelSent; cancel_state_ = kCancelSent;
......
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