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

Unified Diff: google_apis/drive/drive_api_requests.h

Issue 1130183003: Notify upload progress from batch request to its child requests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments and fix msan test. Created 5 years, 7 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
« no previous file with comments | « google_apis/drive/base_requests.cc ('k') | google_apis/drive/drive_api_requests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/drive/drive_api_requests.h
diff --git a/google_apis/drive/drive_api_requests.h b/google_apis/drive/drive_api_requests.h
index 6017799f60decb592e50373118d658d733d617cf..d930f4e87048528ab85dbb60bc66d02236d566bf 100644
--- a/google_apis/drive/drive_api_requests.h
+++ b/google_apis/drive/drive_api_requests.h
@@ -1114,9 +1114,11 @@ class PermissionsInsertRequest : public EntryActionRequest {
struct BatchUploadChildEntry {
BatchUploadChildEntry() : request(NULL), prepared(false) {}
explicit BatchUploadChildEntry(BatchableRequestBase* request)
- : request(request), prepared(false) {}
+ : request(request), prepared(false), data_offset(0), data_size(0) {}
BatchableRequestBase* request;
bool prepared;
+ int64 data_offset;
+ int64 data_size;
};
class BatchUploadRequest : public UrlFetchRequestBase {
@@ -1155,6 +1157,11 @@ class BatchUploadRequest : public UrlFetchRequestBase {
void ProcessURLFetchResults(const net::URLFetcher* source) override;
void RunCallbackOnPrematureFailure(DriveApiErrorCode code) override;
+ // content::UrlFetcherDelegate overrides.
+ void OnURLFetchUploadProgress(const net::URLFetcher* source,
+ int64 current,
+ int64 total) override;
+
private:
typedef void* RequestID;
// Obtains corresponding child entry of |request_id|. Returns NULL if the
@@ -1184,6 +1191,9 @@ class BatchUploadRequest : public UrlFetchRequestBase {
// Multipart of child requests.
ContentTypeAndData upload_content_;
+ // Last reported progress value.
+ int64 last_progress_value_;
+
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
base::WeakPtrFactory<BatchUploadRequest> weak_ptr_factory_;
« no previous file with comments | « google_apis/drive/base_requests.cc ('k') | google_apis/drive/drive_api_requests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698