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

Issue 11569045: Initial UniquePositions implementation (Closed)

Created:
8 years ago by rlarocque
Modified:
7 years, 11 months ago
Reviewers:
akalin
CC:
chromium-reviews, Raghu Simha, haitaol1, tim (not reviewing)
Visibility:
Public.

Description

Initial UniquePositions implementation Introduces a new class that represents an item's position within an arbitrarily ordered list. It's currently biased towards bookmarks, but it could be made more generic if there was a need for it. This class supports inserting before, after, or between other UniquePosition items. It never runs out of position values, though it can use up unbounded space in the worst case. In addition to the basics mentioned above, it also has support for other functions that are particularly useful for bookmark sync. The positions are serializable and de-serializable, for storage and transimission. They also support conversion to and from int64 values, allowing them to operate with old-style positions. The class is not currently used anywhere. This commit includes only its implementation and some tests. BUG=145412 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=175462

Patch Set 1 #

Total comments: 12

Patch Set 2 : Address comments #

Total comments: 3

Patch Set 3 : More tests + cache_guid style suffixes #

Patch Set 4 : Update algorithm #

Total comments: 24

Patch Set 5 : Review fixes #

Patch Set 6 : Update class comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+953 lines, -3 lines) Patch
A sync/internal_api/public/base/unique_position.h View 1 2 3 4 5 1 chunk +115 lines, -0 lines 0 comments Download
A sync/internal_api/public/base/unique_position.cc View 1 2 3 4 1 chunk +312 lines, -0 lines 0 comments Download
A sync/internal_api/public/base/unique_position_unittest.cc View 1 2 3 4 1 chunk +520 lines, -0 lines 0 comments Download
M sync/sync.gyp View 1 2 3 4 2 chunks +6 lines, -3 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
rlarocque
Here's an attempt at implementing the UniquePosition class. At first I had tried to reuse ...
8 years ago (2012-12-15 01:00:35 UTC) #1
akalin
https://codereview.chromium.org/11569045/diff/1/sync/internal_api/public/base/unique_position.cc File sync/internal_api/public/base/unique_position.cc (right): https://codereview.chromium.org/11569045/diff/1/sync/internal_api/public/base/unique_position.cc#newcode270 sync/internal_api/public/base/unique_position.cc:270: mid.push_back((b_digit + a_digit) / 2U); can overflow? perhaps a_digit ...
8 years ago (2012-12-17 18:47:45 UTC) #2
rlarocque
Following our talk at lunch, I've been rethinking the suffix system. If we want to ...
8 years ago (2012-12-18 22:18:18 UTC) #3
akalin
initial comments, just looked at the main algorithms I'm still trying to think of a ...
8 years ago (2012-12-18 22:38:20 UTC) #4
rlarocque
Addressed comments. I was a bit concerned with some of your suggested digit calculation expressions, ...
8 years ago (2012-12-18 23:51:08 UTC) #5
akalin
On 2012/12/18 23:51:08, rlarocque wrote: > I was a bit concerned with some of your ...
8 years ago (2012-12-19 00:02:48 UTC) #6
akalin
On 2012/12/18 22:38:20, akalin wrote: > I'm still trying to think of a way to ...
8 years ago (2012-12-19 00:12:53 UTC) #7
rlarocque
On 2012/12/19 00:02:48, akalin wrote: > On 2012/12/18 23:51:08, rlarocque wrote: > > I was ...
8 years ago (2012-12-19 00:48:06 UTC) #8
rlarocque
> > As for the comment above, I was a bit confused. I think we're ...
8 years ago (2012-12-19 00:49:44 UTC) #9
akalin
Spent some time thinking about this https://codereview.chromium.org/11569045/diff/7001/sync/internal_api/public/base/unique_position.cc File sync/internal_api/public/base/unique_position.cc (right): https://codereview.chromium.org/11569045/diff/7001/sync/internal_api/public/base/unique_position.cc#newcode178 sync/internal_api/public/base/unique_position.cc:178: // Does our ...
8 years ago (2012-12-20 19:19:20 UTC) #10
rlarocque
TL;DR: Added tests and changed the suffixes to look more like unique_client_tags (base64 encoding of ...
8 years ago (2012-12-20 19:22:56 UTC) #11
rlarocque
https://codereview.chromium.org/11569045/diff/7001/sync/internal_api/public/base/unique_position.cc File sync/internal_api/public/base/unique_position.cc (right): https://codereview.chromium.org/11569045/diff/7001/sync/internal_api/public/base/unique_position.cc#newcode178 sync/internal_api/public/base/unique_position.cc:178: // Does our suffix alone place us where we ...
8 years ago (2012-12-20 20:09:50 UTC) #12
akalin
On 2012/12/20 20:09:50, rlarocque wrote: > Interesting. I'm still thinking about it, but my initial ...
8 years ago (2012-12-20 21:46:37 UTC) #13
akalin
Sorry I realize what you mean now. Yeah, the last zero should be replaced by ...
8 years ago (2012-12-20 21:56:56 UTC) #14
akalin
For completeness, the revised version: int i = ref.find_first_not_of('\0'); int j = suffixFF.find_first_not_of('\0'); if (j ...
8 years ago (2012-12-21 18:24:18 UTC) #15
rlarocque
On 2012/12/21 18:24:18, akalin wrote: > For completeness, the revised version: > > int i ...
8 years ago (2012-12-22 00:29:12 UTC) #16
akalin
lgtm i'm okay with landing this and iterating. otherwise, this review can take ages https://codereview.chromium.org/11569045/diff/20001/sync/internal_api/public/base/unique_position.cc ...
7 years, 11 months ago (2012-12-29 10:17:13 UTC) #17
rlarocque
Comments addressed and new patch uploaded. I'll try to land this as is. Thanks for ...
7 years, 11 months ago (2013-01-07 23:22:12 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/11569045/26002
7 years, 11 months ago (2013-01-07 23:33:29 UTC) #19
commit-bot: I haz the power
7 years, 11 months ago (2013-01-08 01:39:27 UTC) #20
Message was sent while issue was closed.
Change committed as 175462

Powered by Google App Engine
This is Rietveld 408576698