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

Side by Side Diff: base/json/json_value_serializer.cc

Issue 8423079: Allow trailing comma in JSON policy files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added unit testing for the whole JSONValueSerializer suite. Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698