| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/json/json_value_serializer.h" | 5 #include "base/json/json_value_serializer.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 int error = ReadFileToString(&json_string); | 97 int error = ReadFileToString(&json_string); |
| 98 if (error != JSON_NO_ERROR) { | 98 if (error != JSON_NO_ERROR) { |
| 99 if (error_code) | 99 if (error_code) |
| 100 *error_code = error; | 100 *error_code = error; |
| 101 if (error_str) | 101 if (error_str) |
| 102 *error_str = GetErrorMessageForCode(error); | 102 *error_str = GetErrorMessageForCode(error); |
| 103 return NULL; | 103 return NULL; |
| 104 } | 104 } |
| 105 | 105 |
| 106 JSONStringValueSerializer serializer(json_string); | 106 JSONStringValueSerializer serializer(json_string); |
| 107 serializer.set_allow_trailing_comma(allow_trailing_comma_); |
| 107 return serializer.Deserialize(error_code, error_str); | 108 return serializer.Deserialize(error_code, error_str); |
| 108 } | 109 } |
| OLD | NEW |