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

Unified Diff: chromeos/binder/ipc_thread.h

Issue 1575313002: Add CommandBroker::OnTransaction to handle incoming transactions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment Created 4 years, 11 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 | « chromeos/binder/end_to_end_unittest.cc ('k') | chromeos/binder/ipc_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/binder/ipc_thread.h
diff --git a/chromeos/binder/ipc_thread.h b/chromeos/binder/ipc_thread.h
new file mode 100644
index 0000000000000000000000000000000000000000..a8c47261aff6dfbc560c0a889a039026d13b9cac
--- /dev/null
+++ b/chromeos/binder/ipc_thread.h
@@ -0,0 +1,54 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMEOS_BINDER_IPC_THREAD_H_
+#define CHROMEOS_BINDER_IPC_THREAD_H_
+
+#include "base/macros.h"
+#include "base/message_loop/message_loop.h"
+#include "base/threading/thread.h"
+#include "chromeos/chromeos_export.h"
+
+namespace binder {
+
+class CommandBroker;
+class Driver;
+
+// IpcThread manages binder-related resources (e.g. binder driver FD) and
+// handles incoming binder commands.
+class CHROMEOS_EXPORT IpcThread : public base::Thread,
+ public base::MessageLoopForIO::Watcher {
+ public:
+ IpcThread();
+ ~IpcThread() override;
+
+ Driver* driver() { return driver_.get(); }
+ CommandBroker* command_broker() { return command_broker_.get(); }
+ bool initialized() const { return initialized_; }
+
+ // Starts this thread.
+ // Returns true on success.
+ bool Start();
+
+ // base::MessageLoopIO::Watcher overrides:
+ void OnFileCanReadWithoutBlocking(int fd) override;
+ void OnFileCanWriteWithoutBlocking(int fd) override;
+
+ protected:
+ // base::Thread overrides:
+ void Init() override;
+ void CleanUp() override;
+
+ private:
+ scoped_ptr<Driver> driver_;
+ scoped_ptr<CommandBroker> command_broker_;
+ scoped_ptr<base::MessageLoopForIO::FileDescriptorWatcher> watcher_;
+ bool initialized_ = false;
+
+ DISALLOW_COPY_AND_ASSIGN(IpcThread);
+};
+
+} // namespace binder
+
+#endif // CHROMEOS_BINDER_IPC_THREAD_H_
« no previous file with comments | « chromeos/binder/end_to_end_unittest.cc ('k') | chromeos/binder/ipc_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698