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

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

Issue 12207075: Split InitiateUpload method into two. (Closed) Base URL: http://git.chromium.org/chromium/src.git@b148632_extract_initiate_upload_operation_base
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/drive_service_interface.h ('k') | chrome/browser/google_apis/drive_uploader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/google_apis/drive_uploader.h
diff --git a/chrome/browser/google_apis/drive_uploader.h b/chrome/browser/google_apis/drive_uploader.h
index c18f2a8344aa540cd35b5de1614c5c966363e1f1..0fb5618bfa37c665c402bae2c7f20e6e94a13608 100644
--- a/chrome/browser/google_apis/drive_uploader.h
+++ b/chrome/browser/google_apis/drive_uploader.h
@@ -86,14 +86,14 @@ class DriveUploader : public DriveUploaderInterface {
virtual ~DriveUploader();
// DriveUploaderInterface overrides.
- virtual void UploadNewFile(const GURL& upload_location,
+ virtual void UploadNewFile(const GURL& parent_upload_url,
const base::FilePath& drive_file_path,
const base::FilePath& local_file_path,
const std::string& title,
const std::string& content_type,
const UploadCompletionCallback& callback) OVERRIDE;
virtual void UploadExistingFile(
- const GURL& upload_location,
+ const GURL& upload_url,
const base::FilePath& drive_file_path,
const base::FilePath& local_file_path,
const std::string& content_type,
@@ -102,14 +102,34 @@ class DriveUploader : public DriveUploaderInterface {
private:
struct UploadFileInfo;
+ typedef base::Callback<void(scoped_ptr<UploadFileInfo> upload_file_info)>
+ StartInitiateUploadCallback;
// Starts uploading a file with |upload_file_info|.
- void StartUploadFile(scoped_ptr<UploadFileInfo> upload_file_info);
+ void StartUploadFile(
+ scoped_ptr<UploadFileInfo> upload_file_info,
+ const StartInitiateUploadCallback& start_initiate_upload_callback);
// net::FileStream::Open completion callback. The result of the file open
// operation is passed as |result|, and the size is stored in |file_size|.
- void OpenCompletionCallback(scoped_ptr<UploadFileInfo> upload_file_info,
- int64 file_size);
+ void OpenCompletionCallback(
+ scoped_ptr<UploadFileInfo> upload_file_info,
+ const StartInitiateUploadCallback& start_initiate_upload_callback,
+ int64 file_size);
+
+ // Starts to initate the new file uploading.
+ // Upon completion, OnUploadLocationReceived should be called.
+ void StartInitiateUploadNewFile(
+ const GURL& parent_upload_url,
+ const std::string& title,
+ scoped_ptr<UploadFileInfo> upload_file_info);
+
+ // Starts to initate the existing file uploading.
+ // Upon completion, OnUploadLocationReceived should be called.
+ void StartInitiateUploadExistingFile(
+ const GURL& upload_url,
+ const std::string& etag,
+ scoped_ptr<UploadFileInfo> upload_file_info);
// DriveService callback for InitiateUpload.
void OnUploadLocationReceived(scoped_ptr<UploadFileInfo> upload_file_info,
« no previous file with comments | « chrome/browser/google_apis/drive_service_interface.h ('k') | chrome/browser/google_apis/drive_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698