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
tree: 26af6f4861bee58eeb2529681146252465f649a4
  1. init/
  2. policy_manager/
  3. .gitignore
  4. 99-gpio-dutflag.rules
  5. action.h
  6. action_mock.h
  7. action_pipe.h
  8. action_pipe_unittest.cc
  9. action_processor.cc
  10. action_processor.h
  11. action_processor_mock.h
  12. action_processor_unittest.cc
  13. action_unittest.cc
  14. build
  15. bzip.cc
  16. bzip.h
  17. bzip_extent_writer.cc
  18. bzip_extent_writer.h
  19. bzip_extent_writer_unittest.cc
  20. certificate_checker.cc
  21. certificate_checker.h
  22. certificate_checker_mock.h
  23. certificate_checker_unittest.cc
  24. chrome_browser_proxy_resolver.cc
  25. chrome_browser_proxy_resolver.h
  26. chrome_browser_proxy_resolver_unittest.cc
  27. clock.cc
  28. clock.h
  29. clock_interface.h
  30. connection_manager.cc
  31. connection_manager.h
  32. connection_manager_unittest.cc
  33. constants.cc
  34. constants.h
  35. cycle_breaker.cc
  36. cycle_breaker.h
  37. cycle_breaker_unittest.cc
  38. dbus_constants.h
  39. dbus_interface.h
  40. dbus_service.cc
  41. dbus_service.h
  42. delta_diff_generator.cc
  43. delta_diff_generator.h
  44. delta_diff_generator_unittest.cc
  45. delta_performer.cc
  46. delta_performer.h
  47. delta_performer_unittest.cc
  48. download_action.cc
  49. download_action.h
  50. download_action_unittest.cc
  51. error_code.h
  52. extent_mapper.cc
  53. extent_mapper.h
  54. extent_mapper_unittest.cc
  55. extent_ranges.cc
  56. extent_ranges.h
  57. extent_ranges_unittest.cc
  58. extent_writer.cc
  59. extent_writer.h
  60. extent_writer_unittest.cc
  61. fake_clock.h
  62. fake_hardware.h
  63. fake_p2p_manager.h
  64. fake_p2p_manager_configuration.h
  65. file_descriptor.cc
  66. file_descriptor.h
  67. file_writer.cc
  68. file_writer.h
  69. file_writer_mock.h
  70. file_writer_unittest.cc
  71. filesystem_copier_action.cc
  72. filesystem_copier_action.h
  73. filesystem_copier_action_unittest.cc
  74. filesystem_iterator.cc
  75. filesystem_iterator.h
  76. filesystem_iterator_unittest.cc
  77. full_update_generator.cc
  78. full_update_generator.h
  79. full_update_generator_unittest.cc
  80. gen_coverage_html
  81. generate_delta_main.cc
  82. gpio_handler.cc
  83. gpio_handler.h
  84. gpio_handler_unittest.cc
  85. gpio_handler_unittest.h
  86. gpio_mock_file_descriptor.cc
  87. gpio_mock_file_descriptor.h
  88. gpio_mock_udev_interface.cc
  89. gpio_mock_udev_interface.h
  90. graph_types.h
  91. graph_utils.cc
  92. graph_utils.h
  93. graph_utils_unittest.cc
  94. hardware.cc
  95. hardware.h
  96. hardware_interface.h
  97. http_common.cc
  98. http_common.h
  99. http_fetcher.cc
  100. http_fetcher.h
  101. http_fetcher_unittest.cc
  102. hwid_override.cc
  103. hwid_override.h
  104. hwid_override_unittest.cc
  105. inherit-review-settings-ok
  106. install_plan.cc
  107. install_plan.h
  108. libcurl_http_fetcher.cc
  109. libcurl_http_fetcher.h
  110. LICENSE
  111. local_coverage_rate
  112. main.cc
  113. metadata.cc
  114. metadata.h
  115. metadata_unittest.cc
  116. mock_connection_manager.h
  117. mock_dbus_interface.h
  118. mock_file_writer.h
  119. mock_gpio_handler.h
  120. mock_hardware.h
  121. mock_http_fetcher.cc
  122. mock_http_fetcher.h
  123. mock_p2p_manager.h
  124. mock_payload_state.h
  125. mock_system_state.cc
  126. mock_system_state.h
  127. multi_range_http_fetcher.cc
  128. multi_range_http_fetcher.h
  129. omaha_hash_calculator.cc
  130. omaha_hash_calculator.h
  131. omaha_hash_calculator_unittest.cc
  132. omaha_request_action.cc
  133. omaha_request_action.h
  134. omaha_request_action_unittest.cc
  135. omaha_request_params.cc
  136. omaha_request_params.h
  137. omaha_request_params_unittest.cc
  138. omaha_response.h
  139. omaha_response_handler_action.cc
  140. omaha_response_handler_action.h
  141. omaha_response_handler_action_unittest.cc
  142. p2p_manager.cc
  143. p2p_manager.h
  144. p2p_manager_unittest.cc
  145. payload_signer.cc
  146. payload_signer.h
  147. payload_signer_unittest.cc
  148. payload_state.cc
  149. payload_state.h
  150. payload_state_interface.h
  151. payload_state_unittest.cc
  152. postinstall_runner_action.cc
  153. postinstall_runner_action.h
  154. postinstall_runner_action_unittest.cc
  155. prefs.cc
  156. prefs.h
  157. prefs_interface.h
  158. prefs_mock.h
  159. prefs_unittest.cc
  160. proxy_resolver.cc
  161. proxy_resolver.h
  162. real_system_state.h
  163. run_unittests
  164. sample_omaha_v3_response.xml
  165. SConstruct
  166. setup_dev_packages
  167. simple_key_value_store.cc
  168. simple_key_value_store.h
  169. simple_key_value_store_unittest.cc
  170. subprocess.cc
  171. subprocess.h
  172. subprocess_unittest.cc
  173. system_state.cc
  174. system_state.h
  175. tarjan.cc
  176. tarjan.h
  177. tarjan_unittest.cc
  178. terminator.cc
  179. terminator.h
  180. terminator_unittest.cc
  181. test_http_server.cc
  182. test_utils.cc
  183. test_utils.h
  184. testrunner.cc
  185. topological_sort.cc
  186. topological_sort.h
  187. topological_sort_unittest.cc
  188. udev_interface.h
  189. unittest_key.pem
  190. unittest_key2.pem
  191. update_attempter.cc
  192. update_attempter.h
  193. update_attempter_mock.h
  194. update_attempter_unittest.cc
  195. update_check_scheduler.cc
  196. update_check_scheduler.h
  197. update_check_scheduler_unittest.cc
  198. update_engine.xml
  199. update_engine_client.cc
  200. update_metadata.proto
  201. UpdateEngine.conf
  202. utils.cc
  203. utils.h
  204. utils_unittest.cc
  205. WATCHLISTS
  206. zip_unittest.cc