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

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

Issue 11143014: Add request header on gdata operation for testing ETag match. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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_operations.h
diff --git a/chrome/browser/google_apis/gdata_operations.h b/chrome/browser/google_apis/gdata_operations.h
index af3262ee442560926c827b1a180ecb3673e8a3db..fe8ae1b895076129e2f586c4286040e5aa4a3e11 100644
--- a/chrome/browser/google_apis/gdata_operations.h
+++ b/chrome/browser/google_apis/gdata_operations.h
@@ -103,7 +103,8 @@ class DownloadFileOperation : public UrlFetchOperationBase {
const GetContentCallback& get_content_callback,
const GURL& document_url,
const FilePath& virtual_path,
- const FilePath& output_file_path);
+ const FilePath& output_file_path,
+ const std::string& etag);
virtual ~DownloadFileOperation();
protected:
@@ -111,6 +112,7 @@ class DownloadFileOperation : public UrlFetchOperationBase {
virtual GURL GetURL() const OVERRIDE;
virtual void ProcessURLFetchResults(const net::URLFetcher* source) OVERRIDE;
virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE;
+ virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE;
// Overridden from net::URLFetcherDelegate.
virtual void OnURLFetchDownloadProgress(const net::URLFetcher* source,
@@ -124,6 +126,7 @@ class DownloadFileOperation : public UrlFetchOperationBase {
DownloadActionCallback download_action_callback_;
GetContentCallback get_content_callback_;
GURL document_url_;
+ std::string etag_;
DISALLOW_COPY_AND_ASSIGN(DownloadFileOperation);
};
@@ -135,7 +138,8 @@ class DeleteDocumentOperation : public EntryActionOperation {
public:
DeleteDocumentOperation(OperationRegistry* registry,
const EntryActionCallback& callback,
- const GURL& document_url);
+ const GURL& document_url,
+ const std::string& etag);
virtual ~DeleteDocumentOperation();
protected:
@@ -147,6 +151,8 @@ class DeleteDocumentOperation : public EntryActionOperation {
virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE;
private:
+ std::string etag_;
+
DISALLOW_COPY_AND_ASSIGN(DeleteDocumentOperation);
};
@@ -327,9 +333,10 @@ class RemoveResourceFromDirectoryOperation : public EntryActionOperation {
// When uploading a new file (UPLOAD_NEW_FILE):
// - |title| should be set.
// - |upload_location| should be the upload_url() of the parent directory.
+// - |etag| should be empty.
//
// When updating an existing file (UPLOAD_EXISTING_FILE):
-// - |title| should be empty
+// - |title| should be empty.
// - |upload_location| should be the upload_url() of the existing file.
satorux1 2012/10/17 01:00:38 please add some comment about 'etag'
tzik 2012/10/17 02:44:44 Done.
struct InitiateUploadParams {
InitiateUploadParams(UploadMode upload_mode,
@@ -337,7 +344,8 @@ struct InitiateUploadParams {
const std::string& content_type,
int64 content_length,
const GURL& upload_location,
- const FilePath& virtual_path);
+ const FilePath& virtual_path,
+ const std::string& etag);
~InitiateUploadParams();
UploadMode upload_mode;
@@ -346,6 +354,7 @@ struct InitiateUploadParams {
int64 content_length;
GURL upload_location;
FilePath virtual_path;
+ std::string etag;
};
// Callback type for DocumentServiceInterface::InitiateUpload.
@@ -419,6 +428,7 @@ struct ResumeUploadParams {
// Virtual GData path of the file seen in the UI. Not necessary for
// resuming an upload, but used for adding an entry to OperationRegistry.
FilePath virtual_path;
+ std::string etag;
satorux1 2012/10/17 01:00:38 please add some comment here. it's rather awkward
tzik 2012/10/17 02:44:44 Done. Also, add it to constructor.
};
// Callback type for DocumentServiceInterface::ResumeUpload.

Powered by Google App Engine
This is Rietveld 408576698