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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_operations.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_operations.h" 5 #include "chrome/browser/chromeos/gdata/gdata_operations.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 FROM_HERE, 406 FROM_HERE,
407 base::Bind(callback_, code, base::Passed(&root_value))); 407 base::Bind(callback_, code, base::Passed(&root_value)));
408 } 408 }
409 } 409 }
410 410
411 // static 411 // static
412 base::Value* GetDataOperation::ParseResponse(const std::string& data) { 412 base::Value* GetDataOperation::ParseResponse(const std::string& data) {
413 int error_code = -1; 413 int error_code = -1;
414 std::string error_message; 414 std::string error_message;
415 scoped_ptr<base::Value> root_value(base::JSONReader::ReadAndReturnError( 415 scoped_ptr<base::Value> root_value(base::JSONReader::ReadAndReturnError(
416 data, false, &error_code, &error_message)); 416 data, base::JSON_PARSE_RFC, &error_code, &error_message));
417 if (!root_value.get()) { 417 if (!root_value.get()) {
418 LOG(ERROR) << "Error while parsing entry response: " 418 LOG(ERROR) << "Error while parsing entry response: "
419 << error_message 419 << error_message
420 << ", code: " 420 << ", code: "
421 << error_code 421 << error_code
422 << ", data:\n" 422 << ", data:\n"
423 << data; 423 << data;
424 return NULL; 424 return NULL;
425 } 425 }
426 return root_value.release(); 426 return root_value.release();
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 return true; 995 return true;
996 } 996 }
997 997
998 void ResumeUploadOperation::OnURLFetchUploadProgress( 998 void ResumeUploadOperation::OnURLFetchUploadProgress(
999 const content::URLFetcher* source, int64 current, int64 total) { 999 const content::URLFetcher* source, int64 current, int64 total) {
1000 // Adjust the progress values according to the range currently uploaded. 1000 // Adjust the progress values according to the range currently uploaded.
1001 NotifyProgress(params_.start_range + current, params_.content_length); 1001 NotifyProgress(params_.start_range + current, params_.content_length);
1002 } 1002 }
1003 1003
1004 } // namespace gdata 1004 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698