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

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

Issue 12218011: WIP: Implement 5xx Error handling. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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/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 ef1c544c830561e0888af391937a7d56d5d2b2d7..bfe5513906627303cb3df8a6813c0d01a0130bd8 100644
--- a/chrome/browser/google_apis/gdata_wapi_operations.h
+++ b/chrome/browser/google_apis/gdata_wapi_operations.h
@@ -513,6 +513,7 @@ struct ResumeUploadParams {
int64 content_length,
const std::string& content_type,
scoped_refptr<net::IOBuffer> buf,
+ const int64 buffer_offset,
const GURL& upload_location,
const FilePath& drive_file_path);
~ResumeUploadParams();
@@ -528,6 +529,7 @@ struct ResumeUploadParams {
const std::string content_type; // Content-Type of file.
// Holds current content to be uploaded.
const scoped_refptr<net::IOBuffer> buf;
+ const int64 buffer_offset;
const GURL upload_location; // Url of where to upload the file to.
// Drive file path of the file seen in the UI. Not necessary for
// resuming an upload, but used for adding an entry to OperationRegistry.
@@ -591,6 +593,41 @@ class ResumeUploadOperation : public UrlFetchOperationBase {
DISALLOW_COPY_AND_ASSIGN(ResumeUploadOperation);
};
+class GetUploadStateOperation : public UrlFetchOperationBase {
+ public:
+ GetUploadStateOperation(
+ OperationRegistry* registry,
+ net::URLRequestContextGetter* url_request_context_getter,
+ const ResumeUploadCallback& callback,
+ UploadMode upload_mode,
+ const FilePath& drive_file_path,
+ const GURL& upload_url,
+ int64 content_length);
+ virtual ~GetUploadStateOperation();
+
+ protected:
+ virtual GURL GetURL() const OVERRIDE;
+ virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE;
+ virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE;
+ virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE;
+ virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE;
+
+ private:
+ // Called when ParseJson() is completed.
+ void OnDataParsed(GDataErrorCode code, scoped_ptr<base::Value> value);
+
+ const ResumeUploadCallback callback_;
+ const UploadMode upload_mode_;
+ const FilePath drive_file_path_;
+ const GURL upload_url_;
+ const int64 content_length_;
+
+ // 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<GetUploadStateOperation> weak_ptr_factory_;
+ DISALLOW_COPY_AND_ASSIGN(GetUploadStateOperation);
+};
+
} // namespace google_apis
#endif // CHROME_BROWSER_GOOGLE_APIS_GDATA_WAPI_OPERATIONS_H_
« no previous file with comments | « chrome/browser/google_apis/fake_drive_service.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