| Index: net/disk_cache/file_posix.cc
|
| ===================================================================
|
| --- net/disk_cache/file_posix.cc (revision 126788)
|
| +++ net/disk_cache/file_posix.cc (working copy)
|
| @@ -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.
|
|
|
| @@ -97,7 +97,7 @@
|
| } else {
|
| result_ = net::ERR_CACHE_READ_FAILURE;
|
| }
|
| - controller_->OnIOComplete(this);
|
| + NotifyController();
|
| }
|
|
|
| // Runs on a worker thread.
|
| @@ -105,7 +105,7 @@
|
| bool rv = file_->Write(buf_, buf_len_, offset_);
|
|
|
| result_ = rv ? static_cast<int>(buf_len_) : net::ERR_CACHE_WRITE_FAILURE;
|
| - controller_->OnIOComplete(this);
|
| + NotifyController();
|
| }
|
|
|
| // ---------------------------------------------------------------------------
|
| @@ -282,6 +282,12 @@
|
| DeleteFileInFlightIO();
|
| }
|
|
|
| +// Static.
|
| +void File::DropPendingIO() {
|
| + GetFileInFlightIO()->DropPendingIO();
|
| + DeleteFileInFlightIO();
|
| +}
|
| +
|
| File::~File() {
|
| if (IsValid())
|
| base::ClosePlatformFile(platform_file_);
|
|
|