| 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 COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ | 5 #ifndef COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ |
| 6 #define COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ | 6 #define COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 class SyncableService : public SyncChangeProcessor, | 29 class SyncableService : public SyncChangeProcessor, |
| 30 public base::SupportsWeakPtr<SyncableService> { | 30 public base::SupportsWeakPtr<SyncableService> { |
| 31 public: | 31 public: |
| 32 // A StartSyncFlare is useful when your SyncableService has a need for sync | 32 // A StartSyncFlare is useful when your SyncableService has a need for sync |
| 33 // to start ASAP, typically because a local change event has occurred but | 33 // to start ASAP, typically because a local change event has occurred but |
| 34 // MergeDataAndStartSyncing hasn't been called yet, meaning you don't have a | 34 // MergeDataAndStartSyncing hasn't been called yet, meaning you don't have a |
| 35 // SyncChangeProcessor. The sync subsystem will respond soon after invoking | 35 // SyncChangeProcessor. The sync subsystem will respond soon after invoking |
| 36 // Run() on your flare by calling MergeDataAndStartSyncing. The ModelType | 36 // Run() on your flare by calling MergeDataAndStartSyncing. The ModelType |
| 37 // parameter is included so that the recieving end can track usage and timing | 37 // parameter is included so that the recieving end can track usage and timing |
| 38 // statistics, make optimizations or tradeoffs by type, etc. | 38 // statistics, make optimizations or tradeoffs by type, etc. |
| 39 typedef base::Callback<void(ModelType)> StartSyncFlare; | 39 using StartSyncFlare = base::Callback<void(ModelType)>; |
| 40 | 40 |
| 41 // Informs the service to begin syncing the specified synced datatype |type|. | 41 // Informs the service to begin syncing the specified synced datatype |type|. |
| 42 // The service should then merge |initial_sync_data| into it's local data, | 42 // The service should then merge |initial_sync_data| into it's local data, |
| 43 // calling |sync_processor|'s ProcessSyncChanges as necessary to reconcile the | 43 // calling |sync_processor|'s ProcessSyncChanges as necessary to reconcile the |
| 44 // two. After this, the SyncableService's local data should match the server | 44 // two. After this, the SyncableService's local data should match the server |
| 45 // data, and the service should be ready to receive and process any further | 45 // data, and the service should be ready to receive and process any further |
| 46 // SyncChange's as they occur. | 46 // SyncChange's as they occur. |
| 47 // Returns: a SyncMergeResult whose error field reflects whether an error | 47 // Returns: a SyncMergeResult whose error field reflects whether an error |
| 48 // was encountered while merging the two models. The merge result | 48 // was encountered while merging the two models. The merge result |
| 49 // may also contain optional merge statistics. | 49 // may also contain optional merge statistics. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 virtual void SetAttachmentService( | 86 virtual void SetAttachmentService( |
| 87 std::unique_ptr<AttachmentService> attachment_service); | 87 std::unique_ptr<AttachmentService> attachment_service); |
| 88 | 88 |
| 89 protected: | 89 protected: |
| 90 ~SyncableService() override; | 90 ~SyncableService() override; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace syncer | 93 } // namespace syncer |
| 94 | 94 |
| 95 #endif // COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ | 95 #endif // COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ |
| OLD | NEW |