shill: Prepare DNSClient and HTTPRequest for destroy-on-callback

Refactor both classes so that it's okay for the callback to destroy
the object (i.e., do nothing to the object after the callback is
called).  As a part of this, clean up some of the callback semantics,
so, for example, DNSClient callbacks are passed an Error reference
and an IP Address instead of having to use a getter.  Additionally
remove the blemish where an immediate timeout in Start() both returned
failure and called the callback.

BUG=chromium-os:23318
TEST=Fixed unit tests, manual

Change-Id: Ib7787a7aa6f7f3d00caa539d6b0221ff5f3d60b3
Reviewed-on: https://gerrit.chromium.org/gerrit/16435
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
14 files changed
tree: 38ddcea4237562f5c7749b45c6d7eb8b5c4e2b28
  1. dbus_bindings/
  2. .gitignore
  3. accessor_interface.h
  4. adaptor_interfaces.h
  5. async_call_handler.cc
  6. async_call_handler.h
  7. async_connection.cc
  8. async_connection.h
  9. async_connection_unittest.cc
  10. byte_string.cc
  11. byte_string.h
  12. byte_string_unittest.cc
  13. callback_list.cc
  14. callback_list.h
  15. callback_list_unittest.cc
  16. cellular.cc
  17. cellular.h
  18. cellular_capability.cc
  19. cellular_capability.h
  20. cellular_capability_cdma.cc
  21. cellular_capability_cdma.h
  22. cellular_capability_cdma_unittest.cc
  23. cellular_capability_gsm.cc
  24. cellular_capability_gsm.h
  25. cellular_capability_gsm_unittest.cc
  26. cellular_capability_unittest.cc
  27. cellular_error.cc
  28. cellular_error.h
  29. cellular_service.cc
  30. cellular_service.h
  31. cellular_service_unittest.cc
  32. cellular_unittest.cc
  33. connection.cc
  34. connection.h
  35. connection_unittest.cc
  36. control_interface.h
  37. crypto_des_cbc.cc
  38. crypto_des_cbc.h
  39. crypto_des_cbc_unittest.cc
  40. crypto_interface.h
  41. crypto_provider.cc
  42. crypto_provider.h
  43. crypto_provider_unittest.cc
  44. crypto_rot47.cc
  45. crypto_rot47.h
  46. crypto_rot47_unittest.cc
  47. dbus_adaptor.cc
  48. dbus_adaptor.h
  49. dbus_adaptor_unittest.cc
  50. dbus_control.cc
  51. dbus_control.h
  52. dbus_properties.cc
  53. dbus_properties.h
  54. dbus_properties_proxy.cc
  55. dbus_properties_proxy.h
  56. dbus_properties_proxy_interface.h
  57. dbus_properties_unittest.cc
  58. default_profile.cc
  59. default_profile.h
  60. default_profile_unittest.cc
  61. device.cc
  62. device.h
  63. device_dbus_adaptor.cc
  64. device_dbus_adaptor.h
  65. device_info.cc
  66. device_info.h
  67. device_info_unittest.cc
  68. device_stub.h
  69. device_unittest.cc
  70. dhcp_config.cc
  71. dhcp_config.h
  72. dhcp_config_unittest.cc
  73. dhcp_provider.cc
  74. dhcp_provider.h
  75. dhcp_provider_unittest.cc
  76. dhcp_proxy_interface.h
  77. dhcpcd_proxy.cc
  78. dhcpcd_proxy.h
  79. dns_client.cc
  80. dns_client.h
  81. dns_client_unittest.cc
  82. endpoint.cc
  83. endpoint.h
  84. ephemeral_profile.cc
  85. ephemeral_profile.h
  86. error.cc
  87. error.h
  88. error_unittest.cc
  89. ethernet.cc
  90. ethernet.h
  91. ethernet_service.cc
  92. ethernet_service.h
  93. event_dispatcher.cc
  94. event_dispatcher.h
  95. glib.cc
  96. glib.h
  97. glib_io_input_handler.cc
  98. glib_io_input_handler.h
  99. glib_io_ready_handler.cc
  100. glib_io_ready_handler.h
  101. HACKING
  102. http_proxy.cc
  103. http_proxy.h
  104. http_proxy_unittest.cc
  105. http_request.cc
  106. http_request.h
  107. http_request_unittest.cc
  108. http_url.cc
  109. http_url.h
  110. http_url_unittest.cc
  111. ieee80211.h
  112. io_handler.h
  113. ip_address.cc
  114. ip_address.h
  115. ip_address_unittest.cc
  116. ipconfig.cc
  117. ipconfig.h
  118. ipconfig_dbus_adaptor.cc
  119. ipconfig_dbus_adaptor.h
  120. ipconfig_unittest.cc
  121. key_file_store.cc
  122. key_file_store.h
  123. key_file_store_unittest.cc
  124. key_value_store.cc
  125. key_value_store.h
  126. LICENSE
  127. Makefile
  128. manager.cc
  129. manager.h
  130. manager_dbus_adaptor.cc
  131. manager_dbus_adaptor.h
  132. manager_unittest.cc
  133. metrics.cc
  134. metrics.h
  135. metrics_unittest.cc
  136. mock_adaptors.cc
  137. mock_adaptors.h
  138. mock_ares.cc
  139. mock_ares.h
  140. mock_async_connection.cc
  141. mock_async_connection.h
  142. mock_callback.h
  143. mock_callback_unittest.cc
  144. mock_connection.cc
  145. mock_connection.h
  146. mock_control.cc
  147. mock_control.h
  148. mock_dbus_properties_proxy.cc
  149. mock_dbus_properties_proxy.h
  150. mock_device.cc
  151. mock_device.h
  152. mock_device_info.cc
  153. mock_device_info.h
  154. mock_dhcp_config.cc
  155. mock_dhcp_config.h
  156. mock_dhcp_provider.cc
  157. mock_dhcp_provider.h
  158. mock_dhcp_proxy.cc
  159. mock_dhcp_proxy.h
  160. mock_dns_client.cc
  161. mock_dns_client.h
  162. mock_event_dispatcher.cc
  163. mock_event_dispatcher.h
  164. mock_glib.cc
  165. mock_glib.h
  166. mock_http_request.cc
  167. mock_http_request.h
  168. mock_ipconfig.cc
  169. mock_ipconfig.h
  170. mock_manager.cc
  171. mock_manager.h
  172. mock_metrics.cc
  173. mock_metrics.h
  174. mock_modem_cdma_proxy.cc
  175. mock_modem_cdma_proxy.h
  176. mock_modem_gsm_card_proxy.cc
  177. mock_modem_gsm_card_proxy.h
  178. mock_modem_gsm_network_proxy.cc
  179. mock_modem_gsm_network_proxy.h
  180. mock_modem_manager_proxy.cc
  181. mock_modem_manager_proxy.h
  182. mock_modem_proxy.cc
  183. mock_modem_proxy.h
  184. mock_modem_simple_proxy.cc
  185. mock_modem_simple_proxy.h
  186. mock_power_manager_proxy.cc
  187. mock_power_manager_proxy.h
  188. mock_profile.cc
  189. mock_profile.h
  190. mock_property_store.cc
  191. mock_property_store.h
  192. mock_resolver.cc
  193. mock_resolver.h
  194. mock_routing_table.cc
  195. mock_routing_table.h
  196. mock_rtnl_handler.cc
  197. mock_rtnl_handler.h
  198. mock_service.cc
  199. mock_service.h
  200. mock_sockets.cc
  201. mock_sockets.h
  202. mock_store.cc
  203. mock_store.h
  204. mock_supplicant_bss_proxy.cc
  205. mock_supplicant_bss_proxy.h
  206. mock_supplicant_interface_proxy.cc
  207. mock_supplicant_interface_proxy.h
  208. mock_supplicant_process_proxy.cc
  209. mock_supplicant_process_proxy.h
  210. mock_time.cc
  211. mock_time.h
  212. mock_wifi.cc
  213. mock_wifi.h
  214. mock_wifi_service.cc
  215. mock_wifi_service.h
  216. modem.cc
  217. modem.h
  218. modem_cdma_proxy.cc
  219. modem_cdma_proxy.h
  220. modem_cdma_proxy_interface.h
  221. modem_gsm_card_proxy.cc
  222. modem_gsm_card_proxy.h
  223. modem_gsm_card_proxy_interface.h
  224. modem_gsm_network_proxy.cc
  225. modem_gsm_network_proxy.h
  226. modem_gsm_network_proxy_interface.h
  227. modem_info.cc
  228. modem_info.h
  229. modem_info_unittest.cc
  230. modem_manager.cc
  231. modem_manager.h
  232. modem_manager_proxy.cc
  233. modem_manager_proxy.h
  234. modem_manager_proxy_interface.h
  235. modem_manager_unittest.cc
  236. modem_proxy.cc
  237. modem_proxy.h
  238. modem_proxy_interface.h
  239. modem_simple_proxy.cc
  240. modem_simple_proxy.h
  241. modem_simple_proxy_interface.h
  242. modem_unittest.cc
  243. nice_mock_control.cc
  244. nice_mock_control.h
  245. portal_detector.cc
  246. portal_detector.h
  247. portal_detector_unittest.cc
  248. power_manager.cc
  249. power_manager.h
  250. power_manager_proxy.cc
  251. power_manager_proxy.h
  252. power_manager_proxy_interface.h
  253. power_manager_unittest.cc
  254. profile.cc
  255. profile.h
  256. profile_dbus_adaptor.cc
  257. profile_dbus_adaptor.h
  258. profile_dbus_property_exporter.cc
  259. profile_dbus_property_exporter.h
  260. profile_dbus_property_exporter_unittest.cc
  261. profile_unittest.cc
  262. property_accessor.h
  263. property_accessor_unittest.cc
  264. property_iterator.h
  265. property_store.cc
  266. property_store.h
  267. property_store_unittest.cc
  268. property_store_unittest.h
  269. provider_db_unittest.bfd
  270. proxy_factory.cc
  271. proxy_factory.h
  272. refptr_types.h
  273. resolver.cc
  274. resolver.h
  275. resolver_unittest.cc
  276. routing_table.cc
  277. routing_table.h
  278. routing_table_entry.h
  279. routing_table_unittest.cc
  280. rtnl_handler.cc
  281. rtnl_handler.h
  282. rtnl_handler_unittest.cc
  283. rtnl_listener.cc
  284. rtnl_listener.h
  285. rtnl_listener_unittest.cc
  286. rtnl_message.cc
  287. rtnl_message.h
  288. rtnl_message_unittest.cc
  289. service.cc
  290. service.h
  291. service_dbus_adaptor.cc
  292. service_dbus_adaptor.h
  293. service_sorter.h
  294. service_under_test.cc
  295. service_under_test.h
  296. service_unittest.cc
  297. shill.conf
  298. shill_ares.cc
  299. shill_ares.h
  300. shill_config.cc
  301. shill_config.h
  302. shill_daemon.cc
  303. shill_daemon.h
  304. shill_main.cc
  305. shill_test_config.cc
  306. shill_test_config.h
  307. shill_time.cc
  308. shill_time.h
  309. shill_unittest.cc
  310. sockets.cc
  311. sockets.h
  312. store_interface.h
  313. supplicant_bss_proxy.cc
  314. supplicant_bss_proxy.h
  315. supplicant_bss_proxy_interface.h
  316. supplicant_interface_proxy.cc
  317. supplicant_interface_proxy.h
  318. supplicant_interface_proxy_interface.h
  319. supplicant_process_proxy.cc
  320. supplicant_process_proxy.h
  321. supplicant_process_proxy_interface.h
  322. technology.cc
  323. technology.h
  324. TESTING
  325. testrunner.cc
  326. wifi.cc
  327. wifi.h
  328. wifi_endpoint.cc
  329. wifi_endpoint.h
  330. wifi_endpoint_unittest.cc
  331. wifi_service.cc
  332. wifi_service.h
  333. wifi_service_unittest.cc
  334. wifi_unittest.cc
  335. wpa_supplicant.cc
  336. wpa_supplicant.h