History log of /system/connectivity/shill/store_factory.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
23f67c4767b62ec154a1b50673c9626d5c22628c 21-Sep-2015 Samuel Tan <samueltan@google.com> shill: remove unnecesasry includes of key_file_store.h

Remove several unnecessary includes of key_file_store.h
from shill source files.

While there, add conditional compilation logic to store_factory.cc
that includes the appropriate store header file depending
on whether or not json store is being used.

BUG: 22956441
Change-Id: I845797c9ac7f5482a7c4c921cc5950d2caeb21a0
TEST: shill compiles successfully with emerge and passes all unit tests.
/system/connectivity/shill/store_factory.cc
c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5 03-Sep-2015 Peter Qiu <zqiu@google.com> License shill to Apache2

This patch automatically replaced the license on all text files from
Chromium OS (BSD style) to AOSP (Apache2), keeping the original year as
a reference.

The license header was added to .gyp and .gypi, the NOTICE was added with a copy
of the Apache2 license and MODULE_LICENSE_* file was added.

BUG=23587594
TEST=grep 'Chromium OS Authors' doesn't find anything.

Change-Id: If41ede586c2465f5831fb7fee270ff41dbfdb596
/system/connectivity/shill/store_factory.cc
78e0584ef181fc8a6cfd4d3b54644af21829d2ef 27-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore/KeyFileStore: modify ctor

If we want to remove StoreInterface::set_path(),
we need to provide some other way to specify where
a store gets written.

So add a FilePath argument to the JsonStore and
KeyFileStore constructors, and update callers
accordingly.

BUG=chromium:517570
TEST="USE='asan clang json_store' FEATURES=test emerge-samus shill"
TEST="USE='asan clang' FEATURES=test emerge-samus shill"

Change-Id: I4afd2d0befb9e95f0d0f3138380ef17cd2ccd603
Reviewed-on: https://chromium-review.googlesource.com/295923
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/store_factory.cc
1a25fac8a1f60f0ed6a52b2f35d1e3489d280d3e 26-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: KeyFileStore: remove GLib argument

KeyFileStore no longer makes use of the GLib*
argument passed to the ctor. So remove the
argument, and update callers appropriately.

BUG=chromium:23386647
TEST="FEATURES=test emerge-samus shill"
TEST="USE=json_store FEATURES=test emerge-samus shill"

Change-Id: I781c0db876020452d82b3a34176826933c18b779
Reviewed-on: https://chromium-review.googlesource.com/295579
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/store_factory.cc
75b0d042a2f11684d2aab9db64505b4e636e65fa 26-Aug-2015 mukesh agrawal <quiche@chromium.org> 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>
/system/connectivity/shill/store_factory.cc
04147470fdeaaf9ab7588bd3a7988d74aa990068 18-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: abstract the instantiation of store interfaces

When creating a persistent store, most code in shill shouldn't
have to worry or care about what the storage backend is.

To achieve this, add a StoreFactory, and migrate existing code
to use it. The StoreFactory selects which store interface
backend to use statically (i.e. at compile time).

To facilitate the migration, we move some methods from
StoreInterface implementations, up into the interface.

Note that unit tests continue to use KeyFileStore directly for
now. We'll migrate unit tests in a later CL.

BUG=b:23223416
TEST="FEATURES=test emerge-samus shill"
TEST="USE=json_store emerge-samus shill" [1]

[1] We deliberately leave out FEATURES=test, because some
unit tests require KeyFileStore.

Change-Id: I7e72d79ebc75e63e7fb57e9a96352fea7b31a818
Reviewed-on: https://chromium-review.googlesource.com/294274
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/store_factory.cc