| 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 1451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1462 return; | 1462 return; |
| 1463 } | 1463 } |
| 1464 | 1464 |
| 1465 EntryKernel* successor = *neighbour; | 1465 EntryKernel* successor = *neighbour; |
| 1466 | 1466 |
| 1467 // Another mixed valid and invalid position case. This one could be supported | 1467 // Another mixed valid and invalid position case. This one could be supported |
| 1468 // in theory, but we're trying to deprecate support for siblings with and | 1468 // in theory, but we're trying to deprecate support for siblings with and |
| 1469 // without valid positions. See TODO above. | 1469 // without valid positions. See TODO above. |
| 1470 // Using a release CHECK here because the following UniquePosition::Between | 1470 // Using a release CHECK here because the following UniquePosition::Between |
| 1471 // call crashes anyway when the position string is empty (see crbug/332371). | 1471 // call crashes anyway when the position string is empty (see crbug/332371). |
| 1472 CHECK(successor->ref(UNIQUE_POSITION).IsValid()); | 1472 CHECK(successor->ref(UNIQUE_POSITION).IsValid()) << *successor; |
| 1473 | 1473 |
| 1474 // Finally, the normal case: inserting between two elements. | 1474 // Finally, the normal case: inserting between two elements. |
| 1475 UniquePosition pos = UniquePosition::Between( | 1475 UniquePosition pos = UniquePosition::Between( |
| 1476 predecessor->ref(UNIQUE_POSITION), | 1476 predecessor->ref(UNIQUE_POSITION), |
| 1477 successor->ref(UNIQUE_POSITION), | 1477 successor->ref(UNIQUE_POSITION), |
| 1478 suffix); | 1478 suffix); |
| 1479 e->put(UNIQUE_POSITION, pos); | 1479 e->put(UNIQUE_POSITION, pos); |
| 1480 return; | 1480 return; |
| 1481 } | 1481 } |
| 1482 | 1482 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1562 Directory::Kernel* Directory::kernel() { | 1562 Directory::Kernel* Directory::kernel() { |
| 1563 return kernel_; | 1563 return kernel_; |
| 1564 } | 1564 } |
| 1565 | 1565 |
| 1566 const Directory::Kernel* Directory::kernel() const { | 1566 const Directory::Kernel* Directory::kernel() const { |
| 1567 return kernel_; | 1567 return kernel_; |
| 1568 } | 1568 } |
| 1569 | 1569 |
| 1570 } // namespace syncable | 1570 } // namespace syncable |
| 1571 } // namespace syncer | 1571 } // namespace syncer |
| OLD | NEW |