sync: Add remote modification time to SyncData.
This is required for building session sync on top of Sync API.
[email protected]
^ themes OWNERS
^ history OWNERS
^ managed_mode OWNERS
BUG=98892, 80194
Review URL: https://codereview.chromium.org/18873006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211722 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/sync/api/sync_data.h b/sync/api/sync_data.h
index 33e41a8a..43f64f91 100644
--- a/sync/api/sync_data.h
+++ b/sync/api/sync_data.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/time/time.h"
#include "sync/base/sync_export.h"
#include "sync/internal_api/public/base/model_type.h"
#include "sync/internal_api/public/util/immutable.h"
@@ -50,7 +51,9 @@
// Helper method for creating SyncData objects originating from the syncer.
static SyncData CreateRemoteData(
- int64 id, const sync_pb::EntitySpecifics& specifics);
+ int64 id,
+ const sync_pb::EntitySpecifics& specifics,
+ const base::Time& last_modified_time);
// Whether this SyncData holds valid data. The only way to have a SyncData
// without valid data is to use the default constructor.
@@ -71,6 +74,11 @@
// going TO the syncer, not from.
const std::string& GetTitle() const;
+ // Returns the last motification time according to the server. This is
+ // only valid if IsLocal() is false, and may be null if the SyncData
+ // represents a deleted item.
+ const base::Time& GetRemoteModifiedTime() const;
+
// Should only be called by sync code when IsLocal() is false.
int64 GetRemoteId() const;
@@ -102,7 +110,9 @@
ImmutableSyncEntity;
// Clears |entity|.
- SyncData(int64 id, sync_pb::SyncEntity* entity);
+ SyncData(int64 id,
+ sync_pb::SyncEntity* entity,
+ const base::Time& remote_modification_time);
// Whether this SyncData holds valid data.
bool is_valid_;
@@ -110,6 +120,10 @@
// Equal to kInvalidId iff this is local.
int64 id_;
+ // This is only valid if IsLocal() is false, and may be null if the
+ // SyncData represents a deleted item.
+ base::Time remote_modification_time_;
+
// The actual shared sync entity being held.
ImmutableSyncEntity immutable_entity_;
};