Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1054)

Issue 1717007: Reland "Factor out reading and writing of preferences into |PrefStore|." (Closed)

Created:
10 years, 8 months ago by Bernhard Bauer
Modified:
9 years, 7 months ago
CC:
ben+cc_chromium.org, Erik does not do reviews, brettw-cc_chromium.org, Aaron Boodman, pam+watch_chromium.org, Paweł Hajdan Jr., amit
Visibility:
Public.

Description

Reland "Factor out reading and writing of preferences into |PrefStore|." The CL now applies after r45225 (Throw out preferences files that are corrupt rather than keeping them in read-only mode), which means that the changes in that commit moved to JsonPrefStore. I updated JsonPrefStoreTest.InvalidFile to test the new behavior. *** In order to implement platform-specific policies, reading and writing preferences needs to be abstracted from the |PrefService|. The interface for that is now |PrefStore|, with an implementation |JsonPrefStore|, which stores the pref data in a JSON file. There is another implementation, |DummyPrefStore|, which doesn't store any persistent preferences, and is currently used for tests. Most of the changes are for using the new interface, which is |new PrefService(new JsonPrefStore(filename))| instead of |new PrefService(filename)|. BUG=40259 TEST=PrefServiceTest.*:PrefServiceSetValueTest.*:PrefMemberTest.*:JsonPrefStoreTest.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=45309

Patch Set 1 #

Patch Set 2 : Fix JsonPrefStoreTest.InvalidFile. #

Patch Set 3 : Really fix JsonPrefStoreTest.InvalidFile. #

Total comments: 1

Patch Set 4 : Shorten line to 80 chars. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+540 lines, -330 lines) Patch
M chrome/browser/browser_main.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/browser_process_impl.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/dom_ui/new_tab_ui_uitest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/dom_ui/shown_sections_handler_unittest.cc View 3 chunks +3 lines, -2 lines 0 comments Download
A chrome/browser/dummy_pref_store.h View 1 chunk +27 lines, -0 lines 0 comments Download
A chrome/browser/dummy_pref_store.cc View 1 chunk +14 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_prefs_unittest.cc View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_updater_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/extensions_service_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
A chrome/browser/json_pref_store.h View 1 chunk +48 lines, -0 lines 0 comments Download
A chrome/browser/json_pref_store.cc View 1 2 3 1 chunk +128 lines, -0 lines 0 comments Download
A chrome/browser/json_pref_store_unittest.cc View 1 2 1 chunk +148 lines, -0 lines 0 comments Download
M chrome/browser/metrics/metrics_service_uitest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/pref_member_unittest.cc View 4 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/pref_service.h View 6 chunks +11 lines, -44 lines 0 comments Download
M chrome/browser/pref_service.cc View 8 chunks +28 lines, -117 lines 0 comments Download
M chrome/browser/pref_service_unittest.cc View 6 chunks +50 lines, -151 lines 0 comments Download
A chrome/browser/pref_store.h View 1 chunk +47 lines, -0 lines 0 comments Download
M chrome/browser/privacy_blacklist/blacklist_unittest.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/profile.cc View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/tab_contents/web_contents_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome_browser.gypi View 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 2 chunks +3 lines, -0 lines 0 comments Download
A chrome/test/data/pref_service/invalid.json View Binary file 0 comments Download
M chrome/test/reliability/page_load_test.cc View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/test/testing_profile.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome_frame/test/reliability/page_load_test.cc View 2 chunks +2 lines, -1 line 0 comments Download

Messages

Total messages: 2 (0 generated)
Bernhard Bauer
Could you review this... again? :)
10 years, 8 months ago (2010-04-22 11:43:35 UTC) #1
Pam (message me for reviews)
10 years, 8 months ago (2010-04-22 13:03:47 UTC) #2
LGTM. I only re-reviewed the three json_pref_store* files, and rubber-stamp the
rest on the assumption that they didn't change.

- Pam

http://codereview.chromium.org/1717007/diff/6001/1037
File chrome/browser/json_pref_store.cc (right):

http://codereview.chromium.org/1717007/diff/6001/1037#newcode78
chrome/browser/json_pref_store.cc:78: // TODO(erikkay) if we keep this error
checking for very long, we may want
Nit: 80 col

Powered by Google App Engine
This is Rietveld 408576698