hashimoto | 5a58ebc | 2015-12-18 07:16:20 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROMEOS_BINDER_TRANSACTION_STATUS_H_ |
| 6 | #define CHROMEOS_BINDER_TRANSACTION_STATUS_H_ |
| 7 | |
avi | 6e1a22d | 2015-12-21 03:43:20 | [diff] [blame] | 8 | #include <stddef.h> |
| 9 | #include <stdint.h> |
| 10 | |
hashimoto | 5a58ebc | 2015-12-18 07:16:20 | [diff] [blame] | 11 | #include "base/macros.h" |
| 12 | #include "chromeos/binder/status.h" |
| 13 | #include "chromeos/binder/transaction_data.h" |
| 14 | #include "chromeos/chromeos_export.h" |
| 15 | |
| 16 | namespace binder { |
| 17 | |
| 18 | // TransactionData whose contents is a status code. |
| 19 | // Use this class to return an error for transactions. |
| 20 | // GetSenderPID() and GetSenderEUID() return 0. |
| 21 | class CHROMEOS_EXPORT TransactionStatus : public TransactionData { |
| 22 | public: |
| 23 | explicit TransactionStatus(Status status); |
| 24 | ~TransactionStatus() override; |
| 25 | |
| 26 | // TransactionData override: |
| 27 | uintptr_t GetCookie() const override; |
avi | 6e1a22d | 2015-12-21 03:43:20 | [diff] [blame] | 28 | uint32_t GetCode() const override; |
hashimoto | 5a58ebc | 2015-12-18 07:16:20 | [diff] [blame] | 29 | pid_t GetSenderPID() const override; |
| 30 | uid_t GetSenderEUID() const override; |
| 31 | bool IsOneWay() const override; |
| 32 | bool HasStatus() const override; |
| 33 | Status GetStatus() const override; |
| 34 | const void* GetData() const override; |
| 35 | size_t GetDataSize() const override; |
hashimoto | efaa412a | 2016-03-09 05:28:31 | [diff] [blame] | 36 | const binder_uintptr_t* GetObjectOffsets() const override; |
hashimoto | 5a58ebc | 2015-12-18 07:16:20 | [diff] [blame] | 37 | size_t GetNumObjectOffsets() const override; |
| 38 | |
| 39 | private: |
| 40 | Status status_; |
| 41 | DISALLOW_COPY_AND_ASSIGN(TransactionStatus); |
| 42 | }; |
| 43 | |
| 44 | } // namespace binder |
| 45 | |
| 46 | #endif // CHROMEOS_BINDER_TRANSACTION_STATUS_H_ |