| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/sync_file_system/drive_backend/drive_uploader_on_worker
.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/drive_uploader_on_worker
.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 | 35 |
| 36 google_apis::CancelCallback DriveUploaderOnWorker::UploadNewFile( | 36 google_apis::CancelCallback DriveUploaderOnWorker::UploadNewFile( |
| 37 const std::string& parent_resource_id, | 37 const std::string& parent_resource_id, |
| 38 const base::FilePath& local_file_path, | 38 const base::FilePath& local_file_path, |
| 39 const std::string& title, | 39 const std::string& title, |
| 40 const std::string& content_type, | 40 const std::string& content_type, |
| 41 const drive::UploadNewFileOptions& options, | 41 const drive::UploadNewFileOptions& options, |
| 42 const drive::UploadCompletionCallback& callback, | 42 const drive::UploadCompletionCallback& callback, |
| 43 const google_apis::ProgressCallback& progress_callback) { | 43 const google_apis::ProgressCallback& progress_callback) { |
| 44 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); | 44 DCHECK(sequece_checker_.CalledOnValidSequence()); |
| 45 | 45 |
| 46 ui_task_runner_->PostTask( | 46 ui_task_runner_->PostTask( |
| 47 FROM_HERE, | 47 FROM_HERE, |
| 48 base::Bind(&DriveUploaderWrapper::UploadNewFile, | 48 base::Bind(&DriveUploaderWrapper::UploadNewFile, |
| 49 wrapper_, | 49 wrapper_, |
| 50 parent_resource_id, | 50 parent_resource_id, |
| 51 local_file_path, | 51 local_file_path, |
| 52 title, | 52 title, |
| 53 content_type, | 53 content_type, |
| 54 options, | 54 options, |
| 55 RelayCallbackToTaskRunner( | 55 RelayCallbackToTaskRunner( |
| 56 worker_task_runner_.get(), FROM_HERE, callback))); | 56 worker_task_runner_.get(), FROM_HERE, callback))); |
| 57 | 57 |
| 58 return google_apis::CancelCallback(); | 58 return google_apis::CancelCallback(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 google_apis::CancelCallback DriveUploaderOnWorker::UploadExistingFile( | 61 google_apis::CancelCallback DriveUploaderOnWorker::UploadExistingFile( |
| 62 const std::string& resource_id, | 62 const std::string& resource_id, |
| 63 const base::FilePath& local_file_path, | 63 const base::FilePath& local_file_path, |
| 64 const std::string& content_type, | 64 const std::string& content_type, |
| 65 const drive::UploadExistingFileOptions& options, | 65 const drive::UploadExistingFileOptions& options, |
| 66 const drive::UploadCompletionCallback& callback, | 66 const drive::UploadCompletionCallback& callback, |
| 67 const google_apis::ProgressCallback& progress_callback) { | 67 const google_apis::ProgressCallback& progress_callback) { |
| 68 DCHECK(sequece_checker_.CalledOnValidSequencedThread()); | 68 DCHECK(sequece_checker_.CalledOnValidSequence()); |
| 69 | 69 |
| 70 ui_task_runner_->PostTask( | 70 ui_task_runner_->PostTask( |
| 71 FROM_HERE, | 71 FROM_HERE, |
| 72 base::Bind(&DriveUploaderWrapper::UploadExistingFile, | 72 base::Bind(&DriveUploaderWrapper::UploadExistingFile, |
| 73 wrapper_, | 73 wrapper_, |
| 74 resource_id, | 74 resource_id, |
| 75 local_file_path, | 75 local_file_path, |
| 76 content_type, | 76 content_type, |
| 77 options, | 77 options, |
| 78 RelayCallbackToTaskRunner( | 78 RelayCallbackToTaskRunner( |
| 79 worker_task_runner_.get(), FROM_HERE, callback))); | 79 worker_task_runner_.get(), FROM_HERE, callback))); |
| 80 | 80 |
| 81 return google_apis::CancelCallback(); | 81 return google_apis::CancelCallback(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 google_apis::CancelCallback DriveUploaderOnWorker::ResumeUploadFile( | 84 google_apis::CancelCallback DriveUploaderOnWorker::ResumeUploadFile( |
| 85 const GURL& upload_location, | 85 const GURL& upload_location, |
| 86 const base::FilePath& local_file_path, | 86 const base::FilePath& local_file_path, |
| 87 const std::string& content_type, | 87 const std::string& content_type, |
| 88 const drive::UploadCompletionCallback& callback, | 88 const drive::UploadCompletionCallback& callback, |
| 89 const google_apis::ProgressCallback& progress_callback) { | 89 const google_apis::ProgressCallback& progress_callback) { |
| 90 NOTREACHED(); | 90 NOTREACHED(); |
| 91 return google_apis::CancelCallback(); | 91 return google_apis::CancelCallback(); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace drive_backend | 94 } // namespace drive_backend |
| 95 } // namespace sync_file_system | 95 } // namespace sync_file_system |
| OLD | NEW |