| 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 #include "net/base/file_stream.h" | 5 #include "net/base/file_stream.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 ResetOnIOComplete(); | 720 ResetOnIOComplete(); |
| 721 callback.Run(*result); | 721 callback.Run(*result); |
| 722 } | 722 } |
| 723 | 723 |
| 724 void FileStreamWin::ResetOnIOComplete() { | 724 void FileStreamWin::ResetOnIOComplete() { |
| 725 on_io_complete_.reset(); | 725 on_io_complete_.reset(); |
| 726 weak_ptr_factory_.InvalidateWeakPtrs(); | 726 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 727 } | 727 } |
| 728 | 728 |
| 729 void FileStreamWin::WaitForIOCompletion() { | 729 void FileStreamWin::WaitForIOCompletion() { |
| 730 base::ThreadRestrictions::ScopedAllowWait allow_wait; |
| 730 if (on_io_complete_.get()) { | 731 if (on_io_complete_.get()) { |
| 731 on_io_complete_->Wait(); | 732 on_io_complete_->Wait(); |
| 732 on_io_complete_.reset(); | 733 on_io_complete_.reset(); |
| 733 } | 734 } |
| 734 } | 735 } |
| 735 | 736 |
| 736 } // namespace net | 737 } // namespace net |
| OLD | NEW |