| OLD | NEW |
| 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 #include "base/json/json_file_value_serializer.h" | 5 #include "base/json/json_file_value_serializer.h" |
| 6 | 6 |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" |
| 10 | 11 |
| 11 using base::FilePath; | 12 using base::FilePath; |
| 12 | 13 |
| 13 const char JSONFileValueDeserializer::kAccessDenied[] = "Access denied."; | 14 const char JSONFileValueDeserializer::kAccessDenied[] = "Access denied."; |
| 14 const char JSONFileValueDeserializer::kCannotReadFile[] = "Can't read file."; | 15 const char JSONFileValueDeserializer::kCannotReadFile[] = "Can't read file."; |
| 15 const char JSONFileValueDeserializer::kFileLocked[] = "File locked."; | 16 const char JSONFileValueDeserializer::kFileLocked[] = "File locked."; |
| 16 const char JSONFileValueDeserializer::kNoSuchFile[] = "File doesn't exist."; | 17 const char JSONFileValueDeserializer::kNoSuchFile[] = "File doesn't exist."; |
| 17 | 18 |
| 18 JSONFileValueSerializer::JSONFileValueSerializer( | 19 JSONFileValueSerializer::JSONFileValueSerializer( |
| 19 const base::FilePath& json_file_path) | 20 const base::FilePath& json_file_path) |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 *error_code = error; | 111 *error_code = error; |
| 111 if (error_str) | 112 if (error_str) |
| 112 *error_str = GetErrorMessageForCode(error); | 113 *error_str = GetErrorMessageForCode(error); |
| 113 return NULL; | 114 return NULL; |
| 114 } | 115 } |
| 115 | 116 |
| 116 JSONStringValueDeserializer deserializer(json_string); | 117 JSONStringValueDeserializer deserializer(json_string); |
| 117 deserializer.set_allow_trailing_comma(allow_trailing_comma_); | 118 deserializer.set_allow_trailing_comma(allow_trailing_comma_); |
| 118 return deserializer.Deserialize(error_code, error_str); | 119 return deserializer.Deserialize(error_code, error_str); |
| 119 } | 120 } |
| OLD | NEW |