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

Unified Diff: sync/syncable/write_transaction.h

Issue 11341048: Populate versions on individual nodes in sync model and native bookmark model. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lock dir Created 8 years, 1 month 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/syncable/write_transaction.h
diff --git a/sync/syncable/write_transaction.h b/sync/syncable/write_transaction.h
index 17264c4c65e3c883439ca84f202c7d1e5b0af24a..aa90377cfe75aa20705efc4e985c95ce00580a18 100644
--- a/sync/syncable/write_transaction.h
+++ b/sync/syncable/write_transaction.h
@@ -17,6 +17,13 @@ class WriteTransaction : public BaseTransaction {
WriteTransaction(const tracked_objects::Location& from_here,
WriterTag writer, Directory* directory);
+ // Constructor used for getting back model version after making sync
+ // API changes to one model. After the transaction is destroyed,
Nicolas Zea 2012/11/02 21:02:25 nit: "After the transaction is destroyed" -> "Duri
haitaol1 2012/11/02 22:58:18 Done.
+ // |new_model_version| stores the new model version if model is changed,
+ // or -1 if model is not changed.
+ WriteTransaction(const tracked_objects::Location& from_here,
+ Directory* directory, int64* new_model_version);
+
virtual ~WriteTransaction();
void SaveOriginal(const EntryKernel* entry);
@@ -36,10 +43,16 @@ class WriteTransaction : public BaseTransaction {
ModelTypeSet NotifyTransactionChangingAndEnding(
const ImmutableEntryKernelMutationMap& mutations);
+ // Increment versions of the models whose entries are modified and set the
+ // version on the changed entries.
+ void UpdateTransactionVersion(const std::vector<int64>& entry_changed);
+
// Only the original fields are filled in until |RecordMutations()|.
// We use a mutation map instead of a kernel set to avoid copying.
EntryKernelMutationMap mutations_;
+ int64* new_model_version_;
Nicolas Zea 2012/11/02 21:02:25 Comment that you don't have ownership of this.
haitaol1 2012/11/02 22:58:18 Done.
+
DISALLOW_COPY_AND_ASSIGN(WriteTransaction);
};

Powered by Google App Engine
This is Rietveld 408576698