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