Age | Commit message (Collapse) | Author |
|
This patch breaks the dependency between the BinderWatcher and the
base::MessageLoopForIO implementation, making it use the
brillo::MessageLoop class instead.
Bug: 26356682
TEST=Binder based `update_engine_client` still works.
Change-Id: I46a8a9c8d00d536c2d54889017f109c581eb0bc7
|
|
This makes using base::Value less painful of an experience.
BUG: 26558300
Change-Id: I6e202b863e049f33643c6547f9710991f2c56240
|
|
This CL moves the logic in DBusDaemon to a helper class that can be
included in another class inheriting from Daemon without needed to use
multiple inheritance nor forcing a DBus connection to succeed.
DBusDaemon was modified to re-use this class without changing its
behaviour to be compatible with existing code.
Bug: 26690086
TEST=mm; Update update_engine to use this class and tested it on edison.
Change-Id: If05a5582158552b6aeebf86dbde2aaa161f5a29f
|
|
The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.
Change-Id: If39615b805ec50b9487b6327702c4cdbbd21b7ee
|
|
When building for the host, disable the binder file descriptor
detection workaround since we don't use binder on the host and the
required modules are not always available.
Bug: None
TEST=`mmma external/libbrillo` on linux and mac.
Change-Id: I36e2786ff036bc3cd01780ae50c242baf407a0a8
|
|
The binder driver polling mechanism doesn't work well with epoll. In
particular, you can't add the binder file descriptor to epoll (with
EPOLL_CTL_ADD) when there's work to do in the binder driver, then
wait for it when there isn't any more work to do.
To avoid this situation, we only add the binder file descriptor at the
beginning and never try to remove and add it back when running
callbacks for it.
Bug: 26524111
TEST=unittests for parsing.
TEST=Tested with an example service, strace shows the binder fd is not added/removed each time.
Change-Id: I11d6af5593fa78631f80e9ba09d933f4b8ef70df
|
|
Tests using tags from the __PRETTY_FUNCTION__ don't work when using
RTTI to get the type name since the format is different.
This CL disables those tests as they check the proper parsing of a
function not used when USE_RTTI_FOR_TYPE_TAGS is defined.
Bug: 26292405
TEST=FEATURES=test emerge-link libbrillog
Change-Id: I7c3383359bc16faebd493f3da003663916be390d
|
|
The main reason why we needed run-time type information is so that
we can get a type name string for a particular type T. This string
was used in type comparisons in brillo::Any as the only reliable way
of determining if two Any instances have values of the same type.
For this typeid(T).name() was used which requires RTTI to be enabled.
However using RTTI causes issues when linking to libraries with RTTI
disabled. To resolve this issue, stop relying on RTTI in libbrillo
and throughout the rest of Brillo code.
A special work-around was implemented to obtain a type name for
a given type, which relies on the fact that __PRETTY_FUNCTION__ macro
on GCC/clang includes the full signature of a method, including any
template parameters.
For example, brillo::GetTypeTag<double>() would return
const char *brillo::GetTypeTag() [T = double]
and extracting the type name ("double") is just a matter of simple
string manipulations.
To speed up the code at run-time, we don't really need to extract
the type name from this function name when comparing two types, but
rather compare the two function names directly. This function name
with embedded type is called "type tag" in the code.
Unfortunately GCC and CLANG handle __PRETTY_FUNCTION__ differently
for certain template types, so added #error statement to force
compiling using clang only (since this is the compiler used most
often for Brillo targets).
BUG: 26292405
Change-Id: Ie70012b62f66911ee7787e5cf7eeab88359bd959
|
|
Bug: 26379664
Test: Compiles
Change-Id: I67658ba9ceb8b769c97f0c345f7711bc96d27a84
|
|
Extend the brillo::Process API to support some sandboxing
options.
BUG: 26190154
Change-Id: I6d657ee2afda20d18d6286b132c9143dce0ffc9d
|
|
This allows the caller to specify whether the child process
should reset its signal mask or not.
Bug: None
BUG=chrome-os-partner:47785
TEST=Manual test using shill
Change-Id: I584c4790fc402624345b39fb6fa78308d6897c85
|
|
We are using stat in the unit tests which is available under two
different path on Chromium OS (/usr/bin/stat) and Android
(/system/bin/stat).
Bug: 26181888
Test: unit tests pass on Android.
Test: unit tests pass on Chromium OS.
Change-Id: I9374e1d8b962b7cf310bbba15adab9d99804c5a5
|
|
The unused file descriptor tests were flaky because they had a 10ms
sleep were the child process was supposed to run. While 10ms is
typically enough for that, our builders run at a high load at 10ms
could not be enough.
This patch uses a different approach to test the same behavior by
checking if the file descriptors are available from the same child
process. It also fixes a fd leak by used a ScopedPipe.
Bug: None
TEST=FEATURES=test emerge-link libbrillo
Change-Id: I53d529c5dbebbfa1af4cc858d76a200d3344d3ff
|
|
Currently, we're leaking all opened file descriptors from the
parent process to the child process. This causes undesired side
effects where the file descriptors in the parent might get into
a weird state (e.g. file is ready for read without any data).
Fix this by allowing the caller to set a flag, so that unused file
descriptors inherited from parent will get closed when starting
the child process. Default it to false for now to avoid causing
any unexpected side effects for other callers.
Bug: None
BUG=chromium:567357
TEST=new unit tests
TEST=Manual test
Change-Id: Icf13c4832305096c54e013872360f1da6ee65fb8
|
|
Instead of using the default CA certificates, libbrillo should use the
restricted list of certificates installed in
/system/etc/security/cacerts_google.
Bug: 25797832
Test: manual: Enable the verbose mode of libcurl.
* The certificates used are correct.
* POSTing to a google server works.
* POSTing to a CA in the default CA list but not in the restricted
list fails on the certificate verification step.
Test: manual: The ledflasher example works.
Change-Id: If3b836a2fa461ba3103e05c60e5630c8c919d1f3
|
|
Allow callers to remove a tracked pid if tracking is
no longer desired (e.g., if the caller has reaped the
process themselves.)
BUG=chromium:535910
Change-Id: Ie056c54a66c5aed539d2a77a41135f9b2da66582
|
|
Renamed libchromeos[-.*] libraries into libbrillo-...
BUG: 24872993
Change-Id: Ibab1623b6a08a55cae3662e941d0d6644ff14df4
|
|
Apparently some of the unit tests for libchromeos weren't being
compiled on Brillo/Android. Add them to the make file and make
a few tweaks to make sure they compile successfully.
Change-Id: I324d4bb0b89ac96e564cd107a5bb3751ebd4b9ae
|
|
The expected error message relied too much on demangling of std::string.
On Android, it shows as std::__1::basic_string<...>. So just use a
rough regex to match the error message but do not use it verbatim.
Change-Id: I2c6c7810bf028118cf2ebeb7bd04f47d1da835e5
|
|
Any normally embeds small data objects (with the size of up to
double). This test verifies that larger objects are stored externally.
However 10 bytes is not large enough and on some platform due to data
alignment/padding a bit larger data than that of double can still be
stored inside Any itself. Use 20 bytes to guarantee that Any cannot
contain the buffer of that size inside.
Change-Id: Iceaa0efbc74570f17d2cc70aa8d6537cc8bd2be5
|
|
std::type_info::operator==() uses pointers to type names on some
implementations (e.g. gcc with __GXX_MERGED_TYPEINFO_NAMES defined).
This leads to problems such that types created in different translation
units could be treated as different even though they refer to the
same type.
Working with type_info directly seems unreliable and names of the
types should be used in comparisons directly.
Fixed the implementation of Any::IsTypeCompatible<T>() to use type
names and remove Any::GetType() to avoid any future problems for
client code to compare the type information manually.
Added Any::GetTypeName() and Any::GetUndecoratedTypeName() for
convenience.
BUG: 25132472
Change-Id: I8ba27a611c8edad2260dbed1c2f15633c8b3a3fe
|
|
When building for Android, do not use the minijail_run_pid_pipe* API
funtions that use LD_PRELOAD. Instead, use the *_no_preload versions
of these functions.
While there, replace the use of minijail_run_pid_pipe() with
minijail_run_pid_pipes().
BUG: 24577038
Change-Id: Ie29a0f762e7810587f49199679dcc9d90acd465d
TEST: unit tests pass.
|
|
daemon.cc has these renamed, but not daemon.h. Not sure how this
compiled locally.
Change-Id: Ia7efed2764dc1d8580cfa9f16518459ec3732be6
|
|
And move the include files into "brillo" directory instead of "chromeos"
BUG: 24872993
TEST=built aosp and brillo and unit tests pass on dragonoboard
Change-Id: Ieb979d1ebd3152921d36cd15acbd6247f02aae69
|