blob: 27cafa31425c4e1f9b59b69742bff453fec08bfd [file] [log] [blame]
hashimoto5a58ebc2015-12-18 07:16:201// 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
avi6e1a22d2015-12-21 03:43:208#include <stddef.h>
9#include <stdint.h>
10
hashimoto5a58ebc2015-12-18 07:16:2011#include "base/macros.h"
12#include "chromeos/binder/status.h"
13#include "chromeos/binder/transaction_data.h"
14#include "chromeos/chromeos_export.h"
15
16namespace 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.
21class 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;
avi6e1a22d2015-12-21 03:43:2028 uint32_t GetCode() const override;
hashimoto5a58ebc2015-12-18 07:16:2029 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;
hashimotoefaa412a2016-03-09 05:28:3136 const binder_uintptr_t* GetObjectOffsets() const override;
hashimoto5a58ebc2015-12-18 07:16:2037 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_