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

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

Issue 12246002: Implement GetUploadStatusOperation on GData WAPI. (Closed) Base URL: http://git.chromium.org/chromium/src.git@b148632_create_base_operation
Patch Set: Rebase 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
« no previous file with comments | « chrome/browser/google_apis/base_operations.cc ('k') | chrome/browser/google_apis/gdata_wapi_operations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/gdata_wapi_operations.h
diff --git a/chrome/browser/google_apis/gdata_wapi_operations.h b/chrome/browser/google_apis/gdata_wapi_operations.h
index 2caf2f13edcfe617b61d6851f4b1052fbf1683d8..6d7880efc373482221a72ee820508790bb2f2b59 100644
--- a/chrome/browser/google_apis/gdata_wapi_operations.h
+++ b/chrome/browser/google_apis/gdata_wapi_operations.h
@@ -507,6 +507,49 @@ class ResumeUploadOperation : public UploadRangeOperationBase {
DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation);
};
+//========================== GetUploadStatusOperation ==========================
+
+// This class performs the operation for getting the current upload status
+// of a file.
+// This operation calls |callback| with:
+// - HTTP_RESUME_INCOMPLETE and the range of previously uploaded data,
+// if a file has been partially uploaded. |new_entry| of the |callback| is
+// not used.
+// - HTTP_SUCCESS or HTTP_CREATED (up to the upload mode) and |new_entry|
+// for the uploaded data, if a file has been completely uploaded.
+// |range| of the |callback| is not used.
+// See also UploadRangeOperationBase.
+class GetUploadStatusOperation : public UploadRangeOperationBase {
+ public:
+ // |callback| must not be null. See also UploadRangeOperationBase's
+ // constructor for more details.
+ // |content_length| is the whole data size to be uploaded.
+ GetUploadStatusOperation(
+ OperationRegistry* registry,
+ net::URLRequestContextGetter* url_request_context_getter,
+ const UploadRangeCallback& callback,
+ UploadMode upload_mode,
+ const base::FilePath& drive_file_path,
+ const GURL& upload_url,
+ int64 content_length);
+ virtual ~GetUploadStatusOperation();
+
+ protected:
+ // UrlFetchOperationBase overrides.
+ virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE;
+
+ // UploadRangeOperationBase overrides.
+ virtual void OnRangeOperationComplete(
+ const UploadRangeResponse& response,
+ scoped_ptr<base::Value> value) OVERRIDE;
+
+ private:
+ const UploadRangeCallback callback_;
+ const int64 content_length_;
+
+ DISALLOW_COPY_AND_ASSIGN(GetUploadStatusOperation);
+};
+
} // namespace google_apis
#endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_
« no previous file with comments | « chrome/browser/google_apis/base_operations.cc ('k') | chrome/browser/google_apis/gdata_wapi_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698