| Index: chrome/browser/chromeos/gdata/gdata_operations.cc
|
| diff --git a/chrome/browser/chromeos/gdata/gdata_operations.cc b/chrome/browser/chromeos/gdata/gdata_operations.cc
|
| index e0057eb392b823f9288ef945bfcda7c37497b55f..93a86dd3081f29c003dac6b4afe12ee1cb159a8d 100644
|
| --- a/chrome/browser/chromeos/gdata/gdata_operations.cc
|
| +++ b/chrome/browser/chromeos/gdata/gdata_operations.cc
|
| @@ -261,8 +261,9 @@ void DownloadFileOperation::OnURLFetchDownloadData(
|
| get_download_data_callback_.Run(HTTP_SUCCESS, download_data.Pass());
|
| }
|
|
|
| -bool DownloadFileOperation::ProcessURLFetchResults(
|
| - const URLFetcher* source) {
|
| +void DownloadFileOperation::ProcessURLFetchResults(
|
| + const URLFetcher* source,
|
| + const ProcessURLFetchResultsCallback& result_callback) {
|
| GDataErrorCode code = GetErrorCode(source);
|
|
|
| // Take over the ownership of the the downloaded temp file.
|
| @@ -275,7 +276,7 @@ bool DownloadFileOperation::ProcessURLFetchResults(
|
|
|
| if (!download_action_callback_.is_null())
|
| download_action_callback_.Run(code, document_url_, temp_file);
|
| - return code == HTTP_SUCCESS;
|
| + result_callback.Run(code == HTTP_SUCCESS);
|
| }
|
|
|
| void DownloadFileOperation::RunCallbackOnPrematureFailure(GDataErrorCode code) {
|
| @@ -477,11 +478,12 @@ AuthorizeAppsOperation::GetExtraRequestHeaders() const {
|
| return headers;
|
| }
|
|
|
| -bool AuthorizeAppsOperation::ProcessURLFetchResults(
|
| - const URLFetcher* source) {
|
| +void AuthorizeAppsOperation::ProcessURLFetchResults(
|
| + const URLFetcher* source,
|
| + const ProcessURLFetchResultsCallback& result_callback) {
|
| std::string data;
|
| source->GetResponseAsString(&data);
|
| - return GetDataOperation::ProcessURLFetchResults(source);
|
| + GetDataOperation::ProcessURLFetchResults(source, result_callback);
|
| }
|
|
|
| bool AuthorizeAppsOperation::GetContentData(std::string* upload_content_type,
|
| @@ -502,7 +504,10 @@ bool AuthorizeAppsOperation::GetContentData(std::string* upload_content_type,
|
| return true;
|
| }
|
|
|
| -base::Value* AuthorizeAppsOperation::ParseResponse(const std::string& data) {
|
| +void AuthorizeAppsOperation::ParseResponse(
|
| + GDataErrorCode fetch_error_code,
|
| + const std::string& data,
|
| + const ProcessURLFetchResultsCallback& result_callback) {
|
| // Parse entry XML.
|
| XmlReader xml_reader;
|
| scoped_ptr<DocumentEntry> entry;
|
| @@ -531,7 +536,9 @@ base::Value* AuthorizeAppsOperation::ParseResponse(const std::string& data) {
|
| }
|
| }
|
|
|
| - return link_list.release();
|
| + RunCallback(fetch_error_code, link_list.PassAs<base::Value>());
|
| + const bool success = true;
|
| + result_callback.Run(success);
|
| }
|
|
|
| GURL AuthorizeAppsOperation::GetURL() const {
|
| @@ -644,8 +651,9 @@ GURL InitiateUploadOperation::GetURL() const {
|
| return initiate_upload_url_;
|
| }
|
|
|
| -bool InitiateUploadOperation::ProcessURLFetchResults(
|
| - const URLFetcher* source) {
|
| +void InitiateUploadOperation::ProcessURLFetchResults(
|
| + const URLFetcher* source,
|
| + const ProcessURLFetchResultsCallback& result_callback) {
|
| GDataErrorCode code = GetErrorCode(source);
|
|
|
| std::string upload_location;
|
| @@ -661,7 +669,7 @@ bool InitiateUploadOperation::ProcessURLFetchResults(
|
|
|
| if (!callback_.is_null())
|
| callback_.Run(code, GURL(upload_location));
|
| - return code == HTTP_SUCCESS;
|
| + result_callback.Run(code == HTTP_SUCCESS);
|
| }
|
|
|
| void InitiateUploadOperation::NotifySuccessToOperationRegistry() {
|
| @@ -748,8 +756,9 @@ GURL ResumeUploadOperation::GetURL() const {
|
| return params_.upload_location;
|
| }
|
|
|
| -bool ResumeUploadOperation::ProcessURLFetchResults(
|
| - const URLFetcher* source) {
|
| +void ResumeUploadOperation::ProcessURLFetchResults(
|
| + const URLFetcher* source,
|
| + const ProcessURLFetchResultsCallback& result_callback) {
|
| GDataErrorCode code = GetErrorCode(source);
|
| net::HttpResponseHeaders* hdrs = source->GetResponseHeaders();
|
| int64 start_range_received = -1;
|
| @@ -810,7 +819,7 @@ bool ResumeUploadOperation::ProcessURLFetchResults(
|
| last_chunk_completed_ = true;
|
| }
|
|
|
| - return last_chunk_completed_ || code == HTTP_RESUME_INCOMPLETE;
|
| + result_callback.Run(last_chunk_completed_ || code == HTTP_RESUME_INCOMPLETE);
|
| }
|
|
|
| void ResumeUploadOperation::NotifyStartToOperationRegistry() {
|
|
|