Cleanup DBus interface.
Prior to importing the DBus interface into the Policy Manager, this
removes some clutter and fixes some behaviors.
* Switch from using dbus_g_proxy_new_for_name_owner() to using
dbus_g_proxy_new_for_name() instead. This has been advised in the past
(see chromium:209102) as the _owner version is mostly used for binding
to interfaces that do not retain the well-known name. It is not
appropriate for our use cases, where the provider inhibits the
well-known location constantly, nor is it a good thing given that
providers (e.g. Chrome) could get recycled.
* More consistent abstraction for variadic DBus functions: (a) We now
distinguish between different numbers of input/output arguments by
appending these numbers to the names of interface functions (e.g.
ProxyCall_3_0 delegates 3 input arguments and zero outputs); (b) We
drop G_TYPE arguments and embed them as constants in the delegating
code. This makes more sense because these types are constants and
depend on the actual values, which are bound to predetermined C/C++
types anyway; (c) It is still possible to override such functions by
variating the types of actual arguments (currently not exercised).
* The above also shortens the argument list for several DBus interface
functions, saving us from needing to prune them to fit in mock methods
with a maximum of 10 arguments (as was previously necessary).
* Removed an unnecessary #include; better comments; more descriptive
argument names.
Other notable changes in client code:
* Some cleaup in chrome_browser_proxy_resolver.cc, removing unnecessary
functions and reverting the proxy reacquisition logic introduced in
CL:15693, which is now redundant.
BUG=None
TEST=Unit tests.
Change-Id: I8063bb3e35c34212a8be1ae507834c931ee5a0b0
Reviewed-on: https://chromium-review.googlesource.com/188560
Tested-by: Gilad Arnold <garnold@chromium.org>
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Commit-Queue: Gilad Arnold <garnold@chromium.org>
6 files changed