| Index: chromeos/process_proxy/process_output_watcher.h
|
| diff --git a/chromeos/process_proxy/process_output_watcher.h b/chromeos/process_proxy/process_output_watcher.h
|
| index 168c586a82dc0ce7e86ca02557bf1c1ee9a9ffc0..3b7f489aa2ebf1bbc5793416caf811a93bd59898 100644
|
| --- a/chromeos/process_proxy/process_output_watcher.h
|
| +++ b/chromeos/process_proxy/process_output_watcher.h
|
| @@ -7,13 +7,14 @@
|
|
|
| #include <stddef.h>
|
|
|
| +#include <memory>
|
| #include <string>
|
|
|
| #include "base/callback.h"
|
| #include "base/files/file.h"
|
| +#include "base/files/file_descriptor_watcher_posix.h"
|
| #include "base/macros.h"
|
| #include "base/memory/weak_ptr.h"
|
| -#include "base/message_loop/message_loop.h"
|
| #include "chromeos/chromeos_export.h"
|
|
|
| namespace chromeos {
|
| @@ -29,18 +30,16 @@ typedef base::Callback<void(ProcessOutputType,
|
|
|
| // Observes output on |out_fd| and invokes |callback| when some output is
|
| // detected. It assumes UTF8 output.
|
| -class CHROMEOS_EXPORT ProcessOutputWatcher
|
| - : public base::MessageLoopForIO::Watcher {
|
| +class CHROMEOS_EXPORT ProcessOutputWatcher {
|
| public:
|
| ProcessOutputWatcher(int out_fd, const ProcessOutputCallback& callback);
|
| - ~ProcessOutputWatcher() override;
|
| + ~ProcessOutputWatcher();
|
|
|
| void Start();
|
|
|
| private:
|
| - // MessageLoopForIO::Watcher overrides:
|
| - void OnFileCanReadWithoutBlocking(int fd) override;
|
| - void OnFileCanWriteWithoutBlocking(int fd) override;
|
| + // Called when |process_output_file_| is readable without blocking.
|
| + void OnProcessOutputCanReadWithoutBlocking();
|
|
|
| // Listens to output from fd passed to the constructor.
|
| void WatchProcessOutput();
|
| @@ -66,7 +65,7 @@ class CHROMEOS_EXPORT ProcessOutputWatcher
|
|
|
| // Contains file descsriptor to which watched process output is written.
|
| base::File process_output_file_;
|
| - base::MessageLoopForIO::FileDescriptorWatcher output_file_watcher_;
|
| + std::unique_ptr<base::FileDescriptorWatcher::Controller> output_file_watcher_;
|
|
|
| // Callback that will be invoked when some output is detected.
|
| ProcessOutputCallback on_read_callback_;
|
|
|