| 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 "chrome/browser/sync/internal_api/change_reorder_buffer.h" | 5 #include "chrome/browser/sync/internal_api/change_reorder_buffer.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> // for pair<> | 10 #include <utility> // for pair<> |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 if (specifics_.find(record.id) != specifics_.end()) | 144 if (specifics_.find(record.id) != specifics_.end()) |
| 145 record.specifics = specifics_[record.id]; | 145 record.specifics = specifics_[record.id]; |
| 146 if (extra_data_.find(record.id) != extra_data_.end()) | 146 if (extra_data_.find(record.id) != extra_data_.end()) |
| 147 record.extra = extra_data_[record.id]; | 147 record.extra = extra_data_[record.id]; |
| 148 changelist.push_back(record); | 148 changelist.push_back(record); |
| 149 } else { | 149 } else { |
| 150 traversal.ExpandToInclude(trans, i->first); | 150 traversal.ExpandToInclude(trans, i->first); |
| 151 if (i->second == OP_ADD || | 151 if (i->second == OP_ADD || |
| 152 i->second == OP_UPDATE_POSITION_AND_PROPERTIES) { | 152 i->second == OP_UPDATE_POSITION_AND_PROPERTIES) { |
| 153 ReadNode node(sync_trans); | 153 ReadNode node(sync_trans); |
| 154 CHECK(node.InitByIdLookup(i->first)); | 154 CHECK_EQ(BaseNode::INIT_OK, node.InitByIdLookup(i->first)); |
| 155 | 155 |
| 156 // We only care about parents of entry's with position-sensitive models. | 156 // We only care about parents of entry's with position-sensitive models. |
| 157 if (syncable::ShouldMaintainPosition( | 157 if (syncable::ShouldMaintainPosition( |
| 158 node.GetEntry()->GetModelType())) { | 158 node.GetEntry()->GetModelType())) { |
| 159 parents_of_position_changes.insert(node.GetParentId()); | 159 parents_of_position_changes.insert(node.GetParentId()); |
| 160 } | 160 } |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 id = child.Get(syncable::NEXT_ID); | 220 id = child.Get(syncable::NEXT_ID); |
| 221 } | 221 } |
| 222 } | 222 } |
| 223 } | 223 } |
| 224 | 224 |
| 225 *changes = ImmutableChangeRecordList(&changelist); | 225 *changes = ImmutableChangeRecordList(&changelist); |
| 226 return true; | 226 return true; |
| 227 } | 227 } |
| 228 | 228 |
| 229 } // namespace sync_api | 229 } // namespace sync_api |
| OLD | NEW |