| 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_GLUE_SYNC_BACKEND_HOST_CORE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_CORE_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_CORE_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_CORE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 | 9 |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 syncer::ModelTypeSet types, | 235 syncer::ModelTypeSet types, |
| 236 scoped_refptr<base::SequencedTaskRunner> task_runner, | 236 scoped_refptr<base::SequencedTaskRunner> task_runner, |
| 237 base::Callback<void(const std::vector<syncer::ModelType>& type, | 237 base::Callback<void(const std::vector<syncer::ModelType>& type, |
| 238 ScopedVector<base::ListValue>) > callback); | 238 ScopedVector<base::ListValue>) > callback); |
| 239 | 239 |
| 240 // Tell the sync manager to persist its state by writing to disk. | 240 // Tell the sync manager to persist its state by writing to disk. |
| 241 // Called on the sync thread, both by a timer and, on Android, when the | 241 // Called on the sync thread, both by a timer and, on Android, when the |
| 242 // application is backgrounded. | 242 // application is backgrounded. |
| 243 void SaveChanges(); | 243 void SaveChanges(); |
| 244 | 244 |
| 245 void DoClearServerData( |
| 246 const syncer::SyncManager::ClearServerDataCallback& frontend_callback); |
| 247 |
| 245 private: | 248 private: |
| 246 friend class base::RefCountedThreadSafe<SyncBackendHostCore>; | 249 friend class base::RefCountedThreadSafe<SyncBackendHostCore>; |
| 247 friend class SyncBackendHostForProfileSyncTest; | 250 friend class SyncBackendHostForProfileSyncTest; |
| 248 | 251 |
| 249 ~SyncBackendHostCore() override; | 252 ~SyncBackendHostCore() override; |
| 250 | 253 |
| 251 // Invoked when initialization of syncapi is complete and we can start | 254 // Invoked when initialization of syncapi is complete and we can start |
| 252 // our timer. | 255 // our timer. |
| 253 // This must be called from the thread on which SaveChanges is intended to | 256 // This must be called from the thread on which SaveChanges is intended to |
| 254 // be run on; the host's |registrar_->sync_thread()|. | 257 // be run on; the host's |registrar_->sync_thread()|. |
| 255 void StartSavingChanges(); | 258 void StartSavingChanges(); |
| 256 | 259 |
| 260 void ClearServerDataDone(const base::Closure& frontend_callback); |
| 261 |
| 257 // Name used for debugging. | 262 // Name used for debugging. |
| 258 const std::string name_; | 263 const std::string name_; |
| 259 | 264 |
| 260 // Path of the folder that stores the sync data files. | 265 // Path of the folder that stores the sync data files. |
| 261 const base::FilePath sync_data_folder_path_; | 266 const base::FilePath sync_data_folder_path_; |
| 262 | 267 |
| 263 // Our parent SyncBackendHost. | 268 // Our parent SyncBackendHost. |
| 264 syncer::WeakHandle<SyncBackendHostImpl> host_; | 269 syncer::WeakHandle<SyncBackendHostImpl> host_; |
| 265 | 270 |
| 266 // The loop where all the sync backend operations happen. | 271 // The loop where all the sync backend operations happen. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 bool forward_type_info_; | 310 bool forward_type_info_; |
| 306 | 311 |
| 307 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; | 312 base::WeakPtrFactory<SyncBackendHostCore> weak_ptr_factory_; |
| 308 | 313 |
| 309 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); | 314 DISALLOW_COPY_AND_ASSIGN(SyncBackendHostCore); |
| 310 }; | 315 }; |
| 311 | 316 |
| 312 } // namespace browser_sync | 317 } // namespace browser_sync |
| 313 | 318 |
| 314 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_CORE_H_ | 319 #endif // CHROME_BROWSER_SYNC_GLUE_SYNC_BACKEND_HOST_CORE_H_ |
| OLD | NEW |