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

Unified Diff: chrome/browser/chromeos/gdata/gdata_operations.cc

Issue 10836011: Revert 148990 - gdrive: Get JSON feeds parsing off the UI thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/gdata/gdata_operations.cc
===================================================================
--- chrome/browser/chromeos/gdata/gdata_operations.cc (revision 148995)
+++ chrome/browser/chromeos/gdata/gdata_operations.cc (working copy)
@@ -261,7 +261,8 @@
get_download_data_callback_.Run(HTTP_SUCCESS, download_data.Pass());
}
-void DownloadFileOperation::ProcessURLFetchResults(const URLFetcher* source) {
+bool DownloadFileOperation::ProcessURLFetchResults(
+ const URLFetcher* source) {
GDataErrorCode code = GetErrorCode(source);
// Take over the ownership of the the downloaded temp file.
@@ -274,7 +275,7 @@
if (!download_action_callback_.is_null())
download_action_callback_.Run(code, document_url_, temp_file);
- OnProcessURLFetchResultsComplete(code == HTTP_SUCCESS);
+ return code == HTTP_SUCCESS;
}
void DownloadFileOperation::RunCallbackOnPrematureFailure(GDataErrorCode code) {
@@ -476,10 +477,11 @@
return headers;
}
-void AuthorizeAppsOperation::ProcessURLFetchResults(const URLFetcher* source) {
+bool AuthorizeAppsOperation::ProcessURLFetchResults(
+ const URLFetcher* source) {
std::string data;
source->GetResponseAsString(&data);
- GetDataOperation::ProcessURLFetchResults(source);
+ return GetDataOperation::ProcessURLFetchResults(source);
}
bool AuthorizeAppsOperation::GetContentData(std::string* upload_content_type,
@@ -500,9 +502,7 @@
return true;
}
-void AuthorizeAppsOperation::ParseResponse(
- GDataErrorCode fetch_error_code,
- const std::string& data) {
+base::Value* AuthorizeAppsOperation::ParseResponse(const std::string& data) {
// Parse entry XML.
XmlReader xml_reader;
scoped_ptr<DocumentEntry> entry;
@@ -531,9 +531,7 @@
}
}
- RunCallback(fetch_error_code, link_list.PassAs<base::Value>());
- const bool success = true;
- OnProcessURLFetchResultsComplete(success);
+ return link_list.release();
}
GURL AuthorizeAppsOperation::GetURL() const {
@@ -646,7 +644,7 @@
return initiate_upload_url_;
}
-void InitiateUploadOperation::ProcessURLFetchResults(
+bool InitiateUploadOperation::ProcessURLFetchResults(
const URLFetcher* source) {
GDataErrorCode code = GetErrorCode(source);
@@ -663,7 +661,7 @@
if (!callback_.is_null())
callback_.Run(code, GURL(upload_location));
- OnProcessURLFetchResultsComplete(code == HTTP_SUCCESS);
+ return code == HTTP_SUCCESS;
}
void InitiateUploadOperation::NotifySuccessToOperationRegistry() {
@@ -750,7 +748,8 @@
return params_.upload_location;
}
-void ResumeUploadOperation::ProcessURLFetchResults(const URLFetcher* source) {
+bool ResumeUploadOperation::ProcessURLFetchResults(
+ const URLFetcher* source) {
GDataErrorCode code = GetErrorCode(source);
net::HttpResponseHeaders* hdrs = source->GetResponseHeaders();
int64 start_range_received = -1;
@@ -811,8 +810,7 @@
last_chunk_completed_ = true;
}
- OnProcessURLFetchResultsComplete(
- last_chunk_completed_ || code == HTTP_RESUME_INCOMPLETE);
+ return last_chunk_completed_ || code == HTTP_RESUME_INCOMPLETE;
}
void ResumeUploadOperation::NotifyStartToOperationRegistry() {
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_operations.h ('k') | chrome/browser/chromeos/gdata/gdata_operations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698