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

Unified Diff: chrome/browser/google_apis/gdata_wapi_operations.cc

Issue 12246002: Implement GetUploadStatusOperation on GData WAPI. (Closed) Base URL: http://git.chromium.org/chromium/src.git@b148632_create_base_operation
Patch Set: Update comments. 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/gdata_wapi_operations.cc
diff --git a/chrome/browser/google_apis/gdata_wapi_operations.cc b/chrome/browser/google_apis/gdata_wapi_operations.cc
index 46943526e3c66f215d1b10f45e2621b74fac75e3..3cca572248dd49bc40b98a864dc1937b667bffb1 100644
--- a/chrome/browser/google_apis/gdata_wapi_operations.cc
+++ b/chrome/browser/google_apis/gdata_wapi_operations.cc
@@ -785,4 +785,41 @@ void ResumeUploadOperation::OnURLFetchUploadProgress(
NotifyProgress(start_position_ + current, content_length_);
}
+//========================== GetUploadStatusOperation ==========================
+
+GetUploadStatusOperation::GetUploadStatusOperation(
+ OperationRegistry* registry,
+ net::URLRequestContextGetter* url_request_context_getter,
+ const UploadRangeCallback& callback,
+ UploadMode upload_mode,
+ const FilePath& drive_file_path,
+ const GURL& upload_url,
+ int64 content_length)
+ : UploadRangeOperationBase(registry,
+ url_request_context_getter,
+ callback,
+ upload_mode,
+ drive_file_path,
+ upload_url),
+ content_length_(content_length) {}
+
+GetUploadStatusOperation::~GetUploadStatusOperation() {}
+
+std::vector<std::string>
+GetUploadStatusOperation::GetExtraRequestHeaders() const {
+ // The header looks like
+ // Content-Range: bytes */<content_length>
+ // for example:
+ // Content-Range: bytes */13851821
+ // Use * for unknown/streaming content length, such as
+ // Content-Range: bytes */*
+ DCHECK_GE(content_length_, -1);
+
+ std::vector<std::string> headers;
+ headers.push_back(
+ std::string(kUploadContentRange) + "*/" +
+ (content_length_ == -1 ? "*" : base::Int64ToString(content_length_)));
+ return headers;
+}
+
} // namespace google_apis

Powered by Google App Engine
This is Rietveld 408576698