History log of /system/connectivity/shill/json_store.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
03e6719bae1e0903d94853b896673a033196bcf5 13-Oct-2015 Alex Vakulenko <avakulenko@google.com> shill: Rename "chromeos" -> "brillo" in include paths and namespaces

libchromeos is transitioning to libbrillo and chromeos namespaces
and include directory is changing to brillo.

Bug: 24872993
TEST=built for aosp and brillo, all unit tests pass on dragonboard

Change-Id: I804311e49ee780ca96e05f6a581e8c95709d4e1d
/system/connectivity/shill/json_store.h
89bd073a5e0878e844baf8c08d7ed46782c4b16e 28-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: remove empty-path checks

JsonStore's |path_| is non-empty by construction.
So remove the non-ctor code that checks for empty
paths, and tests that exercise those code paths.

BUG=None
TEST="USE='asan clang json_store' FEATURES=test emerge-samus shill"

Change-Id: I2292cc932c06468260b14aea79d4566a7939ea84
Reviewed-on: https://chromium-review.googlesource.com/295930
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/json_store.h
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/json_store.h
b8f04f56133060fada6a65f0494c05b78eee6b88 27-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: StoreInterface: remove set_path()

set_path() is no longer used in a substantive way,
so remove it. Update calling code accordingly.

Also: remove empty-path checks in FakeStore,
since FakeStore no longer needs a path_ member
at all.

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

Change-Id: I0bea86264c037cdb758146bd937f237529c38333
Reviewed-on: https://chromium-review.googlesource.com/295926
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/json_store.h
d0faedeca1a2900bd06de37cb3a781b2ca8d6abd 27-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStoreTest: remove use of set_path()

As for KeyFileStoreTest: we need to stop using
set_path(), so that we can remove set_path()
from StoreInterface.

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

Change-Id: Iac7188e581893427f8a788a8f2434b5f1c42ae5c
Reviewed-on: https://chromium-review.googlesource.com/295925
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/json_store.h
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/json_store.h
dcad921d92c6df55176b1f5a5a64ce30d8cff4ee 27-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: StoreInterface: remove path()

Now that we've got our ducks in a row, it's time
to remove StoreInterface::path().

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

Change-Id: I3024ac8d2b2ddb743f92c5a12f552a0c605c3164
Reviewed-on: https://chromium-review.googlesource.com/295922
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/json_store.h
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/json_store.h
773cf17b04028b19dd7fefcf2c2a291756cc83a7 14-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: add Close() method

For plug compatibility with KeyFileStore, we need to provide
Close().

As for what Close() should actually do... It's clear that Close()
needs to Flush() the in-memory data to disk. But beyond that,
things are less clear.

Given the comment above Open(), in key_file_store.h, it seems
that calls to setters or getters should fail on a closed store.
It's not quite clear to me why KeyFileStore chose to provide
those semantics. And doing the same would require extra work
in JsonStore (keeping track of the open/close state, and checking
it before any Get/Set operations).

For now, I'm implementing Close() as just a Flush(). We can
revisit this, if that causes problems.

While there: fix style issue with some API comments.

BUG=b:22958135
TEST=unit tests

Change-Id: I3df033e7cac85bdf3d6e2cd838eb0cc41672404d
Reviewed-on: https://chromium-review.googlesource.com/293593
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/json_store.h
abd2c09753e4ec353ee8ff0d72c44baadc7316fc 14-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: implement MarkAsCorrupted()

For plug-compatibility with KeyFileStore, we need
a way for callers to mark a store as bad.

BUG=b:22958135
TEST=unit tests

Change-Id: Id29fa7e2c6aa967498ba211c083c29e043e15815
Reviewed-on: https://chromium-review.googlesource.com/293592
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store.h
8cf96b7dc21200c377f8082342276689004ef719 14-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: fill in Flush() functionality

A persistent store is much more interesting if it can
persist data. So add code that serializes the in-memory
store, and writes that data to disk.

BUG=b:22958135
TEST=unit tests

Change-Id: Icd5417bdc059abf99b064cdb5df656b1a845b6ed
Reviewed-on: https://chromium-review.googlesource.com/293591
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store.h
93863bf643012a02c633d8e95c9fb07487107f6f 13-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: add skeleton Open() functionality

Add a skeleton implementation of Open(). This skeleton
handles basic file structure, but does not attempt to
deserialize actual settings data.

BUG=b:22958135
TEST=unit tests

Change-Id: I909826ef71f58c41a241f0db5d30134c957e774a
Reviewed-on: https://chromium-review.googlesource.com/293569
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store.h
f13a30f7587d12de5807058b76d09b427dbc9e24 13-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: add skeleton Flush() functionality

Add a skeleton implementation of writing a JsonStore.
This CL just wires up JsonStore, JsonStringValueSerializer,
and ImportFileWriter.

A later CL will actually write JsonStore's data to disk.

BUG=b:22958135
TEST=unit tests

Change-Id: I6f63866520dc87780d3f513364dd76e7438b1b64
Reviewed-on: https://chromium-review.googlesource.com/293568
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store.h
9724f9eac1e16bc1c92caa2b2748597730ab266f 13-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: add beginnings of JsonStore

On some platforms, we will not have GLib available. Hence, we
will not be able to use KeyFileStore (it uses GLib's key_file
functions.)

On such platforms, we want a plug-compatible alternative to
KeyFileStore. Ideally, this alternative will depend only on
libchrome, or libchromeos.

This commit adds the beginnings of such an alternative to
KeyFileStore. JsonStore will use libchrome's JSON reading and
writing capabilities.

In this first commit, however, JsonStore is a simple in-memory
key-value store.

BUG=b:22958135
TEST=unit tests

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