| 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_JOB_SCHEDULER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 const google_apis::EntryActionCallback& callback); | 152 const google_apis::EntryActionCallback& callback); |
| 153 | 153 |
| 154 // Adds a RemoveResourceFromDirectory operation to the queue. | 154 // Adds a RemoveResourceFromDirectory operation to the queue. |
| 155 void RemoveResourceFromDirectory( | 155 void RemoveResourceFromDirectory( |
| 156 const std::string& parent_resource_id, | 156 const std::string& parent_resource_id, |
| 157 const std::string& resource_id, | 157 const std::string& resource_id, |
| 158 const ClientContext& context, | 158 const ClientContext& context, |
| 159 const google_apis::EntryActionCallback& callback); | 159 const google_apis::EntryActionCallback& callback); |
| 160 | 160 |
| 161 // Adds a AddNewDirectory operation to the queue. | 161 // Adds a AddNewDirectory operation to the queue. |
| 162 void AddNewDirectory( | 162 void AddNewDirectory(const std::string& parent_resource_id, |
| 163 const std::string& parent_resource_id, | 163 const std::string& directory_title, |
| 164 const std::string& directory_title, | 164 const AddNewDirectoryOptions& options, |
| 165 const DriveServiceInterface::AddNewDirectoryOptions& options, | 165 const ClientContext& context, |
| 166 const ClientContext& context, | 166 const google_apis::FileResourceCallback& callback); |
| 167 const google_apis::FileResourceCallback& callback); | |
| 168 | 167 |
| 169 // Adds a DownloadFile operation to the queue. | 168 // Adds a DownloadFile operation to the queue. |
| 170 // The first two arguments |virtual_path| and |expected_file_size| are used | 169 // The first two arguments |virtual_path| and |expected_file_size| are used |
| 171 // only for filling JobInfo for the operation so that observers can get the | 170 // only for filling JobInfo for the operation so that observers can get the |
| 172 // detail. The actual operation never refers these values. | 171 // detail. The actual operation never refers these values. |
| 173 JobID DownloadFile( | 172 JobID DownloadFile( |
| 174 const base::FilePath& virtual_path, | 173 const base::FilePath& virtual_path, |
| 175 int64 expected_file_size, | 174 int64 expected_file_size, |
| 176 const base::FilePath& local_cache_path, | 175 const base::FilePath& local_cache_path, |
| 177 const std::string& resource_id, | 176 const std::string& resource_id, |
| 178 const ClientContext& context, | 177 const ClientContext& context, |
| 179 const google_apis::DownloadActionCallback& download_action_callback, | 178 const google_apis::DownloadActionCallback& download_action_callback, |
| 180 const google_apis::GetContentCallback& get_content_callback); | 179 const google_apis::GetContentCallback& get_content_callback); |
| 181 | 180 |
| 182 // Adds an UploadNewFile operation to the queue. | 181 // Adds an UploadNewFile operation to the queue. |
| 183 void UploadNewFile(const std::string& parent_resource_id, | 182 void UploadNewFile(const std::string& parent_resource_id, |
| 184 const base::FilePath& drive_file_path, | 183 const base::FilePath& drive_file_path, |
| 185 const base::FilePath& local_file_path, | 184 const base::FilePath& local_file_path, |
| 186 const std::string& title, | 185 const std::string& title, |
| 187 const std::string& content_type, | 186 const std::string& content_type, |
| 188 const DriveUploader::UploadNewFileOptions& options, | 187 const UploadNewFileOptions& options, |
| 189 const ClientContext& context, | 188 const ClientContext& context, |
| 190 const google_apis::FileResourceCallback& callback); | 189 const google_apis::FileResourceCallback& callback); |
| 191 | 190 |
| 192 // Adds an UploadExistingFile operation to the queue. | 191 // Adds an UploadExistingFile operation to the queue. |
| 193 void UploadExistingFile( | 192 void UploadExistingFile(const std::string& resource_id, |
| 194 const std::string& resource_id, | 193 const base::FilePath& drive_file_path, |
| 195 const base::FilePath& drive_file_path, | 194 const base::FilePath& local_file_path, |
| 196 const base::FilePath& local_file_path, | 195 const std::string& content_type, |
| 197 const std::string& content_type, | 196 const UploadExistingFileOptions& options, |
| 198 const DriveUploader::UploadExistingFileOptions& options, | 197 const ClientContext& context, |
| 199 const ClientContext& context, | 198 const google_apis::FileResourceCallback& callback); |
| 200 const google_apis::FileResourceCallback& callback); | |
| 201 | 199 |
| 202 // Adds AddPermission operation to the queue. |callback| must not be null. | 200 // Adds AddPermission operation to the queue. |callback| must not be null. |
| 203 void AddPermission(const std::string& resource_id, | 201 void AddPermission(const std::string& resource_id, |
| 204 const std::string& email, | 202 const std::string& email, |
| 205 google_apis::drive::PermissionRole role, | 203 google_apis::drive::PermissionRole role, |
| 206 const google_apis::EntryActionCallback& callback); | 204 const google_apis::EntryActionCallback& callback); |
| 207 | 205 |
| 208 private: | 206 private: |
| 209 friend class JobSchedulerTest; | 207 friend class JobSchedulerTest; |
| 210 | 208 |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 | 400 |
| 403 // Note: This should remain the last member so it'll be destroyed and | 401 // Note: This should remain the last member so it'll be destroyed and |
| 404 // invalidate its weak pointers before any other members are destroyed. | 402 // invalidate its weak pointers before any other members are destroyed. |
| 405 base::WeakPtrFactory<JobScheduler> weak_ptr_factory_; | 403 base::WeakPtrFactory<JobScheduler> weak_ptr_factory_; |
| 406 DISALLOW_COPY_AND_ASSIGN(JobScheduler); | 404 DISALLOW_COPY_AND_ASSIGN(JobScheduler); |
| 407 }; | 405 }; |
| 408 | 406 |
| 409 } // namespace drive | 407 } // namespace drive |
| 410 | 408 |
| 411 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ | 409 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ |
| OLD | NEW |