| 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/engine/update_applicator.h" | 5 #include "sync/engine/update_applicator.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "sync/engine/syncer_util.h" | 10 #include "sync/engine/syncer_util.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 return true; | 95 return true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void UpdateApplicator::Advance() { | 98 void UpdateApplicator::Advance() { |
| 99 --end_; | 99 --end_; |
| 100 *pointer_ = *end_; | 100 *pointer_ = *end_; |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool UpdateApplicator::SkipUpdate(const syncable::Entry& entry) { | 103 bool UpdateApplicator::SkipUpdate(const syncable::Entry& entry) { |
| 104 syncer::ModelType type = entry.GetServerModelType(); | 104 ModelType type = entry.GetServerModelType(); |
| 105 ModelSafeGroup g = GetGroupForModelType(type, routing_info_); | 105 ModelSafeGroup g = GetGroupForModelType(type, routing_info_); |
| 106 // The set of updates passed to the UpdateApplicator should already | 106 // The set of updates passed to the UpdateApplicator should already |
| 107 // be group-filtered. | 107 // be group-filtered. |
| 108 if (g != group_filter_) { | 108 if (g != group_filter_) { |
| 109 NOTREACHED(); | 109 NOTREACHED(); |
| 110 return true; | 110 return true; |
| 111 } | 111 } |
| 112 if (g == GROUP_PASSIVE && | 112 if (g == GROUP_PASSIVE && |
| 113 !routing_info_.count(type) && | 113 !routing_info_.count(type) && |
| 114 type != syncer::UNSPECIFIED && | 114 type != UNSPECIFIED && |
| 115 type != syncer::TOP_LEVEL_FOLDER) { | 115 type != TOP_LEVEL_FOLDER) { |
| 116 DVLOG(1) << "Skipping update application, type not permitted."; | 116 DVLOG(1) << "Skipping update application, type not permitted."; |
| 117 return true; | 117 return true; |
| 118 } | 118 } |
| 119 return false; | 119 return false; |
| 120 } | 120 } |
| 121 | 121 |
| 122 bool UpdateApplicator::AllUpdatesApplied() const { | 122 bool UpdateApplicator::AllUpdatesApplied() const { |
| 123 return application_results_.no_conflicts() && begin_ == end_; | 123 return application_results_.no_conflicts() && begin_ == end_; |
| 124 } | 124 } |
| 125 | 125 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 conflicting_ids_.clear(); | 183 conflicting_ids_.clear(); |
| 184 encryption_conflict_ids_.clear(); | 184 encryption_conflict_ids_.clear(); |
| 185 hierarchy_conflict_ids_.clear(); | 185 hierarchy_conflict_ids_.clear(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 bool UpdateApplicator::ResultTracker::no_conflicts() const { | 188 bool UpdateApplicator::ResultTracker::no_conflicts() const { |
| 189 return conflicting_ids_.empty(); | 189 return conflicting_ids_.empty(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 } // namespace syncer | 192 } // namespace syncer |
| OLD | NEW |