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.
12 TransactionCommand
::TransactionCommand(TransactionCommand
::Type type
)
13 : command_(type
== TWO_WAY ? BC_TRANSACTION
: BC_REPLY
) {
16 TransactionCommand
::~TransactionCommand() {}
18 void TransactionCommand
::SetCode(uint32_t code
) {
19 transaction_
.code
= code
;
22 void TransactionCommand
::SetHandle(uint32_t handle
) {
23 transaction_
.target
.handle
= handle
;
26 void TransactionCommand
::SetParcel(const Parcel
& parcel
) {
27 transaction_
.data_size
= parcel
.DataSize();
28 transaction_
.data
.ptr
.buffer
= parcel
.DataPointer();
31 size_t TransactionCommand
::GetSize() const {
32 return sizeof(command_
) + sizeof(transaction_
);
35 binder_uintptr_t TransactionCommand
::GetData() const {
36 return reinterpret_cast<binder_uintptr_t
>(&command_
);
39 } // namespace minibind