| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/engine/update_applicator.h" | 5 #include "chrome/browser/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 "chrome/browser/sync/engine/syncer_util.h" | 10 #include "chrome/browser/sync/engine/syncer_util.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 successful_ids_.push_back(entry.Get(syncable::ID)); | 54 successful_ids_.push_back(entry.Get(syncable::ID)); |
| 55 break; | 55 break; |
| 56 case CONFLICT: | 56 case CONFLICT: |
| 57 pointer_++; | 57 pointer_++; |
| 58 conflicting_ids_.push_back(entry.Get(syncable::ID)); | 58 conflicting_ids_.push_back(entry.Get(syncable::ID)); |
| 59 break; | 59 break; |
| 60 case BLOCKED: | 60 case BLOCKED: |
| 61 pointer_++; | 61 pointer_++; |
| 62 blocked_ids_.push_back(entry.Get(syncable::ID)); | 62 blocked_ids_.push_back(entry.Get(syncable::ID)); |
| 63 break; | 63 break; |
| 64 default: |
| 65 NOTREACHED(); |
| 66 break; |
| 64 } | 67 } |
| 65 LOG(INFO) << "Apply Status for " << entry.Get(syncable::META_HANDLE) | 68 LOG(INFO) << "Apply Status for " << entry.Get(syncable::META_HANDLE) |
| 66 << " is " << updateResponse; | 69 << " is " << updateResponse; |
| 67 | 70 |
| 68 return true; | 71 return true; |
| 69 } | 72 } |
| 70 | 73 |
| 71 bool UpdateApplicator::AllUpdatesApplied() const { | 74 bool UpdateApplicator::AllUpdatesApplied() const { |
| 72 return conflicting_ids_.empty() && blocked_ids_.empty() && | 75 return conflicting_ids_.empty() && blocked_ids_.empty() && |
| 73 begin_ == end_; | 76 begin_ == end_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 89 session_->AddAppliedUpdate(BLOCKED, *i); | 92 session_->AddAppliedUpdate(BLOCKED, *i); |
| 90 } | 93 } |
| 91 for (i = successful_ids_.begin(); i != successful_ids_.end(); ++i) { | 94 for (i = successful_ids_.begin(); i != successful_ids_.end(); ++i) { |
| 92 session_->EraseCommitConflict(*i); | 95 session_->EraseCommitConflict(*i); |
| 93 session_->EraseBlockedItem(*i); | 96 session_->EraseBlockedItem(*i); |
| 94 session_->AddAppliedUpdate(SUCCESS, *i); | 97 session_->AddAppliedUpdate(SUCCESS, *i); |
| 95 } | 98 } |
| 96 } | 99 } |
| 97 | 100 |
| 98 } // namespace browser_sync | 101 } // namespace browser_sync |
| OLD | NEW |