Chromium Code Reviews| Index: sync/api/syncable_service.h |
| diff --git a/sync/api/syncable_service.h b/sync/api/syncable_service.h |
| index 13c282ef5a601484bf7a05656a441a33f2e5bb0a..ec2b8b02c614620b048a64c471217f4d49b93a40 100644 |
| --- a/sync/api/syncable_service.h |
| +++ b/sync/api/syncable_service.h |
| @@ -7,6 +7,7 @@ |
| #include <vector> |
| +#include "base/callback.h" |
| #include "base/compiler_specific.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/memory/weak_ptr.h" |
| @@ -21,6 +22,16 @@ namespace syncer { |
| class SyncErrorFactory; |
| +// Used as a parameter to InjectStartSyncFlare. The StartSyncFlare is useful |
| +// when your SyncableService has a need for sync to start ASAP, typically |
| +// because a local change event has occurred but MergeDataAndStartSyncing |
| +// hasn't been called yet, meaning you don't have a SyncChangeProcessor. |
| +// The sync subsystem will respond soon after invoking Run() on your flare |
| +// by calling MergeDataAndStartSyncing. The ModelType parameter is included so |
| +// that the recieving end can track usage and timing statistics, make |
| +// optimizations or tradeoffs by type, etc. |
| +typedef base::Callback<void(ModelType)> StartSyncFlare; |
| + |
| // TODO(zea): remove SupportsWeakPtr in favor of having all SyncableService |
| // implementers provide a way of getting a weak pointer to themselves. |
| // See crbug.com/100114. |
| @@ -28,6 +39,10 @@ class SYNC_EXPORT SyncableService |
| : public SyncChangeProcessor, |
| public base::SupportsWeakPtr<SyncableService> { |
| public: |
| + // Provides a StartSyncFlare to the SyncableService. |
| + // TODO(tim): BUG 80194. Make pure virtual. |
| + virtual void InjectStartSyncFlare(const StartSyncFlare& flare); |
|
Nicolas Zea
2013/05/01 22:37:04
Is this really necessary? Why can't a datatype jus
tim (not reviewing)
2013/05/01 23:20:44
Is there an elegant way to get a hold of a profile
Nicolas Zea
2013/05/02 18:01:07
I'm fine with passing the more specific thing, i.e
|
| + |
| // Informs the service to begin syncing the specified synced datatype |type|. |
| // The service should then merge |initial_sync_data| into it's local data, |
| // calling |sync_processor|'s ProcessSyncChanges as necessary to reconcile the |