summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-10 02:16:40 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-10 02:16:40 +0000
commit04e6d7940a1dc4cbdb8d49e413ea492ce943bb55 (patch)
treef1bb2bb16290d9612aa742befb417f470d1f5d99
parenteb089b997533b5894784c58281f59ce9a625a9fe (diff)
downloadchromium_src-04e6d7940a1dc4cbdb8d49e413ea492ce943bb55.zip
chromium_src-04e6d7940a1dc4cbdb8d49e413ea492ce943bb55.tar.gz
chromium_src-04e6d7940a1dc4cbdb8d49e413ea492ce943bb55.tar.bz2
Implement upload progress reporting in GDataWAPI and DriveAPI operations.
BUG=128079 Review URL: https://chromiumcodereview.appspot.com/13934003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193293 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/google_apis/drive_api_operations.cc7
-rw-r--r--chrome/browser/google_apis/drive_api_operations.h3
-rw-r--r--chrome/browser/google_apis/gdata_wapi_operations.cc7
-rw-r--r--chrome/browser/google_apis/gdata_wapi_operations.h3
4 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/google_apis/drive_api_operations.cc b/chrome/browser/google_apis/drive_api_operations.cc
index 2135238..64f871a 100644
--- a/chrome/browser/google_apis/drive_api_operations.cc
+++ b/chrome/browser/google_apis/drive_api_operations.cc
@@ -564,5 +564,12 @@ void ResumeUploadOperation::OnRangeOperationComplete(
ParseFileResourceWithUploadRangeAndRun(callback_, response, value.Pass());
}
+void ResumeUploadOperation::OnURLFetchUploadProgress(
+ const net::URLFetcher* source, int64 current, int64 total) {
+ ResumeUploadOperationBase::OnURLFetchUploadProgress(source, current, total);
+ if (!progress_callback_.is_null())
+ progress_callback_.Run(current);
+}
+
} // namespace drive
} // namespace google_apis
diff --git a/chrome/browser/google_apis/drive_api_operations.h b/chrome/browser/google_apis/drive_api_operations.h
index 83b5662..37272701 100644
--- a/chrome/browser/google_apis/drive_api_operations.h
+++ b/chrome/browser/google_apis/drive_api_operations.h
@@ -495,6 +495,9 @@ class ResumeUploadOperation : public ResumeUploadOperationBase {
virtual void OnRangeOperationComplete(
const UploadRangeResponse& response,
scoped_ptr<base::Value> value) OVERRIDE;
+ // content::UrlFetcherDelegate overrides.
+ virtual void OnURLFetchUploadProgress(const net::URLFetcher* source,
+ int64 current, int64 total) OVERRIDE;
private:
const UploadRangeCallback callback_;
diff --git a/chrome/browser/google_apis/gdata_wapi_operations.cc b/chrome/browser/google_apis/gdata_wapi_operations.cc
index fcca732..cf8f2a0 100644
--- a/chrome/browser/google_apis/gdata_wapi_operations.cc
+++ b/chrome/browser/google_apis/gdata_wapi_operations.cc
@@ -687,6 +687,13 @@ void ResumeUploadOperation::OnRangeOperationComplete(
callback_.Run(response, ParseResourceEntry(value.Pass()));
}
+void ResumeUploadOperation::OnURLFetchUploadProgress(
+ const URLFetcher* source, int64 current, int64 total) {
+ ResumeUploadOperationBase::OnURLFetchUploadProgress(source, current, total);
+ if (!progress_callback_.is_null())
+ progress_callback_.Run(current);
+}
+
//========================== GetUploadStatusOperation ==========================
GetUploadStatusOperation::GetUploadStatusOperation(
diff --git a/chrome/browser/google_apis/gdata_wapi_operations.h b/chrome/browser/google_apis/gdata_wapi_operations.h
index 4783d7d..e167d79 100644
--- a/chrome/browser/google_apis/gdata_wapi_operations.h
+++ b/chrome/browser/google_apis/gdata_wapi_operations.h
@@ -451,6 +451,9 @@ class ResumeUploadOperation : public ResumeUploadOperationBase {
virtual void OnRangeOperationComplete(
const UploadRangeResponse& response,
scoped_ptr<base::Value> value) OVERRIDE;
+ // content::UrlFetcherDelegate overrides.
+ virtual void OnURLFetchUploadProgress(const net::URLFetcher* source,
+ int64 current, int64 total) OVERRIDE;
private:
const UploadRangeCallback callback_;