Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Unified Diff: sync/api/syncable_service.h

Issue 14018026: sync: SyncableService support for starting sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: isherman's review Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/api/syncable_service.h
diff --git a/sync/api/syncable_service.h b/sync/api/syncable_service.h
index 13c282ef5a601484bf7a05656a441a33f2e5bb0a..13225ca98463c6f9c728d2b5b77b3d44c35bd73e 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"
@@ -28,6 +29,15 @@ class SYNC_EXPORT SyncableService
: public SyncChangeProcessor,
public base::SupportsWeakPtr<SyncableService> {
public:
+ // A 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;
+
// 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
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698