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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 // Removes |upload_id| from UploadFileInfoMap |pending_uploads_|. | 126 // Removes |upload_id| from UploadFileInfoMap |pending_uploads_|. |
127 // Note that this does not delete the UploadFileInfo object itself, | 127 // Note that this does not delete the UploadFileInfo object itself, |
128 // because it may still be in use by an asynchronous function. | 128 // because it may still be in use by an asynchronous function. |
129 void RemoveUpload(int upload_id); | 129 void RemoveUpload(int upload_id); |
130 | 130 |
131 // Starts uploading a file with |upload_file_info|. Returns a new upload | 131 // Starts uploading a file with |upload_file_info|. Returns a new upload |
132 // ID assigned to |upload_file_info|. | 132 // ID assigned to |upload_file_info|. |
133 int StartUploadFile(scoped_ptr<UploadFileInfo> upload_file_info); | 133 int StartUploadFile(scoped_ptr<UploadFileInfo> upload_file_info); |
134 | 134 |
135 // Pointers to DriveServiceInterface object owned by GDataSystemService. | 135 // Pointers to DriveServiceInterface object owned by DriveSystemService. |
136 // The lifetime of this object is guaranteed to exceed that of the | 136 // The lifetime of this object is guaranteed to exceed that of the |
137 // GDataUploader instance. | 137 // GDataUploader instance. |
138 DriveServiceInterface* drive_service_; | 138 DriveServiceInterface* drive_service_; |
139 | 139 |
140 int next_upload_id_; // id counter. | 140 int next_upload_id_; // id counter. |
141 | 141 |
142 typedef std::map<int, UploadFileInfo*> UploadFileInfoMap; | 142 typedef std::map<int, UploadFileInfo*> UploadFileInfoMap; |
143 UploadFileInfoMap pending_uploads_; | 143 UploadFileInfoMap pending_uploads_; |
144 | 144 |
145 // Note: This should remain the last member so it'll be destroyed and | 145 // Note: This should remain the last member so it'll be destroyed and |
146 // invalidate its weak pointers before any other members are destroyed. | 146 // invalidate its weak pointers before any other members are destroyed. |
147 base::WeakPtrFactory<GDataUploader> weak_ptr_factory_; | 147 base::WeakPtrFactory<GDataUploader> weak_ptr_factory_; |
148 | 148 |
149 DISALLOW_COPY_AND_ASSIGN(GDataUploader); | 149 DISALLOW_COPY_AND_ASSIGN(GDataUploader); |
150 }; | 150 }; |
151 | 151 |
152 } // namespace gdata | 152 } // namespace gdata |
153 | 153 |
154 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ | 154 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_UPLOADER_H_ |
OLD | NEW |