Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: net/base/file_stream_win.cc

Issue 10151009: Disallow UI/IO thread blocking on any other thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/file_stream_posix.cc ('k') | net/base/network_change_notifier_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/base/file_stream_posix.cc ('k') | net/base/network_change_notifier_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698