OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 // to the syncapi model. | 327 // to the syncapi model. |
328 virtual void SaveChanges() = 0; | 328 virtual void SaveChanges() = 0; |
329 | 329 |
330 // Issue a final SaveChanges, and close sqlite handles. | 330 // Issue a final SaveChanges, and close sqlite handles. |
331 virtual void ShutdownOnSyncThread() = 0; | 331 virtual void ShutdownOnSyncThread() = 0; |
332 | 332 |
333 // May be called from any thread. | 333 // May be called from any thread. |
334 virtual UserShare* GetUserShare() = 0; | 334 virtual UserShare* GetUserShare() = 0; |
335 | 335 |
336 // Returns an instance of the main interface for non-blocking sync types. | 336 // Returns an instance of the main interface for non-blocking sync types. |
337 virtual syncer::SyncCore* GetSyncCore() = 0; | 337 virtual base::WeakPtr<syncer::SyncCore> GetSyncCore() = 0; |
338 | 338 |
339 // Returns the cache_guid of the currently open database. | 339 // Returns the cache_guid of the currently open database. |
340 // Requires that the SyncManager be initialized. | 340 // Requires that the SyncManager be initialized. |
341 virtual const std::string cache_guid() = 0; | 341 virtual const std::string cache_guid() = 0; |
342 | 342 |
343 // Reads the nigori node to determine if any experimental features should | 343 // Reads the nigori node to determine if any experimental features should |
344 // be enabled. | 344 // be enabled. |
345 // Note: opens a transaction. May be called on any thread. | 345 // Note: opens a transaction. May be called on any thread. |
346 virtual bool ReceivedExperiment(Experiments* experiments) = 0; | 346 virtual bool ReceivedExperiment(Experiments* experiments) = 0; |
347 | 347 |
348 // Uses a read-only transaction to determine if the directory being synced has | 348 // Uses a read-only transaction to determine if the directory being synced has |
349 // any remaining unsynced items. May be called on any thread. | 349 // any remaining unsynced items. May be called on any thread. |
350 virtual bool HasUnsyncedItems() = 0; | 350 virtual bool HasUnsyncedItems() = 0; |
351 | 351 |
352 // Returns the SyncManager's encryption handler. | 352 // Returns the SyncManager's encryption handler. |
353 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; | 353 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; |
354 | 354 |
355 // Ask the SyncManager to fetch updates for the given types. | 355 // Ask the SyncManager to fetch updates for the given types. |
356 virtual void RefreshTypes(ModelTypeSet types) = 0; | 356 virtual void RefreshTypes(ModelTypeSet types) = 0; |
357 | 357 |
358 // Returns any buffered protocol events. Does not clear the buffer. | 358 // Returns any buffered protocol events. Does not clear the buffer. |
359 virtual ScopedVector<syncer::ProtocolEvent> GetBufferedProtocolEvents() = 0; | 359 virtual ScopedVector<syncer::ProtocolEvent> GetBufferedProtocolEvents() = 0; |
360 }; | 360 }; |
361 | 361 |
362 } // namespace syncer | 362 } // namespace syncer |
363 | 363 |
364 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 364 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
OLD | NEW |