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_DRIVE_DRIVE_SCHEDULER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SCHEDULER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SCHEDULER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SCHEDULER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 std::string resource_id; | 175 std::string resource_id; |
176 | 176 |
177 // URL to access the contents of the operation's target. | 177 // URL to access the contents of the operation's target. |
178 // Used by: | 178 // Used by: |
179 // TYPE_DOWNLOAD_FILE | 179 // TYPE_DOWNLOAD_FILE |
180 GURL download_url; | 180 GURL download_url; |
181 | 181 |
182 // Online and cache path of the operation's target. | 182 // Online and cache path of the operation's target. |
183 // Used by: | 183 // Used by: |
184 // TYPE_DOWNLOAD_FILE | 184 // TYPE_DOWNLOAD_FILE |
185 base::FilePath virtual_path; | 185 // TYPE_UPLOAD_NEW_FILE |
186 base::FilePath local_cache_path; | 186 // TYPE_UPLOAD_EXISTING_FILE |
| 187 base::FilePath drive_file_path; |
| 188 base::FilePath local_file_path; |
187 | 189 |
188 // Parameter to get change list. | 190 // Parameter to get change list. |
189 // Used by: | 191 // Used by: |
190 // TYPE_GET_CHANGE_LIST | 192 // TYPE_GET_CHANGE_LIST |
191 int64 start_changestamp; | 193 int64 start_changestamp; |
192 | 194 |
193 // Parameter to get a resource list in a particular directory. | 195 // Parameter to get a resource list in a particular directory. |
194 // Used by: | 196 // Used by: |
195 // TYPE_GET_RESOURCE_LIST_IN_DIRECTORY | 197 // TYPE_GET_RESOURCE_LIST_IN_DIRECTORY |
196 std::string directory_resource_id; | 198 std::string directory_resource_id; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 267 |
266 // Callback for result of GetContent. | 268 // Callback for result of GetContent. |
267 // Used by: | 269 // Used by: |
268 // TYPE_DOWNLOAD_FILE | 270 // TYPE_DOWNLOAD_FILE |
269 google_apis::GetContentCallback get_content_callback; | 271 google_apis::GetContentCallback get_content_callback; |
270 | 272 |
271 // Parameters for UploadNewFile and UploadExistingFile | 273 // Parameters for UploadNewFile and UploadExistingFile |
272 // Used by: | 274 // Used by: |
273 // TYPE_UPLOAD_NEW_FILE | 275 // TYPE_UPLOAD_NEW_FILE |
274 // TYPE_UPLOAD_EXISTING_FILE | 276 // TYPE_UPLOAD_EXISTING_FILE |
275 base::FilePath drive_file_path; | |
276 base::FilePath local_file_path; | |
277 std::string content_type; | 277 std::string content_type; |
278 std::string etag; | 278 std::string etag; |
279 std::string title; | 279 std::string title; |
280 google_apis::UploadCompletionCallback upload_completion_callback; | 280 google_apis::UploadCompletionCallback upload_completion_callback; |
281 }; | 281 }; |
282 | 282 |
283 // Adds the specified job to the queue and starts the job loop for the queue | 283 // Adds the specified job to the queue and starts the job loop for the queue |
284 // if needed. | 284 // if needed. |
285 void StartNewJob(scoped_ptr<QueueEntry> job, JobType type); | 285 void StartNewJob(scoped_ptr<QueueEntry> job, JobType type); |
286 | 286 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 const base::FilePath& temp_file); | 353 const base::FilePath& temp_file); |
354 | 354 |
355 // Callback for job finishing with a UploadCompletionCallback. | 355 // Callback for job finishing with a UploadCompletionCallback. |
356 void OnUploadCompletionJobDone( | 356 void OnUploadCompletionJobDone( |
357 scoped_ptr<QueueEntry> queue_entry, | 357 scoped_ptr<QueueEntry> queue_entry, |
358 google_apis::DriveUploadError error, | 358 google_apis::DriveUploadError error, |
359 const base::FilePath& drive_path, | 359 const base::FilePath& drive_path, |
360 const base::FilePath& file_path, | 360 const base::FilePath& file_path, |
361 scoped_ptr<google_apis::ResourceEntry> resource_entry); | 361 scoped_ptr<google_apis::ResourceEntry> resource_entry); |
362 | 362 |
| 363 // Updates the progress status of the specified job. |
| 364 void UpdateProgress(JobID job_id, int64 progress, int64 total); |
| 365 |
363 // net::NetworkChangeNotifier::ConnectionTypeObserver override. | 366 // net::NetworkChangeNotifier::ConnectionTypeObserver override. |
364 virtual void OnConnectionTypeChanged( | 367 virtual void OnConnectionTypeChanged( |
365 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; | 368 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; |
366 | 369 |
367 // Get the type of queue the specified job should be put in. | 370 // Get the type of queue the specified job should be put in. |
368 QueueType GetJobQueueType(JobType type); | 371 QueueType GetJobQueueType(JobType type); |
369 | 372 |
370 // For testing only. Disables throttling so that testing is faster. | 373 // For testing only. Disables throttling so that testing is faster. |
371 void SetDisableThrottling(bool disable) { disable_throttling_ = disable; } | 374 void SetDisableThrottling(bool disable) { disable_throttling_ = disable; } |
372 | 375 |
(...skipping 30 matching lines...) Expand all Loading... |
403 | 406 |
404 // Note: This should remain the last member so it'll be destroyed and | 407 // Note: This should remain the last member so it'll be destroyed and |
405 // invalidate its weak pointers before any other members are destroyed. | 408 // invalidate its weak pointers before any other members are destroyed. |
406 base::WeakPtrFactory<DriveScheduler> weak_ptr_factory_; | 409 base::WeakPtrFactory<DriveScheduler> weak_ptr_factory_; |
407 DISALLOW_COPY_AND_ASSIGN(DriveScheduler); | 410 DISALLOW_COPY_AND_ASSIGN(DriveScheduler); |
408 }; | 411 }; |
409 | 412 |
410 } // namespace drive | 413 } // namespace drive |
411 | 414 |
412 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SCHEDULER_H_ | 415 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SCHEDULER_H_ |
OLD | NEW |