OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // For 64-bit file access (off_t = off64_t, lseek64, etc). | 5 // For 64-bit file access (off_t = off64_t, lseek64, etc). |
6 #define _FILE_OFFSET_BITS 64 | 6 #define _FILE_OFFSET_BITS 64 |
7 | 7 |
8 #include "net/base/file_stream.h" | 8 #include "net/base/file_stream.h" |
9 | 9 |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 | 637 |
638 void FileStreamPosix::OnClosed(const CompletionCallback& callback) { | 638 void FileStreamPosix::OnClosed(const CompletionCallback& callback) { |
639 file_ = base::kInvalidPlatformFileValue; | 639 file_ = base::kInvalidPlatformFileValue; |
640 | 640 |
641 // Reset this before Run() as Run() may issue a new async operation. | 641 // Reset this before Run() as Run() may issue a new async operation. |
642 ResetOnIOComplete(); | 642 ResetOnIOComplete(); |
643 callback.Run(OK); | 643 callback.Run(OK); |
644 } | 644 } |
645 | 645 |
646 void FileStreamPosix::WaitForIOCompletion() { | 646 void FileStreamPosix::WaitForIOCompletion() { |
| 647 base::ThreadRestrictions::ScopedAllowWait allow_wait; |
647 if (on_io_complete_.get()) { | 648 if (on_io_complete_.get()) { |
648 on_io_complete_->Wait(); | 649 on_io_complete_->Wait(); |
649 on_io_complete_.reset(); | 650 on_io_complete_.reset(); |
650 } | 651 } |
651 } | 652 } |
652 | 653 |
653 } // namespace net | 654 } // namespace net |
OLD | NEW |