| 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_CHROMEOS_GDATA_GDATA_UPLOADER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 // OpenCompletionCallback(). This callback reads the directory entry to | 124 // OpenCompletionCallback(). This callback reads the directory entry to |
| 125 // determine the upload path. | 125 // determine the upload path. |
| 126 void OnReadDirectoryByPath(int upload_id, | 126 void OnReadDirectoryByPath(int upload_id, |
| 127 base::PlatformFileError error, | 127 base::PlatformFileError error, |
| 128 bool hide_hosted_documents, | 128 bool hide_hosted_documents, |
| 129 scoped_ptr<GDataDirectoryProto> dir_proto); | 129 scoped_ptr<GDataDirectoryProto> dir_proto); |
| 130 | 130 |
| 131 // Initiate the upload. | 131 // Initiate the upload. |
| 132 void InitiateUpload(UploadFileInfo* uploader_file_info); | 132 void InitiateUpload(UploadFileInfo* uploader_file_info); |
| 133 | 133 |
| 134 // When upload completes, move the file into the gdata cache. | |
| 135 void MoveFileToCache(UploadFileInfo* upload_file_info); | |
| 136 | |
| 137 // Handle failed uploads. | 134 // Handle failed uploads. |
| 138 void UploadFailed(scoped_ptr<UploadFileInfo> upload_file_info, | 135 void UploadFailed(scoped_ptr<UploadFileInfo> upload_file_info, |
| 139 base::PlatformFileError error); | 136 base::PlatformFileError error); |
| 140 | 137 |
| 141 // Removes |upload_id| from UploadFileInfoMap |pending_uploads_|. | 138 // Removes |upload_id| from UploadFileInfoMap |pending_uploads_|. |
| 142 // Note that this does not delete the UploadFileInfo object itself, | 139 // Note that this does not delete the UploadFileInfo object itself, |
| 143 // because it may still be in use by an asynchronous function. | 140 // because it may still be in use by an asynchronous function. |
| 144 void RemoveUpload(int upload_id); | 141 void RemoveUpload(int upload_id); |
| 145 | 142 |
| 146 // Starts uploading a file with |upload_file_info|. Returns a new upload | 143 // Starts uploading a file with |upload_file_info|. Returns a new upload |
| (...skipping 13 matching lines...) Expand all Loading... |
| 160 | 157 |
| 161 // Factory for various callbacks. | 158 // Factory for various callbacks. |
| 162 base::WeakPtrFactory<GDataUploader> uploader_factory_; | 159 base::WeakPtrFactory<GDataUploader> uploader_factory_; |
| 163 | 160 |
| 164 DISALLOW_COPY_AND_ASSIGN(GDataUploader); | 161 DISALLOW_COPY_AND_ASSIGN(GDataUploader); |
| 165 }; | 162 }; |
| 166 | 163 |
| 167 } // namespace gdata | 164 } // namespace gdata |
| 168 | 165 |
| 169 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ | 166 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ |
| OLD | NEW |