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_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void AddSyncEventObserver(SyncEventObserver* observer); | 73 void AddSyncEventObserver(SyncEventObserver* observer); |
74 void RemoveSyncEventObserver(SyncEventObserver* observer); | 74 void RemoveSyncEventObserver(SyncEventObserver* observer); |
75 | 75 |
76 LocalChangeProcessor* GetLocalChangeProcessor(const GURL& origin); | 76 LocalChangeProcessor* GetLocalChangeProcessor(const GURL& origin); |
77 | 77 |
78 // SyncProcessRunner::Client implementations. | 78 // SyncProcessRunner::Client implementations. |
79 virtual void OnSyncIdle() OVERRIDE; | 79 virtual void OnSyncIdle() OVERRIDE; |
80 virtual SyncServiceState GetSyncServiceState() OVERRIDE; | 80 virtual SyncServiceState GetSyncServiceState() OVERRIDE; |
81 virtual SyncFileSystemService* GetSyncService() OVERRIDE; | 81 virtual SyncFileSystemService* GetSyncService() OVERRIDE; |
82 | 82 |
| 83 void OnPromotionCompleted(int* num_running_jobs); |
| 84 void CheckIfIdle(); |
| 85 |
83 TaskLogger* task_logger() { return &task_logger_; } | 86 TaskLogger* task_logger() { return &task_logger_; } |
84 | 87 |
| 88 void CallOnIdleForTesting(const base::Closure& callback); |
| 89 |
85 private: | 90 private: |
86 friend class SyncFileSystemServiceFactory; | 91 friend class SyncFileSystemServiceFactory; |
87 friend class SyncFileSystemServiceTest; | 92 friend class SyncFileSystemServiceTest; |
88 friend struct base::DefaultDeleter<SyncFileSystemService>; | 93 friend struct base::DefaultDeleter<SyncFileSystemService>; |
89 friend class LocalSyncRunner; | 94 friend class LocalSyncRunner; |
90 friend class RemoteSyncRunner; | 95 friend class RemoteSyncRunner; |
91 | 96 |
92 explicit SyncFileSystemService(Profile* profile); | 97 explicit SyncFileSystemService(Profile* profile); |
93 virtual ~SyncFileSystemService(); | 98 virtual ~SyncFileSystemService(); |
94 | 99 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // Holds all SyncProcessRunners. | 180 // Holds all SyncProcessRunners. |
176 ScopedVector<SyncProcessRunner> local_sync_runners_; | 181 ScopedVector<SyncProcessRunner> local_sync_runners_; |
177 ScopedVector<SyncProcessRunner> remote_sync_runners_; | 182 ScopedVector<SyncProcessRunner> remote_sync_runners_; |
178 | 183 |
179 // Indicates if sync is currently enabled or not. | 184 // Indicates if sync is currently enabled or not. |
180 bool sync_enabled_; | 185 bool sync_enabled_; |
181 | 186 |
182 TaskLogger task_logger_; | 187 TaskLogger task_logger_; |
183 ObserverList<SyncEventObserver> observers_; | 188 ObserverList<SyncEventObserver> observers_; |
184 | 189 |
| 190 bool promoting_demoted_changes_; |
| 191 base::Closure idle_callback_; |
| 192 |
185 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemService); | 193 DISALLOW_COPY_AND_ASSIGN(SyncFileSystemService); |
186 }; | 194 }; |
187 | 195 |
188 } // namespace sync_file_system | 196 } // namespace sync_file_system |
189 | 197 |
190 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ | 198 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_SYNC_FILE_SYSTEM_SERVICE_H_ |
OLD | NEW |