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

Unified Diff: sync/internal_api/public/base/unique_position.h

Issue 11636006: WIP: The Bookmark Position Megapatch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Various updates, including switch suffix to unique_client_tag style Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sync/internal_api/change_reorder_buffer.cc ('k') | sync/internal_api/public/base/unique_position.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/public/base/unique_position.h
diff --git a/sync/internal_api/public/base/unique_position.h b/sync/internal_api/public/base/unique_position.h
index 959164f403cfa5af9cf4ac8db44696c4476de1f4..1d472936b49de75e3f27b783bb604e9c98b4f369 100644
--- a/sync/internal_api/public/base/unique_position.h
+++ b/sync/internal_api/public/base/unique_position.h
@@ -28,8 +28,7 @@ namespace syncer {
// though it could be adapted to be more generally useful.
class UniquePosition {
public:
- static const size_t kSuffixLength = (64 + 128) / 8;
- static const char kTerminatorByte = kuint8max;
+ static const size_t kSuffixLength;
static bool IsValidSuffix(const std::string& suffix);
static bool IsValidBytes(const std::string& bytes);
@@ -58,15 +57,6 @@ class UniquePosition {
const UniquePosition& after,
const std::string& suffix);
- // Create a random suffix. Should be used only as a last resort.
- static const std::string GenerateUniqueSuffix();
-
- // Create a unique suffix based on the input parameters. The parameters are
- // sufficient to uniquely identify any bookmark within the database.
- static const std::string GenerateBookmarkSuffix(
- const std::string& decoded_originator_cache_guid,
- int64 numeric_originator_item_id);
-
UniquePosition();
bool LessThan(const UniquePosition& other) const;
@@ -88,18 +78,17 @@ class UniquePosition {
private:
friend class UniquePositionTest;
- // Returns a string X such that (X ++ |suffix| ++ |kTerminatorByte|) < |str|.
+ // Returns a string X such that (X ++ |suffix|) < |str|.
// |str| must be a trailing substring of a valid ordinal.
// |suffix| must be a valid unique suffix.
static std::string FindSmallerWithSuffix(const std::string& str,
const std::string& suffix);
- // Returns a string X such that (X ++ |suffix| ++ |kTerminatorByte|) > |str|.
+ // Returns a string X such that (X ++ |suffix|) > |str|.
// |str| must be a trailing substring of a valid ordinal.
// |suffix| must be a valid unique suffix.
static std::string FindGreaterWithSuffix(const std::string& str,
const std::string& suffix);
- // Returns a string X such that
- // |before| < (X ++ |suffix| ++ |kTerminatorByte|) < |after|.
+ // Returns a string X such that |before| < (X ++ |suffix|) < |after|.
// |before| and after must be a trailing substrings of valid ordinals.
// |suffix| must be a valid unique suffix.
static std::string FindBetweenWithSuffix(const std::string& before,
« no previous file with comments | « sync/internal_api/change_reorder_buffer.cc ('k') | sync/internal_api/public/base/unique_position.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698