shill: StoreFactory: remove set_glib()

The reason we have GLib (the shill class) is so
that we can mock out calls to glib (the library).

As it turns out, though, the callers of
StoreFactory::CreateStore() never make use of
this abiility. That is: all of StoreFactory's
users work with a real GLib.

What's more, all the other code that instantiates
KeyFileStores also uses a real glib. So GLib's
ability to mock out calls to key-file related
methods is unnecessary.

And, in fact, the fact that we don't use MockGLib
with KeyFileStores isn't an accident. The reason is
that we only access the g_key*() functions via
KeyFileStore. And we already have a MockStore.

The places where we actually need a MockGLib are
things like DHCPConfig, which calls SourceRemove()
directly.

Anyway... As a first step towards removing key-file methods
from GLib, we remove the set_glib() method from StoreFactory.

This might seem curious, since hiding the GLib dependency
inside of StoreFactory seems suspect. And, in fact, that
hiding would be suspect. But it's just an interim step.
In short order, we will remove GLib from StoreFactory
entirely.

The primary purpose of this CL is simply to demonstrate
that all users of StoreFactory use a real GLib. Proving
that justifies removing key-file methods from GLib.

To do so, this CL does the following:
- Remove the GLib arg from CreateStore(). This prototype
  change forces us to update all the callers of
  CreateStore().
- Remove the GLib instances used by those callers. It should
  be evident that those instances are (real) GLib, rather than
  MockGLib.

Since we're removing the GLib instances, we also update some
tests to pass Manager a nullptr for the GLib* argument.

BUG=b:23386647
TEST=compile

Change-Id: I0c7a6e19f707c3777de019da2d161cf64e929dbc
Reviewed-on: https://chromium-review.googlesource.com/295576
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
6 files changed
tree: ea43c3513c04b98b1b0b530f1aaba30b50fa510e
  1. bin/
  2. cellular/
  3. dbus/
  4. dbus_bindings/
  5. dhcp/
  6. doc/
  7. ethernet/
  8. init/
  9. mobile_operator_db/
  10. net/
  11. pppoe/
  12. setup_wifi/
  13. shims/
  14. supplicant/
  15. test-scripts/
  16. udev/
  17. upstart/
  18. vpn/
  19. wifi/
  20. wimax/
  21. .gitignore
  22. accessor_interface.h
  23. active_link_monitor.cc
  24. active_link_monitor.h
  25. active_link_monitor_unittest.cc
  26. adaptor_interfaces.h
  27. arp_client.cc
  28. arp_client.h
  29. arp_client_test_helper.cc
  30. arp_client_test_helper.h
  31. arp_client_unittest.cc
  32. arp_packet.cc
  33. arp_packet.h
  34. arp_packet_unittest.cc
  35. async_connection.cc
  36. async_connection.h
  37. async_connection_unittest.cc
  38. callbacks.h
  39. certificate_file.cc
  40. certificate_file.h
  41. certificate_file_unittest.cc
  42. chromeos_daemon.cc
  43. chromeos_daemon.h
  44. chromeos_daemon_unittest.cc
  45. connection.cc
  46. connection.h
  47. connection_diagnostics.cc
  48. connection_diagnostics.h
  49. connection_diagnostics_unittest.cc
  50. connection_health_checker.cc
  51. connection_health_checker.h
  52. connection_health_checker_unittest.cc
  53. connection_info.cc
  54. connection_info.h
  55. connection_info_reader.cc
  56. connection_info_reader.h
  57. connection_info_reader_unittest.cc
  58. connection_info_unittest.cc
  59. connection_tester.cc
  60. connection_tester.h
  61. connection_tester_unittest.cc
  62. connection_unittest.cc
  63. connectivity_trial.cc
  64. connectivity_trial.h
  65. connectivity_trial_unittest.cc
  66. control_interface.h
  67. crypto_des_cbc.cc
  68. crypto_des_cbc.h
  69. crypto_des_cbc_unittest.cc
  70. crypto_interface.h
  71. crypto_provider.cc
  72. crypto_provider.h
  73. crypto_provider_unittest.cc
  74. crypto_rot47.cc
  75. crypto_rot47.h
  76. crypto_rot47_unittest.cc
  77. crypto_util_proxy.cc
  78. crypto_util_proxy.h
  79. crypto_util_proxy_unittest.cc
  80. dbus_adaptor.cc
  81. dbus_adaptor.h
  82. dbus_adaptor_unittest.cc
  83. dbus_async_call_helper.h
  84. dbus_control.cc
  85. dbus_control.h
  86. dbus_manager.cc
  87. dbus_manager.h
  88. dbus_manager_unittest.cc
  89. dbus_name_watcher.cc
  90. dbus_name_watcher.h
  91. dbus_name_watcher_unittest.cc
  92. dbus_properties.cc
  93. dbus_properties.h
  94. dbus_properties_proxy.cc
  95. dbus_properties_proxy.h
  96. dbus_properties_proxy_interface.h
  97. dbus_properties_unittest.cc
  98. dbus_property_matchers.h
  99. dbus_service_proxy.cc
  100. dbus_service_proxy.h
  101. dbus_service_proxy_interface.h
  102. dbus_variant_gmock_printer.cc
  103. dbus_variant_gmock_printer.h
  104. default_profile.cc
  105. default_profile.h
  106. default_profile_unittest.cc
  107. device.cc
  108. device.h
  109. device_claimer.cc
  110. device_claimer.h
  111. device_claimer_unittest.cc
  112. device_dbus_adaptor.cc
  113. device_dbus_adaptor.h
  114. device_info.cc
  115. device_info.h
  116. device_info_unittest.cc
  117. device_stub.h
  118. device_unittest.cc
  119. diagnostics_reporter.cc
  120. diagnostics_reporter.h
  121. diagnostics_reporter_unittest.cc
  122. dns_client.cc
  123. dns_client.h
  124. dns_client_factory.cc
  125. dns_client_factory.h
  126. dns_client_unittest.cc
  127. dns_server_tester.cc
  128. dns_server_tester.h
  129. dns_server_tester_unittest.cc
  130. eap_credentials.cc
  131. eap_credentials.h
  132. eap_credentials_unittest.cc
  133. eap_listener.cc
  134. eap_listener.h
  135. eap_listener_unittest.cc
  136. eap_protocol.h
  137. ephemeral_profile.cc
  138. ephemeral_profile.h
  139. error.cc
  140. error.h
  141. error_unittest.cc
  142. event_dispatcher.cc
  143. event_dispatcher.h
  144. external_task.cc
  145. external_task.h
  146. external_task_unittest.cc
  147. fake_store.cc
  148. fake_store.h
  149. file_io.cc
  150. file_io.h
  151. file_reader.cc
  152. file_reader.h
  153. file_reader_unittest.cc
  154. geolocation_info.cc
  155. geolocation_info.h
  156. glib.cc
  157. glib.h
  158. glib_io_handler_factory.cc
  159. glib_io_handler_factory.h
  160. glib_io_input_handler.cc
  161. glib_io_input_handler.h
  162. glib_io_ready_handler.cc
  163. glib_io_ready_handler.h
  164. HACKING
  165. hook_table.cc
  166. hook_table.h
  167. hook_table_unittest.cc
  168. http_proxy.cc
  169. http_proxy.h
  170. http_proxy_unittest.cc
  171. http_request.cc
  172. http_request.h
  173. http_request_unittest.cc
  174. http_url.cc
  175. http_url.h
  176. http_url_unittest.cc
  177. icmp.cc
  178. icmp.h
  179. icmp_session.cc
  180. icmp_session.h
  181. icmp_session_factory.cc
  182. icmp_session_factory.h
  183. icmp_session_unittest.cc
  184. icmp_unittest.cc
  185. ip_address_store.cc
  186. ip_address_store.h
  187. ip_address_store_unittest.cc
  188. ipconfig.cc
  189. ipconfig.h
  190. ipconfig_dbus_adaptor.cc
  191. ipconfig_dbus_adaptor.h
  192. ipconfig_unittest.cc
  193. json_store.cc
  194. json_store.h
  195. json_store_unittest.cc
  196. key_file_store.cc
  197. key_file_store.h
  198. key_file_store_unittest.cc
  199. key_value_store.cc
  200. key_value_store.h
  201. key_value_store_unittest.cc
  202. link_monitor.cc
  203. link_monitor.h
  204. link_monitor_unittest.cc
  205. logging.cc
  206. logging.h
  207. manager.cc
  208. manager.h
  209. manager_dbus_adaptor.cc
  210. manager_dbus_adaptor.h
  211. manager_unittest.cc
  212. metrics.cc
  213. metrics.h
  214. metrics_unittest.cc
  215. mock_active_link_monitor.cc
  216. mock_active_link_monitor.h
  217. mock_adaptors.cc
  218. mock_adaptors.h
  219. mock_ares.cc
  220. mock_ares.h
  221. mock_arp_client.cc
  222. mock_arp_client.h
  223. mock_async_connection.cc
  224. mock_async_connection.h
  225. mock_certificate_file.cc
  226. mock_certificate_file.h
  227. mock_connection.cc
  228. mock_connection.h
  229. mock_connection_health_checker.cc
  230. mock_connection_health_checker.h
  231. mock_connection_info_reader.cc
  232. mock_connection_info_reader.h
  233. mock_connectivity_trial.cc
  234. mock_connectivity_trial.h
  235. mock_control.cc
  236. mock_control.h
  237. mock_crypto_util_proxy.cc
  238. mock_crypto_util_proxy.h
  239. mock_dbus_manager.cc
  240. mock_dbus_manager.h
  241. mock_dbus_properties_proxy.cc
  242. mock_dbus_properties_proxy.h
  243. mock_dbus_service_proxy.cc
  244. mock_dbus_service_proxy.h
  245. mock_device.cc
  246. mock_device.h
  247. mock_device_claimer.cc
  248. mock_device_claimer.h
  249. mock_device_info.cc
  250. mock_device_info.h
  251. mock_diagnostics_reporter.cc
  252. mock_diagnostics_reporter.h
  253. mock_dns_client.cc
  254. mock_dns_client.h
  255. mock_dns_client_factory.cc
  256. mock_dns_client_factory.h
  257. mock_dns_server_tester.cc
  258. mock_dns_server_tester.h
  259. mock_eap_credentials.cc
  260. mock_eap_credentials.h
  261. mock_eap_listener.cc
  262. mock_eap_listener.h
  263. mock_event_dispatcher.cc
  264. mock_event_dispatcher.h
  265. mock_external_task.cc
  266. mock_external_task.h
  267. mock_file_io.h
  268. mock_glib.cc
  269. mock_glib.h
  270. mock_http_request.cc
  271. mock_http_request.h
  272. mock_icmp.cc
  273. mock_icmp.h
  274. mock_icmp_session.cc
  275. mock_icmp_session.h
  276. mock_icmp_session_factory.cc
  277. mock_icmp_session_factory.h
  278. mock_ip_address_store.cc
  279. mock_ip_address_store.h
  280. mock_ipconfig.cc
  281. mock_ipconfig.h
  282. mock_link_monitor.cc
  283. mock_link_monitor.h
  284. mock_log.cc
  285. mock_log.h
  286. mock_log_unittest.cc
  287. mock_manager.cc
  288. mock_manager.h
  289. mock_metrics.cc
  290. mock_metrics.h
  291. mock_passive_link_monitor.cc
  292. mock_passive_link_monitor.h
  293. mock_pending_activation_store.cc
  294. mock_pending_activation_store.h
  295. mock_permission_broker_proxy.h
  296. mock_portal_detector.cc
  297. mock_portal_detector.h
  298. mock_power_manager.cc
  299. mock_power_manager.h
  300. mock_power_manager_proxy.cc
  301. mock_power_manager_proxy.h
  302. mock_ppp_device.cc
  303. mock_ppp_device.h
  304. mock_ppp_device_factory.cc
  305. mock_ppp_device_factory.h
  306. mock_process_killer.cc
  307. mock_process_killer.h
  308. mock_process_manager.cc
  309. mock_process_manager.h
  310. mock_profile.cc
  311. mock_profile.h
  312. mock_property_store.cc
  313. mock_property_store.h
  314. mock_resolver.cc
  315. mock_resolver.h
  316. mock_routing_table.cc
  317. mock_routing_table.h
  318. mock_service.cc
  319. mock_service.h
  320. mock_socket_info_reader.cc
  321. mock_socket_info_reader.h
  322. mock_store.cc
  323. mock_store.h
  324. mock_traffic_monitor.cc
  325. mock_traffic_monitor.h
  326. mock_virtual_device.cc
  327. mock_virtual_device.h
  328. NETLINK_MESSAGES.txt
  329. nice_mock_control.cc
  330. nice_mock_control.h
  331. OWNERS
  332. passive_link_monitor.cc
  333. passive_link_monitor.h
  334. passive_link_monitor_unittest.cc
  335. pending_activation_store.cc
  336. pending_activation_store.h
  337. pending_activation_store_unittest.cc
  338. permission_broker_proxy.cc
  339. permission_broker_proxy.h
  340. permission_broker_proxy_interface.h
  341. portal_detector.cc
  342. portal_detector.h
  343. portal_detector_unittest.cc
  344. power_manager.cc
  345. power_manager.h
  346. power_manager_proxy.cc
  347. power_manager_proxy.h
  348. power_manager_proxy_interface.h
  349. power_manager_unittest.cc
  350. ppp_daemon.cc
  351. ppp_daemon.h
  352. ppp_daemon_unittest.cc
  353. ppp_device.cc
  354. ppp_device.h
  355. ppp_device_factory.cc
  356. ppp_device_factory.h
  357. ppp_device_unittest.cc
  358. process_killer.cc
  359. process_killer.h
  360. process_killer_unittest.cc
  361. process_manager.cc
  362. process_manager.h
  363. process_manager_unittest.cc
  364. profile.cc
  365. profile.h
  366. profile_dbus_adaptor.cc
  367. profile_dbus_adaptor.h
  368. profile_unittest.cc
  369. property_accessor.h
  370. property_accessor_unittest.cc
  371. property_iterator.h
  372. property_observer.h
  373. property_observer_interface.h
  374. property_observer_unittest.cc
  375. property_store.cc
  376. property_store.h
  377. property_store_unittest.cc
  378. property_store_unittest.h
  379. protobuf_lite_streams.cc
  380. protobuf_lite_streams.h
  381. provider_db_unittest.bfd
  382. provider_interface.h
  383. refptr_types.h
  384. resolver.cc
  385. resolver.h
  386. resolver_unittest.cc
  387. result_aggregator.cc
  388. result_aggregator.h
  389. result_aggregator_unittest.cc
  390. routing_table.cc
  391. routing_table.h
  392. routing_table_entry.h
  393. routing_table_unittest.cc
  394. rpc_service_watcher_interface.h
  395. rpc_task.cc
  396. rpc_task.h
  397. rpc_task_dbus_adaptor.cc
  398. rpc_task_dbus_adaptor.h
  399. rpc_task_unittest.cc
  400. scope_logger.cc
  401. scope_logger.h
  402. scope_logger_unittest.cc
  403. scoped_umask.cc
  404. scoped_umask.h
  405. service.cc
  406. service.h
  407. service_dbus_adaptor.cc
  408. service_dbus_adaptor.h
  409. service_property_change_notifier.cc
  410. service_property_change_notifier.h
  411. service_property_change_test.cc
  412. service_property_change_test.h
  413. service_sorter.h
  414. service_under_test.cc
  415. service_under_test.h
  416. service_unittest.cc
  417. shared_dbus_connection.cc
  418. shared_dbus_connection.h
  419. shill.gyp
  420. shill.gypi
  421. shill_ares.cc
  422. shill_ares.h
  423. shill_config.cc
  424. shill_config.h
  425. shill_daemon.cc
  426. shill_daemon.h
  427. shill_export.h
  428. shill_main.cc
  429. shill_test_config.cc
  430. shill_test_config.h
  431. shill_unittest.cc
  432. socket_info.cc
  433. socket_info.h
  434. socket_info_reader.cc
  435. socket_info_reader.h
  436. socket_info_reader_unittest.cc
  437. socket_info_unittest.cc
  438. static_ip_parameters.cc
  439. static_ip_parameters.h
  440. static_ip_parameters_unittest.cc
  441. store_factory.cc
  442. store_factory.h
  443. store_interface.h
  444. stub_storage.h
  445. technology.cc
  446. technology.h
  447. technology_unittest.cc
  448. TESTING
  449. testing.h
  450. testrunner.cc
  451. tethering.cc
  452. tethering.h
  453. traffic_monitor.cc
  454. traffic_monitor.h
  455. traffic_monitor_unittest.cc
  456. virtual_device.cc
  457. virtual_device.h
  458. virtual_device_unittest.cc