From c5ffb8b1461938b73d077f77fd0988f6860a2295 Mon Sep 17 00:00:00 2001 From: hashimoto Date: Tue, 8 Mar 2016 19:19:31 -0800 Subject: Always build binder code Regardless of use_binder's value, build binder code. Tests are still built only when use_binder==1. BUG=563282 Review URL: https://codereview.chromium.org/1563263004 Cr-Commit-Position: refs/heads/master@{#380049} --- chromeos/BUILD.gn | 7 +-- chromeos/binder/DEPS | 3 + chromeos/binder/binder_driver_api.h | 16 +++++ chromeos/binder/command_broker.cc | 2 +- chromeos/binder/command_stream.cc | 2 +- chromeos/binder/command_stream_unittest.cc | 4 +- chromeos/binder/driver.cc | 2 +- chromeos/binder/transaction_data_from_driver.h | 4 +- .../binder/transaction_data_read_write_unittest.cc | 4 +- chromeos/binder/transaction_data_reader.cc | 3 +- chromeos/binder/util.cc | 5 +- chromeos/binder/writable_transaction_data.cc | 3 +- chromeos/chromeos.gyp | 73 ++++++++++------------ 13 files changed, 63 insertions(+), 65 deletions(-) create mode 100644 chromeos/binder/DEPS create mode 100644 chromeos/binder/binder_driver_api.h (limited to 'chromeos') diff --git a/chromeos/BUILD.gn b/chromeos/BUILD.gn index b7203f0..83c04f6 100644 --- a/chromeos/BUILD.gn +++ b/chromeos/BUILD.gn @@ -46,11 +46,8 @@ component("chromeos") { ] sources = gypi_values.chromeos_sources defines = [ "CHROMEOS_IMPLEMENTATION" ] - if (use_binder) { - if (target_cpu == "arm" || target_cpu == "x86") { - defines += [ "BINDER_IPC_32BIT" ] - } - sources += gypi_values.chromeos_binder_sources + if (target_cpu == "arm" || target_cpu == "x86") { + defines += [ "BINDER_IPC_32BIT" ] } } diff --git a/chromeos/binder/DEPS b/chromeos/binder/DEPS new file mode 100644 index 0000000..9d431c6 --- /dev/null +++ b/chromeos/binder/DEPS @@ -0,0 +1,3 @@ +include_rules = [ + "+chromeos/third_party/android_bionic_libc", +] diff --git a/chromeos/binder/binder_driver_api.h b/chromeos/binder/binder_driver_api.h new file mode 100644 index 0000000..332af22 --- /dev/null +++ b/chromeos/binder/binder_driver_api.h @@ -0,0 +1,16 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Include this header for types and constants used by the kernel binder driver. + +#ifndef CHROMEOS_BINDER_BINDER_DRIVER_API_H_ +#define CHROMEOS_BINDER_BINDER_DRIVER_API_H_ + +// binder.h needs __packed to be defined. +#define __packed __attribute__((__packed__)) + +#include +#include "chromeos/third_party/android_bionic_libc/kernel/uapi/linux/binder.h" + +#endif // CHROMEOS_BINDER_BINDER_DRIVER_API_H_ diff --git a/chromeos/binder/command_broker.cc b/chromeos/binder/command_broker.cc index fddddb1..f4a74f1 100644 --- a/chromeos/binder/command_broker.cc +++ b/chromeos/binder/command_broker.cc @@ -4,12 +4,12 @@ #include "chromeos/binder/command_broker.h" -#include #include #include #include "base/bind.h" #include "base/logging.h" +#include "chromeos/binder/binder_driver_api.h" #include "chromeos/binder/driver.h" #include "chromeos/binder/local_object.h" #include "chromeos/binder/transaction_data.h" diff --git a/chromeos/binder/command_stream.cc b/chromeos/binder/command_stream.cc index 89f8ced..6419afb 100644 --- a/chromeos/binder/command_stream.cc +++ b/chromeos/binder/command_stream.cc @@ -4,11 +4,11 @@ #include "chromeos/binder/command_stream.h" -#include #include #include #include "base/bind.h" +#include "chromeos/binder/binder_driver_api.h" #include "chromeos/binder/buffer_reader.h" #include "chromeos/binder/driver.h" #include "chromeos/binder/transaction_data.h" diff --git a/chromeos/binder/command_stream_unittest.cc b/chromeos/binder/command_stream_unittest.cc index 16c3083..74c5ce6 100644 --- a/chromeos/binder/command_stream_unittest.cc +++ b/chromeos/binder/command_stream_unittest.cc @@ -2,10 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include -#include - #include "base/message_loop/message_loop.h" +#include "chromeos/binder/binder_driver_api.h" #include "chromeos/binder/command_stream.h" #include "chromeos/binder/constants.h" #include "chromeos/binder/driver.h" diff --git a/chromeos/binder/driver.cc b/chromeos/binder/driver.cc index f07c96f..dc15ebe 100644 --- a/chromeos/binder/driver.cc +++ b/chromeos/binder/driver.cc @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -15,6 +14,7 @@ #include "base/posix/eintr_wrapper.h" #include "base/threading/thread_restrictions.h" +#include "chromeos/binder/binder_driver_api.h" namespace binder { diff --git a/chromeos/binder/transaction_data_from_driver.h b/chromeos/binder/transaction_data_from_driver.h index c2a248f..0ddf43f 100644 --- a/chromeos/binder/transaction_data_from_driver.h +++ b/chromeos/binder/transaction_data_from_driver.h @@ -7,13 +7,11 @@ #include #include -#include - -#include #include "base/callback.h" #include "base/macros.h" #include "base/memory/ref_counted.h" +#include "chromeos/binder/binder_driver_api.h" #include "chromeos/binder/transaction_data.h" #include "chromeos/chromeos_export.h" diff --git a/chromeos/binder/transaction_data_read_write_unittest.cc b/chromeos/binder/transaction_data_read_write_unittest.cc index 37ec649..e636961 100644 --- a/chromeos/binder/transaction_data_read_write_unittest.cc +++ b/chromeos/binder/transaction_data_read_write_unittest.cc @@ -4,9 +4,6 @@ #include #include -#include - -#include #include @@ -17,6 +14,7 @@ #include "base/files/scoped_temp_dir.h" #include "base/message_loop/message_loop.h" #include "base/strings/utf_string_conversions.h" +#include "chromeos/binder/binder_driver_api.h" #include "chromeos/binder/command_broker.h" #include "chromeos/binder/driver.h" #include "chromeos/binder/local_object.h" diff --git a/chromeos/binder/transaction_data_reader.cc b/chromeos/binder/transaction_data_reader.cc index b1006ab..91e0f91 100644 --- a/chromeos/binder/transaction_data_reader.cc +++ b/chromeos/binder/transaction_data_reader.cc @@ -7,9 +7,8 @@ #include #include -#include - #include "base/logging.h" +#include "chromeos/binder/binder_driver_api.h" #include "chromeos/binder/local_object.h" #include "chromeos/binder/object.h" #include "chromeos/binder/remote_object.h" diff --git a/chromeos/binder/util.cc b/chromeos/binder/util.cc index 49736b5..afbbda5 100644 --- a/chromeos/binder/util.cc +++ b/chromeos/binder/util.cc @@ -4,11 +4,8 @@ #include "chromeos/binder/util.h" -#include - -#include - #include "base/logging.h" +#include "chromeos/binder/binder_driver_api.h" namespace binder { diff --git a/chromeos/binder/writable_transaction_data.cc b/chromeos/binder/writable_transaction_data.cc index a89042e..5e56268 100644 --- a/chromeos/binder/writable_transaction_data.cc +++ b/chromeos/binder/writable_transaction_data.cc @@ -4,8 +4,7 @@ #include "chromeos/binder/writable_transaction_data.h" -#include - +#include "chromeos/binder/binder_driver_api.h" #include "chromeos/binder/constants.h" #include "chromeos/binder/local_object.h" #include "chromeos/binder/object.h" diff --git a/chromeos/chromeos.gyp b/chromeos/chromeos.gyp index 9b76232..049a542 100644 --- a/chromeos/chromeos.gyp +++ b/chromeos/chromeos.gyp @@ -28,6 +28,36 @@ 'audio/chromeos_sounds.h', 'audio/cras_audio_handler.cc', 'audio/cras_audio_handler.h', + 'binder/buffer_reader.cc', + 'binder/buffer_reader.h', + 'binder/command_broker.cc', + 'binder/command_broker.h', + 'binder/command_stream.cc', + 'binder/command_stream.h', + 'binder/constants.h', + 'binder/driver.cc', + 'binder/driver.h', + 'binder/ipc_thread.cc', + 'binder/ipc_thread.h', + 'binder/local_object.cc', + 'binder/local_object.h', + 'binder/object.h', + 'binder/remote_object.cc', + 'binder/remote_object.h', + 'binder/service_manager_proxy.cc', + 'binder/service_manager_proxy.h', + 'binder/status.h', + 'binder/transaction_data.h', + 'binder/transaction_data_from_driver.cc', + 'binder/transaction_data_from_driver.h', + 'binder/transaction_data_reader.cc', + 'binder/transaction_data_reader.h', + 'binder/transaction_status.cc', + 'binder/transaction_status.h', + 'binder/util.cc', + 'binder/util.h', + 'binder/writable_transaction_data.cc', + 'binder/writable_transaction_data.h', 'cert_loader.cc', 'cert_loader.h', 'chromeos_constants.cc', @@ -388,38 +418,6 @@ 'tpm/tpm_token_loader.cc', 'tpm/tpm_token_loader.h' ], - 'chromeos_binder_sources': [ - 'binder/buffer_reader.cc', - 'binder/buffer_reader.h', - 'binder/command_broker.cc', - 'binder/command_broker.h', - 'binder/command_stream.cc', - 'binder/command_stream.h', - 'binder/constants.h', - 'binder/driver.cc', - 'binder/driver.h', - 'binder/ipc_thread.cc', - 'binder/ipc_thread.h', - 'binder/local_object.cc', - 'binder/local_object.h', - 'binder/object.h', - 'binder/remote_object.cc', - 'binder/remote_object.h', - 'binder/service_manager_proxy.cc', - 'binder/service_manager_proxy.h', - 'binder/status.h', - 'binder/transaction_data.h', - 'binder/transaction_data_from_driver.cc', - 'binder/transaction_data_from_driver.h', - 'binder/transaction_data_reader.cc', - 'binder/transaction_data_reader.h', - 'binder/transaction_status.cc', - 'binder/transaction_status.h', - 'binder/util.cc', - 'binder/util.h', - 'binder/writable_transaction_data.cc', - 'binder/writable_transaction_data.h', - ], 'chromeos_binder_test_sources': [ 'binder/buffer_reader_unittest.cc', 'binder/command_broker_unittest.cc', @@ -537,14 +535,9 @@ ], 'sources': [ '<@(chromeos_sources)' ], 'conditions': [ - ['use_binder == 1', { - 'sources': [ '<@(chromeos_binder_sources)' ], - 'conditions': [ - ['target_arch == "arm" or target_arch == "ia32"', { - 'defines': [ - 'BINDER_IPC_32BIT', - ], - }], + ['target_arch == "arm" or target_arch == "ia32"', { + 'defines': [ + 'BINDER_IPC_32BIT', ], }], ], -- cgit v1.1