OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/syncable/directory.h" | 5 #include "sync/syncable/directory.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1317 } else { | 1317 } else { |
1318 // Should be an uncomitted item, or a successfully deleted one. | 1318 // Should be an uncomitted item, or a successfully deleted one. |
1319 if (!e.GetIsDel()) { | 1319 if (!e.GetIsDel()) { |
1320 if (!SyncAssert(e.GetIsUnsynced(), FROM_HERE, | 1320 if (!SyncAssert(e.GetIsUnsynced(), FROM_HERE, |
1321 "The item should be unsynced.", trans)) | 1321 "The item should be unsynced.", trans)) |
1322 return false; | 1322 return false; |
1323 } | 1323 } |
1324 } | 1324 } |
1325 // If the next check failed, it would imply that an item exists | 1325 // If the next check failed, it would imply that an item exists |
1326 // on the server, isn't waiting for application locally, but either | 1326 // on the server, isn't waiting for application locally, but either |
1327 // is an unsynced create or a sucessful delete in the local copy. | 1327 // is an unsynced create or a successful delete in the local copy. |
1328 // Either way, that's a mismatch. | 1328 // Either way, that's a mismatch. |
1329 if (!SyncAssert(0 == server_version, FROM_HERE, | 1329 if (!SyncAssert(0 == server_version, FROM_HERE, |
1330 "Server version should be zero.", | 1330 "Server version should be zero.", |
1331 trans)) | 1331 trans)) |
1332 return false; | 1332 return false; |
1333 // Items that aren't using the unique client tag should have a zero | 1333 // Items that aren't using the unique client tag should have a zero |
1334 // base version only if they have a local ID. Items with unique client | 1334 // base version only if they have a local ID. Items with unique client |
1335 // tags are allowed to use the zero base version for undeletion and | 1335 // tags are allowed to use the zero base version for undeletion and |
1336 // de-duplication; the unique client tag trumps the server ID. | 1336 // de-duplication; the unique client tag trumps the server ID. |
1337 if (!using_unique_client_tag) { | 1337 if (!using_unique_client_tag) { |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 Directory::Kernel* Directory::kernel() { | 1593 Directory::Kernel* Directory::kernel() { |
1594 return kernel_; | 1594 return kernel_; |
1595 } | 1595 } |
1596 | 1596 |
1597 const Directory::Kernel* Directory::kernel() const { | 1597 const Directory::Kernel* Directory::kernel() const { |
1598 return kernel_; | 1598 return kernel_; |
1599 } | 1599 } |
1600 | 1600 |
1601 } // namespace syncable | 1601 } // namespace syncable |
1602 } // namespace syncer | 1602 } // namespace syncer |
OLD | NEW |