| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_DRIVE_DRIVE_UPLOADER_H_ | 5 #ifndef CHROME_BROWSER_DRIVE_DRIVE_UPLOADER_H_ |
| 6 #define CHROME_BROWSER_DRIVE_DRIVE_UPLOADER_H_ | 6 #define CHROME_BROWSER_DRIVE_DRIVE_UPLOADER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // DriveService callback for InitiateUpload. | 165 // DriveService callback for InitiateUpload. |
| 166 void OnUploadLocationReceived(scoped_ptr<UploadFileInfo> upload_file_info, | 166 void OnUploadLocationReceived(scoped_ptr<UploadFileInfo> upload_file_info, |
| 167 google_apis::GDataErrorCode code, | 167 google_apis::GDataErrorCode code, |
| 168 const GURL& upload_location); | 168 const GURL& upload_location); |
| 169 | 169 |
| 170 // Starts to get the current upload status for the file uploading. | 170 // Starts to get the current upload status for the file uploading. |
| 171 // Upon completion, OnUploadRangeResponseReceived should be called. | 171 // Upon completion, OnUploadRangeResponseReceived should be called. |
| 172 void StartGetUploadStatus(scoped_ptr<UploadFileInfo> upload_file_info); | 172 void StartGetUploadStatus(scoped_ptr<UploadFileInfo> upload_file_info); |
| 173 | 173 |
| 174 // Uploads the next chunk of data from the file. | 174 // Uploads the next chunk of data from the file. |
| 175 void UploadNextChunk(scoped_ptr<UploadFileInfo> upload_file_info, | 175 void UploadNextChunk(scoped_ptr<UploadFileInfo> upload_file_info); |
| 176 int64 start_position); | |
| 177 | 176 |
| 178 // DriveService callback for ResumeUpload. | 177 // DriveService callback for ResumeUpload. |
| 179 void OnUploadRangeResponseReceived( | 178 void OnUploadRangeResponseReceived( |
| 180 scoped_ptr<UploadFileInfo> upload_file_info, | 179 scoped_ptr<UploadFileInfo> upload_file_info, |
| 181 const google_apis::UploadRangeResponse& response, | 180 const google_apis::UploadRangeResponse& response, |
| 182 scoped_ptr<google_apis::ResourceEntry> entry); | 181 scoped_ptr<google_apis::ResourceEntry> entry); |
| 183 void OnUploadProgress(const google_apis::ProgressCallback& callback, | 182 void OnUploadProgress(const google_apis::ProgressCallback& callback, |
| 184 int64 start_position, | 183 int64 start_position, |
| 185 int64 total_size, | 184 int64 total_size, |
| 186 int64 progress_of_chunk, | 185 int64 progress_of_chunk, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 198 | 197 |
| 199 // Note: This should remain the last member so it'll be destroyed and | 198 // Note: This should remain the last member so it'll be destroyed and |
| 200 // invalidate its weak pointers before any other members are destroyed. | 199 // invalidate its weak pointers before any other members are destroyed. |
| 201 base::WeakPtrFactory<DriveUploader> weak_ptr_factory_; | 200 base::WeakPtrFactory<DriveUploader> weak_ptr_factory_; |
| 202 DISALLOW_COPY_AND_ASSIGN(DriveUploader); | 201 DISALLOW_COPY_AND_ASSIGN(DriveUploader); |
| 203 }; | 202 }; |
| 204 | 203 |
| 205 } // namespace drive | 204 } // namespace drive |
| 206 | 205 |
| 207 #endif // CHROME_BROWSER_DRIVE_DRIVE_UPLOADER_H_ | 206 #endif // CHROME_BROWSER_DRIVE_DRIVE_UPLOADER_H_ |
| OLD | NEW |