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
),
17 TransactionCommand
::~TransactionCommand() {}
19 void TransactionCommand
::SetCode(uint32_t code
) {
20 transaction_
.code
= code
;
23 void TransactionCommand
::SetHandle(uint32_t handle
) {
24 transaction_
.target
.handle
= handle
;
27 void TransactionCommand
::SetParcel(const Parcel
& parcel
) {
28 transaction_
.data_size
= parcel
.DataSize();
29 transaction_
.data
.ptr
.buffer
= parcel
.DataPointer();
32 size_t TransactionCommand
::GetSize() const {
33 return sizeof(command_
) + sizeof(transaction_
);
36 binder_uintptr_t TransactionCommand
::GetData() const {
37 return reinterpret_cast<binder_uintptr_t
>(&command_
);
40 } // namespace minibind