OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sync/engine/model_type_entity.h" | 5 #include "sync/engine/model_type_entity.h" |
6 #include "sync/syncable/syncable_util.h" | 6 #include "sync/syncable/syncable_util.h" |
7 | 7 |
8 namespace syncer { | 8 namespace syncer { |
9 | 9 |
10 scoped_ptr<ModelTypeEntity> ModelTypeEntity::NewLocalItem( | 10 scoped_ptr<ModelTypeEntity> ModelTypeEntity::NewLocalItem( |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 void ModelTypeEntity::MakeLocalChange( | 124 void ModelTypeEntity::MakeLocalChange( |
125 const sync_pb::EntitySpecifics& specifics) { | 125 const sync_pb::EntitySpecifics& specifics) { |
126 sequence_number_++; | 126 sequence_number_++; |
127 specifics_ = specifics; | 127 specifics_ = specifics; |
128 } | 128 } |
129 | 129 |
130 void ModelTypeEntity::UpdateDesiredEncryptionKey(const std::string& name) { | 130 void ModelTypeEntity::UpdateDesiredEncryptionKey(const std::string& name) { |
131 if (encryption_key_name_ == name) | 131 if (encryption_key_name_ == name) |
132 return; | 132 return; |
133 | 133 |
| 134 DVLOG(2) << id_ << ": Encryption triggered commit: " << encryption_key_name_ |
| 135 << " -> " << name; |
| 136 |
134 // Schedule commit with the expectation that the worker will re-encrypt with | 137 // Schedule commit with the expectation that the worker will re-encrypt with |
135 // the latest encryption key as it does. | 138 // the latest encryption key as it does. |
136 sequence_number_++; | 139 sequence_number_++; |
137 } | 140 } |
138 | 141 |
139 void ModelTypeEntity::Delete() { | 142 void ModelTypeEntity::Delete() { |
140 sequence_number_++; | 143 sequence_number_++; |
141 specifics_.Clear(); | 144 specifics_.Clear(); |
142 deleted_ = true; | 145 deleted_ = true; |
143 } | 146 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 void ModelTypeEntity::ClearSyncState() { | 182 void ModelTypeEntity::ClearSyncState() { |
180 base_version_ = kUncommittedVersion; | 183 base_version_ = kUncommittedVersion; |
181 is_dirty_ = true; | 184 is_dirty_ = true; |
182 sequence_number_ = 1; | 185 sequence_number_ = 1; |
183 commit_requested_sequence_number_ = 0; | 186 commit_requested_sequence_number_ = 0; |
184 acked_sequence_number_ = 0; | 187 acked_sequence_number_ = 0; |
185 id_.clear(); | 188 id_.clear(); |
186 } | 189 } |
187 | 190 |
188 } // namespace syncer | 191 } // namespace syncer |
OLD | NEW |