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

Unified Diff: chrome/browser/google_apis/drive_uploader.h

Issue 12209035: Implement retry flow on DriveUploader. (Closed) Base URL: http://git.chromium.org/chromium/src.git@b148632_wapi_get_upload_status_operation_impl
Patch Set: Created 7 years, 10 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/google_apis/drive_uploader.h
diff --git a/chrome/browser/google_apis/drive_uploader.h b/chrome/browser/google_apis/drive_uploader.h
index c18f2a8344aa540cd35b5de1614c5c966363e1f1..1edfdfc07b597075bf2a050a8819c40011bf8c7f 100644
--- a/chrome/browser/google_apis/drive_uploader.h
+++ b/chrome/browser/google_apis/drive_uploader.h
@@ -124,9 +124,12 @@ class DriveUploader : public DriveUploaderInterface {
int bytes_to_read,
int bytes_read);
- // Calls DriveService's ResumeUpload with the current upload info.
+ // Call DriveServer's ResumeUpload with the current remaining chunk of data.
satorux1 2013/02/07 05:48:32 Calls ?
+ // |start_position| should be the position in the file, and it must be
+ // in the current chunk range. In other words, the actual data range sent
+ // to the server will be |start_position| to the end of the current chunk.
void ResumeUpload(scoped_ptr<UploadFileInfo> upload_file_info,
- int bytes_to_send);
+ int64 start_position);
// DriveService callback for ResumeUpload.
void OnUploadRangeResponseReceived(
@@ -134,6 +137,16 @@ class DriveUploader : public DriveUploaderInterface {
const UploadRangeResponse& response,
scoped_ptr<ResourceEntry> entry);
+ // The server may return 5xx server error response.
+ // In such a case, following two methods will try to resume the upload.
+ // Note that in order to avoid receiving many server errors (like
+ // when the server is overloaded), this method will wait for
+ // a certain period before connecting to the server again.
+ void ResumeInterruptedUpload(
+ scoped_ptr<UploadFileInfo> upload_file_info);
+ void ResumeInterruptedUploadAfterWait(
+ scoped_ptr<UploadFileInfo> upload_file_info);
+
// Handle failed uploads.
void UploadFailed(scoped_ptr<UploadFileInfo> upload_file_info,
DriveUploadError error);
« no previous file with comments | « no previous file | chrome/browser/google_apis/drive_uploader.cc » ('j') | chrome/browser/google_apis/drive_uploader.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698