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 #include "chromeos/binder/transaction_data_from_driver.h" | 5 #include "chromeos/binder/transaction_data_from_driver.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
15 #include "chromeos/binder/command_stream.h" | 15 #include "chromeos/binder/command_stream.h" |
16 | 16 |
17 namespace binder { | 17 namespace binder { |
18 | 18 |
19 TransactionDataFromDriver::TransactionDataFromDriver( | 19 TransactionDataFromDriver::TransactionDataFromDriver( |
20 const BufferDeleter& buffer_deleter) | 20 const BufferDeleter& buffer_deleter) |
21 : delete_task_runner_(base::ThreadTaskRunnerHandle::Get()), | 21 : delete_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
22 buffer_deleter_(buffer_deleter) { | 22 buffer_deleter_(buffer_deleter) { |
23 memset(&data_, 0, sizeof(data_)); | 23 memset(&data_, 0, sizeof(data_)); |
24 } | 24 } |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 const binder_uintptr_t* TransactionDataFromDriver::GetObjectOffsets() const { | 83 const binder_uintptr_t* TransactionDataFromDriver::GetObjectOffsets() const { |
84 return reinterpret_cast<const binder_uintptr_t*>(data_.data.ptr.offsets); | 84 return reinterpret_cast<const binder_uintptr_t*>(data_.data.ptr.offsets); |
85 } | 85 } |
86 | 86 |
87 size_t TransactionDataFromDriver::GetNumObjectOffsets() const { | 87 size_t TransactionDataFromDriver::GetNumObjectOffsets() const { |
88 DCHECK_EQ(0u, data_.offsets_size % sizeof(binder_size_t)); | 88 DCHECK_EQ(0u, data_.offsets_size % sizeof(binder_size_t)); |
89 return data_.offsets_size / sizeof(binder_size_t); | 89 return data_.offsets_size / sizeof(binder_size_t); |
90 } | 90 } |
91 | 91 |
92 } // namespace binder | 92 } // namespace binder |
OLD | NEW |