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 14 matching lines...) Expand all Loading... |
25 // operations. It is responsible for handling retry logic, rate limiting, as | 25 // operations. It is responsible for handling retry logic, rate limiting, as |
26 // concurrency as appropriate. | 26 // concurrency as appropriate. |
27 class DriveScheduler | 27 class DriveScheduler |
28 : public net::NetworkChangeNotifier::ConnectionTypeObserver, | 28 : public net::NetworkChangeNotifier::ConnectionTypeObserver, |
29 public JobListInterface { | 29 public JobListInterface { |
30 public: | 30 public: |
31 DriveScheduler(Profile* profile, | 31 DriveScheduler(Profile* profile, |
32 google_apis::DriveServiceInterface* drive_service); | 32 google_apis::DriveServiceInterface* drive_service); |
33 virtual ~DriveScheduler(); | 33 virtual ~DriveScheduler(); |
34 | 34 |
35 // Initializes the object. This function should be called before any | |
36 // other functions. | |
37 void Initialize(); | |
38 | |
39 // JobListInterface overrides. | 35 // JobListInterface overrides. |
40 virtual std::vector<JobInfo> GetJobInfoList() OVERRIDE; | 36 virtual std::vector<JobInfo> GetJobInfoList() OVERRIDE; |
41 virtual void AddObserver(JobListObserver* observer) OVERRIDE; | 37 virtual void AddObserver(JobListObserver* observer) OVERRIDE; |
42 virtual void RemoveObserver(JobListObserver* observer) OVERRIDE; | 38 virtual void RemoveObserver(JobListObserver* observer) OVERRIDE; |
43 | 39 |
44 // Adds a GetAccountMetadata operation to the queue. | 40 // Adds a GetAccountMetadata operation to the queue. |
45 // |callback| must not be null. | 41 // |callback| must not be null. |
46 void GetAccountMetadata( | 42 void GetAccountMetadata( |
47 const google_apis::GetAccountMetadataCallback& callback); | 43 const google_apis::GetAccountMetadataCallback& callback); |
48 | 44 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 JobIDMap job_map_; | 394 JobIDMap job_map_; |
399 | 395 |
400 // The list of observers for the scheduler. | 396 // The list of observers for the scheduler. |
401 ObserverList<JobListObserver> observer_list_; | 397 ObserverList<JobListObserver> observer_list_; |
402 | 398 |
403 google_apis::DriveServiceInterface* drive_service_; | 399 google_apis::DriveServiceInterface* drive_service_; |
404 scoped_ptr<google_apis::DriveUploaderInterface> uploader_; | 400 scoped_ptr<google_apis::DriveUploaderInterface> uploader_; |
405 | 401 |
406 Profile* profile_; | 402 Profile* profile_; |
407 | 403 |
408 // Whether this instance is initialized or not. | |
409 bool initialized_; | |
410 | |
411 // Note: This should remain the last member so it'll be destroyed and | 404 // Note: This should remain the last member so it'll be destroyed and |
412 // invalidate its weak pointers before any other members are destroyed. | 405 // invalidate its weak pointers before any other members are destroyed. |
413 base::WeakPtrFactory<DriveScheduler> weak_ptr_factory_; | 406 base::WeakPtrFactory<DriveScheduler> weak_ptr_factory_; |
414 DISALLOW_COPY_AND_ASSIGN(DriveScheduler); | 407 DISALLOW_COPY_AND_ASSIGN(DriveScheduler); |
415 }; | 408 }; |
416 | 409 |
417 } // namespace drive | 410 } // namespace drive |
418 | 411 |
419 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SCHEDULER_H_ | 412 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SCHEDULER_H_ |
OLD | NEW |