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

Unified Diff: sync/syncable/directory.cc

Issue 218623014: [Sync] Add context proto and directory support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update protos 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/syncable/directory.cc
diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc
index 97e7071e591da8a084cc5971f642bb8cdb23c5be..85b0a172b1fe9100af246927d45f83031914ca68 100644
--- a/sync/syncable/directory.cc
+++ b/sync/syncable/directory.cc
@@ -792,6 +792,19 @@ void Directory::IncrementTransactionVersion(ModelType type) {
kernel_->persisted_info.transaction_version[type]++;
}
+void Directory::GetDataTypeContext(ModelType type,
+ sync_pb::DataTypeContext* context) const {
+ kernel_->transaction_mutex.AssertAcquired();
maniscalco 2014/04/03 16:59:37 I noticed that in some methods we acquire a lock (
Nicolas Zea 2014/04/03 21:01:11 It has to do with whether it's expected that a tra
+ context->CopyFrom(kernel_->persisted_info.datatype_context[type]);
+}
+
+void Directory::SetDataTypeContext(
+ ModelType type,
+ const sync_pb::DataTypeContext& context) {
+ kernel_->transaction_mutex.AssertAcquired();
rlarocque 2014/04/03 17:36:55 What's up with this pattern? I thought the tradit
Nicolas Zea 2014/04/03 21:01:11 This is actually wrong, see above comment. I've up
+ kernel_->persisted_info.datatype_context[type].CopyFrom(context);
+}
+
ModelTypeSet Directory::InitialSyncEndedTypes() {
syncable::ReadTransaction trans(FROM_HERE, this);
ModelTypeSet protocol_types = ProtocolTypes();

Powered by Google App Engine
This is Rietveld 408576698