Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2890)

Unified Diff: base/prefs/json_pref_store.cc

Issue 925783002: Split ValueSerializer into separate Serializer and Deserializer classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed cpplint warnings. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/json/json_value_serializer_unittest.cc ('k') | base/test/gtest_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/json_pref_store.cc
diff --git a/base/prefs/json_pref_store.cc b/base/prefs/json_pref_store.cc
index c52a95c9cc2b7b675059cbd6d91574a465633eba..21b73f4d5fadadc72d743893b859649647f0403e 100644
--- a/base/prefs/json_pref_store.cc
+++ b/base/prefs/json_pref_store.cc
@@ -56,16 +56,16 @@ PersistentPrefStore::PrefReadError HandleReadErrors(
DVLOG(1) << "Error while loading JSON file: " << error_msg
<< ", file: " << path.value();
switch (error_code) {
- case JSONFileValueSerializer::JSON_ACCESS_DENIED:
+ case JSONFileValueDeserializer::JSON_ACCESS_DENIED:
return PersistentPrefStore::PREF_READ_ERROR_ACCESS_DENIED;
break;
- case JSONFileValueSerializer::JSON_CANNOT_READ_FILE:
+ case JSONFileValueDeserializer::JSON_CANNOT_READ_FILE:
return PersistentPrefStore::PREF_READ_ERROR_FILE_OTHER;
break;
- case JSONFileValueSerializer::JSON_FILE_LOCKED:
+ case JSONFileValueDeserializer::JSON_FILE_LOCKED:
return PersistentPrefStore::PREF_READ_ERROR_FILE_LOCKED;
break;
- case JSONFileValueSerializer::JSON_NO_SUCH_FILE:
+ case JSONFileValueDeserializer::JSON_NO_SUCH_FILE:
return PersistentPrefStore::PREF_READ_ERROR_NO_FILE;
break;
default:
@@ -119,14 +119,14 @@ scoped_ptr<JsonPrefStore::ReadResult> ReadPrefsFromDisk(
std::string error_msg;
scoped_ptr<JsonPrefStore::ReadResult> read_result(
new JsonPrefStore::ReadResult);
- JSONFileValueSerializer serializer(path);
- read_result->value.reset(serializer.Deserialize(&error_code, &error_msg));
+ JSONFileValueDeserializer deserializer(path);
+ read_result->value.reset(deserializer.Deserialize(&error_code, &error_msg));
read_result->error =
HandleReadErrors(read_result->value.get(), path, error_code, error_msg);
read_result->no_dir = !base::PathExists(path.DirName());
if (read_result->error == PersistentPrefStore::PREF_READ_ERROR_NONE)
- RecordJsonDataSizeHistogram(path, serializer.get_last_read_size());
+ RecordJsonDataSizeHistogram(path, deserializer.get_last_read_size());
return read_result.Pass();
}
« no previous file with comments | « base/json/json_value_serializer_unittest.cc ('k') | base/test/gtest_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698