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

Unified Diff: components/arc/standalone/service_helper.h

Issue 2391743002: Use FileDescriptorWatcher in ServiceHelper. (Closed)
Patch Set: self-review Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/arc/standalone/service_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/arc/standalone/service_helper.h
diff --git a/components/arc/standalone/service_helper.h b/components/arc/standalone/service_helper.h
index 3a878c295eb0b09f0959caf7d3ab1ee50ddfb6c8..3b6b28e42de9bc77ef14e48d55f9c94daa0655e1 100644
--- a/components/arc/standalone/service_helper.h
+++ b/components/arc/standalone/service_helper.h
@@ -7,25 +7,25 @@
#include <signal.h>
+#include <memory>
+
+#include "base/files/file_descriptor_watcher_posix.h"
#include "base/files/scoped_file.h"
-#include "base/message_loop/message_loop.h"
namespace arc {
// Helper class to set up service-like processes.
-class ServiceHelper : public base::MessageLoopForIO::Watcher {
+class ServiceHelper {
public:
ServiceHelper();
- ~ServiceHelper() override;
+ ~ServiceHelper();
// Must be called after message loop instantiation.
void Init(const base::Closure& closure);
- // MessageLoopForIO::Watcher
- void OnFileCanReadWithoutBlocking(int fd) override;
- void OnFileCanWriteWithoutBlocking(int fd) override;
-
private:
+ void OnFileCanReadWithoutBlocking();
+
static void TerminationHandler(int /* signum */);
// Static variable to guarantee instantiated only once per process.
@@ -34,7 +34,7 @@ class ServiceHelper : public base::MessageLoopForIO::Watcher {
base::Closure closure_;
base::ScopedFD read_fd_;
base::ScopedFD write_fd_;
- base::MessageLoopForIO::FileDescriptorWatcher watcher_;
+ std::unique_ptr<base::FileDescriptorWatcher::Controller> watch_controller_;
struct sigaction old_sigint_;
struct sigaction old_sigterm_;
« no previous file with comments | « no previous file | components/arc/standalone/service_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698