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 |
11 #include "base/id_map.h" | 11 #include "base/id_map.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "chrome/browser/chromeos/drive/job_list.h" | 14 #include "chrome/browser/chromeos/drive/job_list.h" |
15 #include "chrome/browser/chromeos/drive/job_queue.h" | 15 #include "chrome/browser/chromeos/drive/job_queue.h" |
16 #include "chrome/browser/drive/drive_service_interface.h" | 16 #include "chrome/browser/drive/drive_service_interface.h" |
17 #include "chrome/browser/drive/drive_uploader.h" | 17 #include "chrome/browser/drive/drive_uploader.h" |
18 #include "net/base/network_change_notifier.h" | 18 #include "net/base/network_change_notifier.h" |
19 | 19 |
20 class PrefService; | 20 class PrefService; |
21 | 21 |
22 namespace base { | 22 namespace base { |
23 class SeqencedTaskRunner; | 23 class SeqencedTaskRunner; |
24 } | 24 } |
25 | 25 |
| 26 namespace user_manager { |
| 27 class UserID; |
| 28 } |
| 29 |
26 namespace drive { | 30 namespace drive { |
27 | 31 |
28 class EventLogger; | 32 class EventLogger; |
29 | 33 |
30 // Priority of a job. Higher values are lower priority. | 34 // Priority of a job. Higher values are lower priority. |
31 enum ContextType { | 35 enum ContextType { |
32 USER_INITIATED, | 36 USER_INITIATED, |
33 BACKGROUND, | 37 BACKGROUND, |
34 // Indicates the number of values of this enum. | 38 // Indicates the number of values of this enum. |
35 NUM_CONTEXT_TYPES, | 39 NUM_CONTEXT_TYPES, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 int64 expected_file_size, | 198 int64 expected_file_size, |
195 const base::FilePath& drive_file_path, | 199 const base::FilePath& drive_file_path, |
196 const base::FilePath& local_file_path, | 200 const base::FilePath& local_file_path, |
197 const std::string& content_type, | 201 const std::string& content_type, |
198 const UploadExistingFileOptions& options, | 202 const UploadExistingFileOptions& options, |
199 const ClientContext& context, | 203 const ClientContext& context, |
200 const google_apis::FileResourceCallback& callback); | 204 const google_apis::FileResourceCallback& callback); |
201 | 205 |
202 // Adds AddPermission operation to the queue. |callback| must not be null. | 206 // Adds AddPermission operation to the queue. |callback| must not be null. |
203 void AddPermission(const std::string& resource_id, | 207 void AddPermission(const std::string& resource_id, |
204 const std::string& email, | 208 const user_manager::UserID& email, |
205 google_apis::drive::PermissionRole role, | 209 google_apis::drive::PermissionRole role, |
206 const google_apis::EntryActionCallback& callback); | 210 const google_apis::EntryActionCallback& callback); |
207 | 211 |
208 private: | 212 private: |
209 friend class JobSchedulerTest; | 213 friend class JobSchedulerTest; |
210 | 214 |
211 enum QueueType { | 215 enum QueueType { |
212 METADATA_QUEUE, | 216 METADATA_QUEUE, |
213 FILE_QUEUE, | 217 FILE_QUEUE, |
214 NUM_QUEUES | 218 NUM_QUEUES |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 | 401 |
398 // Note: This should remain the last member so it'll be destroyed and | 402 // Note: This should remain the last member so it'll be destroyed and |
399 // invalidate its weak pointers before any other members are destroyed. | 403 // invalidate its weak pointers before any other members are destroyed. |
400 base::WeakPtrFactory<JobScheduler> weak_ptr_factory_; | 404 base::WeakPtrFactory<JobScheduler> weak_ptr_factory_; |
401 DISALLOW_COPY_AND_ASSIGN(JobScheduler); | 405 DISALLOW_COPY_AND_ASSIGN(JobScheduler); |
402 }; | 406 }; |
403 | 407 |
404 } // namespace drive | 408 } // namespace drive |
405 | 409 |
406 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ | 410 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_JOB_SCHEDULER_H_ |
OLD | NEW |