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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_util.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_util.h" 5 #include "chrome/browser/chromeos/gdata/gdata_util.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 void GetHostedDocumentURLBlockingThread(const FilePath& gdata_cache_path, 76 void GetHostedDocumentURLBlockingThread(const FilePath& gdata_cache_path,
77 GURL* url) { 77 GURL* url) {
78 std::string json; 78 std::string json;
79 if (!file_util::ReadFileToString(gdata_cache_path, &json)) { 79 if (!file_util::ReadFileToString(gdata_cache_path, &json)) {
80 NOTREACHED() << "Unable to read file " << gdata_cache_path.value(); 80 NOTREACHED() << "Unable to read file " << gdata_cache_path.value();
81 return; 81 return;
82 } 82 }
83 DVLOG(1) << "Hosted doc content " << json; 83 DVLOG(1) << "Hosted doc content " << json;
84 scoped_ptr<base::Value> val(base::JSONReader::Read(json, false)); 84 scoped_ptr<base::Value> val(base::JSONReader::Read(json));
85 base::DictionaryValue* dict_val; 85 base::DictionaryValue* dict_val;
86 if (!val.get() || !val->GetAsDictionary(&dict_val)) { 86 if (!val.get() || !val->GetAsDictionary(&dict_val)) {
87 NOTREACHED() << "Parse failure for " << json; 87 NOTREACHED() << "Parse failure for " << json;
88 return; 88 return;
89 } 89 }
90 std::string edit_url; 90 std::string edit_url;
91 if (!dict_val->GetString("url", &edit_url)) { 91 if (!dict_val->GetString("url", &edit_url)) {
92 NOTREACHED() << "url field doesn't exist in " << json; 92 NOTREACHED() << "url field doesn't exist in " << json;
93 return; 93 return;
94 } 94 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 // --disable-gdata or enterprise policy, or probably with user settings too 242 // --disable-gdata or enterprise policy, or probably with user settings too
243 // in the future. 243 // in the future.
244 if (profile->GetPrefs()->GetBoolean(prefs::kDisableGData)) 244 if (profile->GetPrefs()->GetBoolean(prefs::kDisableGData))
245 return false; 245 return false;
246 246
247 return true; 247 return true;
248 } 248 }
249 249
250 } // namespace util 250 } // namespace util
251 } // namespace gdata 251 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698