OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DRIVE_BACKEND_SYNC_ENGINE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 private: | 152 private: |
153 class WorkerObserver; | 153 class WorkerObserver; |
154 | 154 |
155 friend class DriveBackendSyncTest; | 155 friend class DriveBackendSyncTest; |
156 friend class SyncEngineTest; | 156 friend class SyncEngineTest; |
157 friend class sync_file_system::SyncFileSystemTest; | 157 friend class sync_file_system::SyncFileSystemTest; |
158 | 158 |
159 SyncEngine(const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner, | 159 SyncEngine(const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner, |
160 const scoped_refptr<base::SequencedTaskRunner>& worker_task_runner, | 160 const scoped_refptr<base::SequencedTaskRunner>& worker_task_runner, |
161 const scoped_refptr<base::SequencedTaskRunner>& drive_task_runner, | 161 const scoped_refptr<base::SequencedTaskRunner>& drive_task_runner, |
| 162 const scoped_refptr<base::SequencedWorkerPool>& worker_pool, |
162 const base::FilePath& sync_file_system_dir, | 163 const base::FilePath& sync_file_system_dir, |
163 TaskLogger* task_logger, | 164 TaskLogger* task_logger, |
164 drive::DriveNotificationManager* notification_manager, | 165 drive::DriveNotificationManager* notification_manager, |
165 ExtensionServiceInterface* extension_service, | 166 ExtensionServiceInterface* extension_service, |
166 SigninManagerBase* signin_manager, | 167 SigninManagerBase* signin_manager, |
167 OAuth2TokenService* token_service, | 168 OAuth2TokenService* token_service, |
168 net::URLRequestContextGetter* request_context, | 169 net::URLRequestContextGetter* request_context, |
169 scoped_ptr<DriveServiceFactory> drive_service_factory, | 170 scoped_ptr<DriveServiceFactory> drive_service_factory, |
170 leveldb::Env* env_override); | 171 leveldb::Env* env_override); |
171 | 172 |
172 // Called by WorkerObserver. | 173 // Called by WorkerObserver. |
173 void OnPendingFileListUpdated(int item_count); | 174 void OnPendingFileListUpdated(int item_count); |
174 void OnFileStatusChanged(const storage::FileSystemURL& url, | 175 void OnFileStatusChanged(const storage::FileSystemURL& url, |
175 SyncFileType file_type, | 176 SyncFileType file_type, |
176 SyncFileStatus file_status, | 177 SyncFileStatus file_status, |
177 SyncAction sync_action, | 178 SyncAction sync_action, |
178 SyncDirection direction); | 179 SyncDirection direction); |
179 void UpdateServiceState(RemoteServiceState state, | 180 void UpdateServiceState(RemoteServiceState state, |
180 const std::string& description); | 181 const std::string& description); |
181 | 182 |
182 SyncStatusCallback TrackCallback(const SyncStatusCallback& callback); | 183 SyncStatusCallback TrackCallback(const SyncStatusCallback& callback); |
183 | 184 |
184 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | 185 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; |
185 scoped_refptr<base::SequencedTaskRunner> worker_task_runner_; | 186 scoped_refptr<base::SequencedTaskRunner> worker_task_runner_; |
186 scoped_refptr<base::SequencedTaskRunner> drive_task_runner_; | 187 scoped_refptr<base::SequencedTaskRunner> drive_task_runner_; |
| 188 scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
187 | 189 |
188 const base::FilePath sync_file_system_dir_; | 190 const base::FilePath sync_file_system_dir_; |
189 TaskLogger* task_logger_; | 191 TaskLogger* task_logger_; |
190 | 192 |
191 // These external services are not owned by SyncEngine. | 193 // These external services are not owned by SyncEngine. |
192 // The owner of the SyncEngine is responsible for their lifetime. | 194 // The owner of the SyncEngine is responsible for their lifetime. |
193 // I.e. the owner should declare the dependency explicitly by calling | 195 // I.e. the owner should declare the dependency explicitly by calling |
194 // KeyedService::DependsOn(). | 196 // KeyedService::DependsOn(). |
195 drive::DriveNotificationManager* notification_manager_; | 197 drive::DriveNotificationManager* notification_manager_; |
196 ExtensionServiceInterface* extension_service_; | 198 ExtensionServiceInterface* extension_service_; |
(...skipping 30 matching lines...) Expand all Loading... |
227 CallbackTracker callback_tracker_; | 229 CallbackTracker callback_tracker_; |
228 | 230 |
229 base::WeakPtrFactory<SyncEngine> weak_ptr_factory_; | 231 base::WeakPtrFactory<SyncEngine> weak_ptr_factory_; |
230 DISALLOW_COPY_AND_ASSIGN(SyncEngine); | 232 DISALLOW_COPY_AND_ASSIGN(SyncEngine); |
231 }; | 233 }; |
232 | 234 |
233 } // namespace drive_backend | 235 } // namespace drive_backend |
234 } // namespace sync_file_system | 236 } // namespace sync_file_system |
235 | 237 |
236 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ | 238 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ |
OLD | NEW |