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

Side by Side Diff: base/json/json_file_value_serializer.h

Issue 1394993004: Make ValueDeserializer::Deserialize return scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and add todo about not failed trybot Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | base/json/json_file_value_serializer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_JSON_JSON_FILE_VALUE_SERIALIZER_H_ 5 #ifndef BASE_JSON_JSON_FILE_VALUE_SERIALIZER_H_
6 #define BASE_JSON_JSON_FILE_VALUE_SERIALIZER_H_ 6 #define BASE_JSON_JSON_FILE_VALUE_SERIALIZER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 ~JSONFileValueDeserializer() override; 52 ~JSONFileValueDeserializer() override;
53 53
54 // Attempt to deserialize the data structure encoded in the file passed 54 // Attempt to deserialize the data structure encoded in the file passed
55 // in to the constructor into a structure of Value objects. If the return 55 // in to the constructor into a structure of Value objects. If the return
56 // value is NULL, and if |error_code| is non-null, |error_code| will 56 // value is NULL, and if |error_code| is non-null, |error_code| will
57 // contain an integer error code (either JsonFileError or JsonParseError). 57 // contain an integer error code (either JsonFileError or JsonParseError).
58 // If |error_message| is non-null, it will be filled in with a formatted 58 // If |error_message| is non-null, it will be filled in with a formatted
59 // error message including the location of the error if appropriate. 59 // error message including the location of the error if appropriate.
60 // The caller takes ownership of the returned value. 60 // The caller takes ownership of the returned value.
61 base::Value* Deserialize(int* error_code, 61 scoped_ptr<base::Value> Deserialize(int* error_code,
62 std::string* error_message) override; 62 std::string* error_message) override;
63 63
64 // This enum is designed to safely overlap with JSONReader::JsonParseError. 64 // This enum is designed to safely overlap with JSONReader::JsonParseError.
65 enum JsonFileError { 65 enum JsonFileError {
66 JSON_NO_ERROR = 0, 66 JSON_NO_ERROR = 0,
67 JSON_ACCESS_DENIED = 1000, 67 JSON_ACCESS_DENIED = 1000,
68 JSON_CANNOT_READ_FILE, 68 JSON_CANNOT_READ_FILE,
69 JSON_FILE_LOCKED, 69 JSON_FILE_LOCKED,
70 JSON_NO_SUCH_FILE 70 JSON_NO_SUCH_FILE
71 }; 71 };
72 72
(...skipping 22 matching lines...) Expand all
95 95
96 const base::FilePath json_file_path_; 96 const base::FilePath json_file_path_;
97 bool allow_trailing_comma_; 97 bool allow_trailing_comma_;
98 size_t last_read_size_; 98 size_t last_read_size_;
99 99
100 DISALLOW_IMPLICIT_CONSTRUCTORS(JSONFileValueDeserializer); 100 DISALLOW_IMPLICIT_CONSTRUCTORS(JSONFileValueDeserializer);
101 }; 101 };
102 102
103 #endif // BASE_JSON_JSON_FILE_VALUE_SERIALIZER_H_ 103 #endif // BASE_JSON_JSON_FILE_VALUE_SERIALIZER_H_
104 104
OLDNEW
« no previous file with comments | « no previous file | base/json/json_file_value_serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698