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

Unified Diff: sync/api/sync_change_processor.h

Issue 187303006: Update sync API to support attachments. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@attachmentapi
Patch Set: Remove AttachmentServiceBase for reals. Created 6 years, 9 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
Index: sync/api/sync_change_processor.h
diff --git a/sync/api/sync_change_processor.h b/sync/api/sync_change_processor.h
index 69494f0849ca42f6b8e9dd9760aa39073de06594..3cdf6a8c2b701e45aac2ea7cb674c963a54cfd00 100644
--- a/sync/api/sync_change_processor.h
+++ b/sync/api/sync_change_processor.h
@@ -25,6 +25,8 @@ typedef std::vector<SyncChange> SyncChangeList;
// An interface for services that handle receiving SyncChanges.
class SYNC_EXPORT SyncChangeProcessor {
public:
+ typedef base::Callback<void(const SyncData&)> GetSyncDataCallback;
+
SyncChangeProcessor();
virtual ~SyncChangeProcessor();
@@ -46,6 +48,21 @@ class SYNC_EXPORT SyncChangeProcessor {
// WARNING: This can be a potentially slow & memory intensive operation and
// should only be used when absolutely necessary / sparingly.
virtual SyncDataList GetAllSyncData(ModelType type) const = 0;
+
+ // Retrieves the SyncData identified by |type| and |sync_tag| and invokes
+ // |callback| asynchronously. If no such SyncData exists locally, IsValid on
+ // the SyncData passed to |callback| will return false.
+ //
+ // This is an asynchronous local operation that may result in disk IO.
+ //
+ // Refer to sync_data.h for a description of |sync_tag|.
+ //
+ // TODO:(maniscalco): N.B. this method should really be pure virtual. An
+ // implentation is provided here just to verify that everything compiles.
+ // Update this method to be pure virtual (bug 353300).
+ virtual void GetSyncData(const ModelType& type,
+ const std::string& sync_tag,
+ const GetSyncDataCallback& callback) const {}
};
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698