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

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

Issue 12207132: Revert 182032 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « base/json/json_file_value_serializer.h ('k') | base/nix/mime_util_xdg.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 #include "base/json/json_file_value_serializer.h" 5 #include "base/json/json_file_value_serializer.h"
6 6
7 #include "base/file_util.h" 7 #include "base/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 10
11 using base::FilePath;
12
13 const char* JSONFileValueSerializer::kAccessDenied = "Access denied."; 11 const char* JSONFileValueSerializer::kAccessDenied = "Access denied.";
14 const char* JSONFileValueSerializer::kCannotReadFile = "Can't read file."; 12 const char* JSONFileValueSerializer::kCannotReadFile = "Can't read file.";
15 const char* JSONFileValueSerializer::kFileLocked = "File locked."; 13 const char* JSONFileValueSerializer::kFileLocked = "File locked.";
16 const char* JSONFileValueSerializer::kNoSuchFile = "File doesn't exist."; 14 const char* JSONFileValueSerializer::kNoSuchFile = "File doesn't exist.";
17 15
18 bool JSONFileValueSerializer::Serialize(const Value& root) { 16 bool JSONFileValueSerializer::Serialize(const Value& root) {
19 return SerializeInternal(root, false); 17 return SerializeInternal(root, false);
20 } 18 }
21 19
22 bool JSONFileValueSerializer::SerializeAndOmitBinaryValues(const Value& root) { 20 bool JSONFileValueSerializer::SerializeAndOmitBinaryValues(const Value& root) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 *error_code = error; 87 *error_code = error;
90 if (error_str) 88 if (error_str)
91 *error_str = GetErrorMessageForCode(error); 89 *error_str = GetErrorMessageForCode(error);
92 return NULL; 90 return NULL;
93 } 91 }
94 92
95 JSONStringValueSerializer serializer(json_string); 93 JSONStringValueSerializer serializer(json_string);
96 serializer.set_allow_trailing_comma(allow_trailing_comma_); 94 serializer.set_allow_trailing_comma(allow_trailing_comma_);
97 return serializer.Deserialize(error_code, error_str); 95 return serializer.Deserialize(error_code, error_str);
98 } 96 }
OLDNEW
« no previous file with comments | « base/json/json_file_value_serializer.h ('k') | base/nix/mime_util_xdg.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698