Chromium Code Reviews| Index: base/json/json_file_value_serializer.h |
| diff --git a/base/json/json_file_value_serializer.h b/base/json/json_file_value_serializer.h |
| index f0f556c2dc68a23457ad2aa8ec3db7a8a209947d..21c56076673c25db32b707032003a7ffb5cbfc10 100644 |
| --- a/base/json/json_file_value_serializer.h |
| +++ b/base/json/json_file_value_serializer.h |
| @@ -14,15 +14,13 @@ |
| class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer { |
| public: |
| - // json_file_patch is the path of a file that will be source of the |
| + // |json_file_path_| is the path of a file that will be source of the |
| // deserialization or the destination of the serialization. |
| // When deserializing, the file should exist, but when serializing, the |
| // serializer will attempt to create the file at the specified location. |
| - explicit JSONFileValueSerializer(const base::FilePath& json_file_path) |
| - : json_file_path_(json_file_path), |
| - allow_trailing_comma_(false) {} |
| + explicit JSONFileValueSerializer(const base::FilePath& json_file_path); |
| - ~JSONFileValueSerializer() override {} |
| + ~JSONFileValueSerializer() override; |
| // DO NOT USE except in unit tests to verify the file was written properly. |
| // We should never serialize directly to a file since this will block the |
| @@ -71,11 +69,16 @@ class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer { |
| allow_trailing_comma_ = new_value; |
| } |
| + // Returns the syze (in bytes) of JSON string read from disk in the last |
| + // |Deserialize()| call. |
|
Alexei Svitkine (slow)
2015/01/30 20:46:32
Looks like you're only updating the field if ReadF
gab
2015/01/31 16:46:56
Done.
|
| + size_t get_last_read_size() { return last_read_size_; } |
|
Alexei Svitkine (slow)
2015/01/30 20:46:32
Nit: const
gab
2015/01/31 16:46:56
Done.
|
| + |
| private: |
| bool SerializeInternal(const base::Value& root, bool omit_binary_values); |
| - base::FilePath json_file_path_; |
| + const base::FilePath json_file_path_; |
| bool allow_trailing_comma_; |
| + size_t last_read_size_; |
| // A wrapper for ReadFileToString which returns a non-zero JsonFileError if |
| // there were file errors. |