|
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
Total comments: 1
|
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
|
Total messages: 2 (0 generated)
|