Index: chromeos/process_proxy/process_output_watcher.cc |
diff --git a/chromeos/process_proxy/process_output_watcher.cc b/chromeos/process_proxy/process_output_watcher.cc |
index a88f5f5893bd94ee247ccc13ebbd0d75d292b111..b9eee0d0a0922a329fb87ef3c22b744960bc4e7c 100644 |
--- a/chromeos/process_proxy/process_output_watcher.cc |
+++ b/chromeos/process_proxy/process_output_watcher.cc |
@@ -67,21 +67,16 @@ void ProcessOutputWatcher::Start() { |
WatchProcessOutput(); |
} |
-void ProcessOutputWatcher::OnFileCanReadWithoutBlocking(int fd) { |
- DCHECK_EQ(process_output_file_.GetPlatformFile(), fd); |
- |
- output_file_watcher_.StopWatchingFileDescriptor(); |
- ReadFromFd(fd); |
-} |
- |
-void ProcessOutputWatcher::OnFileCanWriteWithoutBlocking(int fd) { |
- NOTREACHED(); |
+void ProcessOutputWatcher::OnProcessOutputCanReadWithoutBlocking() { |
+ output_file_watcher_.reset(); |
+ ReadFromFd(process_output_file_.GetPlatformFile()); |
} |
void ProcessOutputWatcher::WatchProcessOutput() { |
- base::MessageLoopForIO::current()->WatchFileDescriptor( |
- process_output_file_.GetPlatformFile(), false, |
- base::MessageLoopForIO::WATCH_READ, &output_file_watcher_, this); |
+ output_file_watcher_ = base::FileDescriptorWatcher::WatchReadable( |
+ process_output_file_.GetPlatformFile(), |
+ base::Bind(&ProcessOutputWatcher::OnProcessOutputCanReadWithoutBlocking, |
+ base::Unretained(this))); |
} |
void ProcessOutputWatcher::ReadFromFd(int fd) { |