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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_file_system.cc

Issue 9960077: Modify the base::JSONReader interface to take a set of options rather than a boolean flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 8 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
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 "chrome/browser/chromeos/gdata/gdata_file_system.h" 5 #include "chrome/browser/chromeos/gdata/gdata_file_system.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 2219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2230 scoped_ptr<base::Value> root_value; 2230 scoped_ptr<base::Value> root_value;
2231 std::string contents; 2231 std::string contents;
2232 if (!file_util::ReadFileToString(file_path, &contents)) { 2232 if (!file_util::ReadFileToString(file_path, &contents)) {
2233 *error = base::PLATFORM_FILE_ERROR_NOT_FOUND; 2233 *error = base::PLATFORM_FILE_ERROR_NOT_FOUND;
2234 return; 2234 return;
2235 } 2235 }
2236 2236
2237 int unused_error_code = -1; 2237 int unused_error_code = -1;
2238 std::string unused_error_message; 2238 std::string unused_error_message;
2239 root_value.reset(base::JSONReader::ReadAndReturnError( 2239 root_value.reset(base::JSONReader::ReadAndReturnError(
2240 contents, false, &unused_error_code, &unused_error_message)); 2240 contents, base::JSON_PARSE_RFC, &unused_error_code,
2241 &unused_error_message));
2241 2242
2242 bool has_root = root_value.get(); 2243 bool has_root = root_value.get();
2243 if (!has_root) 2244 if (!has_root)
2244 LOG(WARNING) << "Cached content read failed for file " << file_path.value(); 2245 LOG(WARNING) << "Cached content read failed for file " << file_path.value();
2245 2246
2246 if (!has_root) { 2247 if (!has_root) {
2247 *error = base::PLATFORM_FILE_ERROR_FAILED; 2248 *error = base::PLATFORM_FILE_ERROR_FAILED;
2248 return; 2249 return;
2249 } 2250 }
2250 2251
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after
4114 pref_registrar_->Init(profile_->GetPrefs()); 4115 pref_registrar_->Init(profile_->GetPrefs());
4115 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this); 4116 pref_registrar_->Add(prefs::kDisableGDataHostedFiles, this);
4116 } 4117 }
4117 4118
4118 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) { 4119 void SetFreeDiskSpaceGetterForTesting(FreeDiskSpaceGetterInterface* getter) {
4119 delete global_free_disk_getter_for_testing; // Safe to delete NULL; 4120 delete global_free_disk_getter_for_testing; // Safe to delete NULL;
4120 global_free_disk_getter_for_testing = getter; 4121 global_free_disk_getter_for_testing = getter;
4121 } 4122 }
4122 4123
4123 } // namespace gdata 4124 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698