| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/internal_api/public/write_node.h" | 5 #include "sync/internal_api/public/write_node.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "sync/internal_api/public/base_transaction.h" | 9 #include "sync/internal_api/public/base_transaction.h" |
| 10 #include "sync/internal_api/public/write_transaction.h" | 10 #include "sync/internal_api/public/write_transaction.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 SetEntitySpecifics(entity_specifics); | 191 SetEntitySpecifics(entity_specifics); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void WriteNode::SetExperimentsSpecifics( | 194 void WriteNode::SetExperimentsSpecifics( |
| 195 const sync_pb::ExperimentsSpecifics& new_value) { | 195 const sync_pb::ExperimentsSpecifics& new_value) { |
| 196 sync_pb::EntitySpecifics entity_specifics; | 196 sync_pb::EntitySpecifics entity_specifics; |
| 197 entity_specifics.mutable_experiments()->CopyFrom(new_value); | 197 entity_specifics.mutable_experiments()->CopyFrom(new_value); |
| 198 SetEntitySpecifics(entity_specifics); | 198 SetEntitySpecifics(entity_specifics); |
| 199 } | 199 } |
| 200 | 200 |
| 201 void WriteNode::SetControlPreferenceSpecifics( |
| 202 const sync_pb::ControlPreferenceSpecifics& new_value) { |
| 203 sync_pb::EntitySpecifics entity_specifics; |
| 204 entity_specifics.mutable_control_preference()->CopyFrom(new_value); |
| 205 SetEntitySpecifics(entity_specifics); |
| 206 } |
| 207 |
| 201 void WriteNode::SetEntitySpecifics( | 208 void WriteNode::SetEntitySpecifics( |
| 202 const sync_pb::EntitySpecifics& new_value) { | 209 const sync_pb::EntitySpecifics& new_value) { |
| 203 ModelType new_specifics_type = | 210 ModelType new_specifics_type = |
| 204 GetModelTypeFromSpecifics(new_value); | 211 GetModelTypeFromSpecifics(new_value); |
| 205 DCHECK_NE(new_specifics_type, UNSPECIFIED); | 212 DCHECK_NE(new_specifics_type, UNSPECIFIED); |
| 206 DVLOG(1) << "Writing entity specifics of type " | 213 DVLOG(1) << "Writing entity specifics of type " |
| 207 << ModelTypeToString(new_specifics_type); | 214 << ModelTypeToString(new_specifics_type); |
| 208 // GetModelType() can be unspecified if this is the first time this | 215 // GetModelType() can be unspecified if this is the first time this |
| 209 // node is being initialized (see PutModelType()). Otherwise, it | 216 // node is being initialized (see PutModelType()). Otherwise, it |
| 210 // should match |new_specifics_type|. | 217 // should match |new_specifics_type|. |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 MarkForSyncing(); | 513 MarkForSyncing(); |
| 507 | 514 |
| 508 return true; | 515 return true; |
| 509 } | 516 } |
| 510 | 517 |
| 511 void WriteNode::MarkForSyncing() { | 518 void WriteNode::MarkForSyncing() { |
| 512 syncable::MarkForSyncing(entry_); | 519 syncable::MarkForSyncing(entry_); |
| 513 } | 520 } |
| 514 | 521 |
| 515 } // namespace syncer | 522 } // namespace syncer |
| OLD | NEW |