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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 // drive::DriveServiceObserver overrides. | 114 // drive::DriveServiceObserver overrides. |
115 virtual void OnReadyToSendRequests() OVERRIDE; | 115 virtual void OnReadyToSendRequests() OVERRIDE; |
116 virtual void OnRefreshTokenInvalid() OVERRIDE; | 116 virtual void OnRefreshTokenInvalid() OVERRIDE; |
117 | 117 |
118 // net::NetworkChangeNotifier::NetworkChangeObserver overrides. | 118 // net::NetworkChangeNotifier::NetworkChangeObserver overrides. |
119 virtual void OnNetworkChanged( | 119 virtual void OnNetworkChanged( |
120 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; | 120 net::NetworkChangeNotifier::ConnectionType type) OVERRIDE; |
121 | 121 |
122 drive::DriveServiceInterface* GetDriveService(); | 122 drive::DriveServiceInterface* GetDriveService(); |
123 drive::DriveUploaderInterface* GetDriveUploader(); | 123 drive::DriveUploaderInterface* GetDriveUploader(); |
124 MetadataDatabase* GetMetadataDatabase(); | 124 |
125 // NOTICE: Basically, metadata database runs on |worker_task_runner_|. | |
126 // Handling it through GetMetadataDatabaseForTesting() in the main thread | |
127 // may bring race condition. | |
tzik
2014/05/29 02:31:09
I believe we should convert SyncEngineTest to Sync
peria
2014/05/29 03:11:46
I filed a bug crbug.com/378621. How about leaving
| |
128 MetadataDatabase* GetMetadataDatabaseForTesting(); | |
125 SyncTaskManager* GetSyncTaskManagerForTesting(); | 129 SyncTaskManager* GetSyncTaskManagerForTesting(); |
126 | 130 |
127 void OnPendingFileListUpdated(int item_count); | 131 void OnPendingFileListUpdated(int item_count); |
128 void OnFileStatusChanged(const fileapi::FileSystemURL& url, | 132 void OnFileStatusChanged(const fileapi::FileSystemURL& url, |
129 SyncFileStatus file_status, | 133 SyncFileStatus file_status, |
130 SyncAction sync_action, | 134 SyncAction sync_action, |
131 SyncDirection direction); | 135 SyncDirection direction); |
132 void UpdateServiceState(RemoteServiceState state, | 136 void UpdateServiceState(RemoteServiceState state, |
133 const std::string& description); | 137 const std::string& description); |
138 void DidPromoteDemotedChanges(size_t num_trackers); | |
134 | 139 |
135 private: | 140 private: |
136 class WorkerObserver; | 141 class WorkerObserver; |
137 | 142 |
138 friend class DriveBackendSyncTest; | 143 friend class DriveBackendSyncTest; |
139 friend class SyncEngineTest; | 144 friend class SyncEngineTest; |
140 | 145 |
141 SyncEngine(scoped_ptr<drive::DriveServiceInterface> drive_service, | 146 SyncEngine(scoped_ptr<drive::DriveServiceInterface> drive_service, |
142 scoped_ptr<drive::DriveUploaderInterface> drive_uploader, | 147 scoped_ptr<drive::DriveUploaderInterface> drive_uploader, |
143 base::SequencedTaskRunner* worker_task_runner, | 148 base::SequencedTaskRunner* worker_task_runner, |
144 drive::DriveNotificationManager* notification_manager, | 149 drive::DriveNotificationManager* notification_manager, |
145 ExtensionServiceInterface* extension_service, | 150 ExtensionServiceInterface* extension_service, |
146 SigninManagerBase* signin_manager); | 151 SigninManagerBase* signin_manager); |
147 | 152 |
148 void UpdateRegisteredApps(); | 153 void UpdateRegisteredAppsForTesting(); |
149 | 154 |
150 scoped_ptr<drive::DriveServiceInterface> drive_service_; | 155 scoped_ptr<drive::DriveServiceInterface> drive_service_; |
151 scoped_ptr<DriveServiceWrapper> drive_service_wrapper_; | 156 scoped_ptr<DriveServiceWrapper> drive_service_wrapper_; |
152 scoped_ptr<drive::DriveUploaderInterface> drive_uploader_; | 157 scoped_ptr<drive::DriveUploaderInterface> drive_uploader_; |
153 scoped_ptr<DriveUploaderWrapper> drive_uploader_wrapper_; | 158 scoped_ptr<DriveUploaderWrapper> drive_uploader_wrapper_; |
154 RemoteChangeProcessor* remote_change_processor_; | 159 RemoteChangeProcessor* remote_change_processor_; |
155 scoped_ptr<RemoteChangeProcessorWrapper> remote_change_processor_wrapper_; | 160 scoped_ptr<RemoteChangeProcessorWrapper> remote_change_processor_wrapper_; |
156 | 161 |
157 scoped_ptr<RemoteChangeProcessorOnWorker> remote_change_processor_on_worker_; | 162 scoped_ptr<RemoteChangeProcessorOnWorker> remote_change_processor_on_worker_; |
158 | 163 |
(...skipping 15 matching lines...) Expand all Loading... | |
174 scoped_refptr<base::SequencedTaskRunner> worker_task_runner_; | 179 scoped_refptr<base::SequencedTaskRunner> worker_task_runner_; |
175 | 180 |
176 base::WeakPtrFactory<SyncEngine> weak_ptr_factory_; | 181 base::WeakPtrFactory<SyncEngine> weak_ptr_factory_; |
177 DISALLOW_COPY_AND_ASSIGN(SyncEngine); | 182 DISALLOW_COPY_AND_ASSIGN(SyncEngine); |
178 }; | 183 }; |
179 | 184 |
180 } // namespace drive_backend | 185 } // namespace drive_backend |
181 } // namespace sync_file_system | 186 } // namespace sync_file_system |
182 | 187 |
183 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ | 188 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_SYNC_ENGINE_H_ |
OLD | NEW |