| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CHROMEOS_BINDER_COMMAND_STREAM_H_ | 5 #ifndef CHROMEOS_BINDER_COMMAND_STREAM_H_ |
| 6 #define CHROMEOS_BINDER_COMMAND_STREAM_H_ | 6 #define CHROMEOS_BINDER_COMMAND_STREAM_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // Stream of incoming (binder driver to user process) BR_* commands and outgoing | 25 // Stream of incoming (binder driver to user process) BR_* commands and outgoing |
| 26 // (user process to binder driver) BC_* commands. | 26 // (user process to binder driver) BC_* commands. |
| 27 class CHROMEOS_EXPORT CommandStream { | 27 class CHROMEOS_EXPORT CommandStream { |
| 28 public: | 28 public: |
| 29 // IncomingCommandHandler is responsible to handle incoming commands. | 29 // IncomingCommandHandler is responsible to handle incoming commands. |
| 30 class IncomingCommandHandler { | 30 class IncomingCommandHandler { |
| 31 public: | 31 public: |
| 32 virtual ~IncomingCommandHandler() {} | 32 virtual ~IncomingCommandHandler() {} |
| 33 // TODO(hashimoto): Add methods to handle incoming commands. | 33 // TODO(hashimoto): Add methods to handle incoming commands. |
| 34 | 34 |
| 35 // Called to handle BR_TRANSACTION. |
| 36 // |data| contains the parameters. |
| 37 virtual bool OnTransaction(const TransactionData& data) = 0; |
| 38 |
| 35 // Called to handle BR_REPLY. | 39 // Called to handle BR_REPLY. |
| 36 // |data| is the reply for the previous transaction. | 40 // |data| is the reply for the previous transaction. |
| 37 virtual void OnReply(scoped_ptr<TransactionData> data) = 0; | 41 virtual void OnReply(scoped_ptr<TransactionData> data) = 0; |
| 38 | 42 |
| 39 // Called to handle BR_DEAD_REPLY. | 43 // Called to handle BR_DEAD_REPLY. |
| 40 virtual void OnDeadReply() = 0; | 44 virtual void OnDeadReply() = 0; |
| 41 | 45 |
| 42 // Called to handle BR_TRANSACTION_COMPLETE. | 46 // Called to handle BR_TRANSACTION_COMPLETE. |
| 43 virtual void OnTransactionComplete() = 0; | 47 virtual void OnTransactionComplete() = 0; |
| 44 | 48 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 scoped_ptr<BufferReader> incoming_data_reader_; | 100 scoped_ptr<BufferReader> incoming_data_reader_; |
| 97 | 101 |
| 98 base::WeakPtrFactory<CommandStream> weak_ptr_factory_; | 102 base::WeakPtrFactory<CommandStream> weak_ptr_factory_; |
| 99 | 103 |
| 100 DISALLOW_COPY_AND_ASSIGN(CommandStream); | 104 DISALLOW_COPY_AND_ASSIGN(CommandStream); |
| 101 }; | 105 }; |
| 102 | 106 |
| 103 } // namespace binder | 107 } // namespace binder |
| 104 | 108 |
| 105 #endif // CHROMEOS_BINDER_COMMAND_STREAM_H_ | 109 #endif // CHROMEOS_BINDER_COMMAND_STREAM_H_ |
| OLD | NEW |