| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 SetEntitySpecifics(entity_specifics); | 182 SetEntitySpecifics(entity_specifics); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void WriteNode::SetSessionSpecifics( | 185 void WriteNode::SetSessionSpecifics( |
| 186 const sync_pb::SessionSpecifics& new_value) { | 186 const sync_pb::SessionSpecifics& new_value) { |
| 187 sync_pb::EntitySpecifics entity_specifics; | 187 sync_pb::EntitySpecifics entity_specifics; |
| 188 entity_specifics.mutable_session()->CopyFrom(new_value); | 188 entity_specifics.mutable_session()->CopyFrom(new_value); |
| 189 SetEntitySpecifics(entity_specifics); | 189 SetEntitySpecifics(entity_specifics); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void WriteNode::SetDeviceInfoSpecifics( |
| 193 const sync_pb::DeviceInfoSpecifics& new_value) { |
| 194 sync_pb::EntitySpecifics entity_specifics; |
| 195 entity_specifics.mutable_device_info()->CopyFrom(new_value); |
| 196 SetEntitySpecifics(entity_specifics); |
| 197 } |
| 198 |
| 192 void WriteNode::SetEntitySpecifics( | 199 void WriteNode::SetEntitySpecifics( |
| 193 const sync_pb::EntitySpecifics& new_value) { | 200 const sync_pb::EntitySpecifics& new_value) { |
| 194 ModelType new_specifics_type = | 201 ModelType new_specifics_type = |
| 195 GetModelTypeFromSpecifics(new_value); | 202 GetModelTypeFromSpecifics(new_value); |
| 196 DCHECK_NE(new_specifics_type, UNSPECIFIED); | 203 DCHECK_NE(new_specifics_type, UNSPECIFIED); |
| 197 DVLOG(1) << "Writing entity specifics of type " | 204 DVLOG(1) << "Writing entity specifics of type " |
| 198 << ModelTypeToString(new_specifics_type); | 205 << ModelTypeToString(new_specifics_type); |
| 199 // GetModelType() can be unspecified if this is the first time this | 206 // GetModelType() can be unspecified if this is the first time this |
| 200 // node is being initialized (see PutModelType()). Otherwise, it | 207 // node is being initialized (see PutModelType()). Otherwise, it |
| 201 // should match |new_specifics_type|. | 208 // should match |new_specifics_type|. |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 sync_pb::BookmarkSpecifics new_value = GetBookmarkSpecifics(); | 510 sync_pb::BookmarkSpecifics new_value = GetBookmarkSpecifics(); |
| 504 new_value.set_favicon(bytes.empty() ? NULL : &bytes[0], bytes.size()); | 511 new_value.set_favicon(bytes.empty() ? NULL : &bytes[0], bytes.size()); |
| 505 SetBookmarkSpecifics(new_value); | 512 SetBookmarkSpecifics(new_value); |
| 506 } | 513 } |
| 507 | 514 |
| 508 void WriteNode::MarkForSyncing() { | 515 void WriteNode::MarkForSyncing() { |
| 509 syncable::MarkForSyncing(entry_); | 516 syncable::MarkForSyncing(entry_); |
| 510 } | 517 } |
| 511 | 518 |
| 512 } // namespace syncer | 519 } // namespace syncer |
| OLD | NEW |