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

Unified Diff: chrome/browser/google_apis/base_operations.cc

Issue 11577002: Converted ResumeUploadOperation to use JSON in response instead of XML. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unit tests. Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/google_apis/base_operations.cc
diff --git a/chrome/browser/google_apis/base_operations.cc b/chrome/browser/google_apis/base_operations.cc
index ea35779d38443cb3cc0f1d983de2d945882a77b6..766ab804038baa7ccd78f8a0804fb864f9b961c8 100644
--- a/chrome/browser/google_apis/base_operations.cc
+++ b/chrome/browser/google_apis/base_operations.cc
@@ -69,6 +69,14 @@ std::string GetResponseHeadersAsString(
namespace google_apis {
+void ParseJson(const std::string& data, const ParseJsonCallback& callback) {
+ base::PostTaskAndReplyWithResult(
+ BrowserThread::GetBlockingPool(),
+ FROM_HERE,
+ base::Bind(&ParseJsonOnBlockingPool, data),
+ callback);
+}
+
//============================ UrlFetchOperationBase ===========================
UrlFetchOperationBase::UrlFetchOperationBase(
@@ -289,13 +297,10 @@ void GetDataOperation::ParseResponse(GDataErrorCode fetch_error_code,
const std::string& data) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- base::PostTaskAndReplyWithResult(
- BrowserThread::GetBlockingPool(),
- FROM_HERE,
- base::Bind(&ParseJsonOnBlockingPool, data),
- base::Bind(&GetDataOperation::OnDataParsed,
- weak_ptr_factory_.GetWeakPtr(),
- fetch_error_code));
+ ParseJson(data,
+ base::Bind(&GetDataOperation::OnDataParsed,
+ weak_ptr_factory_.GetWeakPtr(),
+ fetch_error_code));
}
void GetDataOperation::ProcessURLFetchResults(const URLFetcher* source) {

Powered by Google App Engine
This is Rietveld 408576698