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

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: Pull in upstream changes. 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..4a85d7a0d7ebc2fd70409208aa0915bee717283a 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,19 @@ 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|. If no such SyncData exists, IsValid on the SyncData passed to
tim (not reviewing) 2014/03/10 22:55:58 "... invokes |callback| asynchronously." Also, wh
maniscalco 2014/03/18 20:49:18 Done.
+ // |callback| will return false.
+ //
+ // This can be a potentially slow operation and may result in disk IO.
+ //
+ // TODO:(maniscalco): N.B. this method should really be pure virtual. An
+ // implentation is provide here just to verify that everything compiles.
tim (not reviewing) 2014/03/10 22:55:58 'implementation is provided'
maniscalco 2014/03/18 20:49:18 Done.
+ // Update this method to be pure virtual before committing.
+ virtual void GetSyncData(const ModelType& type,
tim (not reviewing) 2014/03/10 22:55:58 I want to call this GetSyncDataAsync, but Sync/Asy
maniscalco 2014/03/18 20:49:18 Yes, it's local only. I've updated the comment in
+ const std::string& sync_tag,
tim (not reviewing) 2014/03/10 22:55:58 Comment for sync_tag, refer to sync_data.h for det
maniscalco 2014/03/18 20:49:18 Done.
+ const GetSyncDataCallback& callback) const {}
};
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698