Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: sync/syncable/directory.cc

Issue 1258863007: [Sync] Add more info for invalid position check (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move enum back to entry_kernel Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | sync/syncable/entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | sync/syncable/entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698