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

Side by Side Diff: net/base/file_stream_posix.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, 7 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 | « media/audio/audio_output_controller.cc ('k') | net/base/file_stream_win.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 // 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
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
OLDNEW
« no previous file with comments | « media/audio/audio_output_controller.cc ('k') | net/base/file_stream_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698