summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/read_transaction.cc
diff options
context:
space:
mode:
authorhaitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-26 05:06:45 +0000
committerhaitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-26 05:06:45 +0000
commit1858410f3beb10255da673b90f7dabbd97fbc708 (patch)
tree5be2f5b3a0a150adcaf14f9106f957cc0d78346f /sync/internal_api/read_transaction.cc
parent947e5d8f893f7ac7ca6f9be8c41e2d1c516cddc1 (diff)
downloadchromium_src-1858410f3beb10255da673b90f7dabbd97fbc708.zip
chromium_src-1858410f3beb10255da673b90f7dabbd97fbc708.tar.gz
chromium_src-1858410f3beb10255da673b90f7dabbd97fbc708.tar.bz2
Transaction version is used to detect out-of-sync between sync model and native model. The values in sync model and native model should be equal. If not, there're some changes that are applied in one but not the other. This change updates the transaction version of a model type in sync when changes to its native model are found. And implement native transaction version for bookmark model.
BUG=154858 Review URL: https://chromiumcodereview.appspot.com/11028146 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/read_transaction.cc')
-rw-r--r--sync/internal_api/read_transaction.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sync/internal_api/read_transaction.cc b/sync/internal_api/read_transaction.cc
index 32296f7..6de2f42 100644
--- a/sync/internal_api/read_transaction.cc
+++ b/sync/internal_api/read_transaction.cc
@@ -4,6 +4,7 @@
#include "sync/internal_api/public/read_transaction.h"
+#include "sync/syncable/directory.h"
#include "sync/syncable/read_transaction.h"
namespace syncer {
@@ -35,4 +36,8 @@ syncable::BaseTransaction* ReadTransaction::GetWrappedTrans() const {
return transaction_;
}
+int64 ReadTransaction::GetModelVersion(ModelType type) {
+ return transaction_->directory()->GetTransactionVersion(type);
+}
+
} // namespace syncer