OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/build_and_process_conflict_sets_command.h" | 5 #include "chrome/browser/sync/engine/build_and_process_conflict_sets_command.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <sstream> | 9 #include <sstream> |
10 #include <vector> | 10 #include <vector> |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
109 backup->ref(syncable::META_HANDLE)); | 109 backup->ref(syncable::META_HANDLE)); |
110 CHECK(entry.good()); | 110 CHECK(entry.good()); |
111 | 111 |
112 if (!entry.Put(syncable::IS_DEL, backup->ref(syncable::IS_DEL))) | 112 if (!entry.Put(syncable::IS_DEL, backup->ref(syncable::IS_DEL))) |
113 return false; | 113 return false; |
114 | 114 |
115 entry.Put(syncable::NON_UNIQUE_NAME, backup->ref(syncable::NON_UNIQUE_NAME)); | 115 entry.Put(syncable::NON_UNIQUE_NAME, backup->ref(syncable::NON_UNIQUE_NAME)); |
116 entry.Put(syncable::PARENT_ID, backup->ref(syncable::PARENT_ID)); | 116 entry.Put(syncable::PARENT_ID, backup->ref(syncable::PARENT_ID)); |
117 | 117 |
118 if (!backup->ref(syncable::IS_DEL)) { | 118 if (!backup->ref(syncable::IS_DEL)) { |
119 CHECK(entry.PutPredecessor(backup->ref(syncable::PREV_ID))); | 119 if (!entry.PutPredecessor(backup->ref(syncable::PREV_ID))) { |
akalin
2011/10/15 01:19:44
add TODO to propagate error up, refer to a bug
| |
120 NOTREACHED(); | |
121 } | |
120 } | 122 } |
121 | 123 |
122 if (backup->ref(syncable::PREV_ID) != entry.Get(syncable::PREV_ID)) | 124 if (backup->ref(syncable::PREV_ID) != entry.Get(syncable::PREV_ID)) |
123 return false; | 125 return false; |
124 | 126 |
125 entry.Put(syncable::CTIME, backup->ref(syncable::CTIME)); | 127 entry.Put(syncable::CTIME, backup->ref(syncable::CTIME)); |
126 entry.Put(syncable::MTIME, backup->ref(syncable::MTIME)); | 128 entry.Put(syncable::MTIME, backup->ref(syncable::MTIME)); |
127 entry.Put(syncable::BASE_VERSION, backup->ref(syncable::BASE_VERSION)); | 129 entry.Put(syncable::BASE_VERSION, backup->ref(syncable::BASE_VERSION)); |
128 entry.Put(syncable::IS_DIR, backup->ref(syncable::IS_DIR)); | 130 entry.Put(syncable::IS_DIR, backup->ref(syncable::IS_DIR)); |
129 entry.Put(syncable::IS_DEL, backup->ref(syncable::IS_DEL)); | 131 entry.Put(syncable::IS_DEL, backup->ref(syncable::IS_DEL)); |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
399 LocallyDeletedPathChecker checker; | 401 LocallyDeletedPathChecker checker; |
400 if (!checker.CausingConflict(parent, *entry)) | 402 if (!checker.CausingConflict(parent, *entry)) |
401 return; | 403 return; |
402 conflict_progress->MergeSets(entry->Get(syncable::ID), | 404 conflict_progress->MergeSets(entry->Get(syncable::ID), |
403 parent.Get(syncable::ID)); | 405 parent.Get(syncable::ID)); |
404 CrawlDeletedTreeMergingSets(trans, parent, conflict_progress, checker); | 406 CrawlDeletedTreeMergingSets(trans, parent, conflict_progress, checker); |
405 } | 407 } |
406 } | 408 } |
407 | 409 |
408 } // namespace browser_sync | 410 } // namespace browser_sync |
OLD | NEW |