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

Issue 2018623002: [USS] Store supports hosting multiple datatypes per database (Closed)

Created:
4 years, 7 months ago by Gang Wu
Modified:
4 years, 6 months ago
Reviewers:
maxbogue, pavely
CC:
chromium-reviews, sync-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

This is 1 of 2 checks in for making ModelTypeStore supports multiple datatypes. This one will add ModelType's toor tag as a prefix for keys in leveldb. Next check in will make only one ModelTypeStore to be created if there are multiple datatypes. BUG=615214 Committed: https://crrev.com/95868e7bb69e4c5cfb90e7c6ea571c351b96f626 Cr-Commit-Position: refs/heads/master@{#398457}

Patch Set 1 #

Patch Set 2 : fix tests #

Patch Set 3 : move modeltype to ctor #

Total comments: 4

Patch Set 4 : #

Total comments: 11

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+52 lines, -17 lines) Patch
M components/browser_sync/browser/profile_sync_service.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M sync/api/model_type_store.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M sync/api/model_type_store.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M sync/internal_api/model_type_store_impl.cc View 1 2 3 9 chunks +24 lines, -12 lines 0 comments Download
M sync/internal_api/public/base/model_type.h View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M sync/internal_api/public/model_type_store_impl.h View 1 2 3 4 4 chunks +14 lines, -3 lines 0 comments Download
M sync/syncable/model_type.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (9 generated)
Gang Wu
PTAL
4 years, 7 months ago (2016-05-26 21:53:41 UTC) #5
maxbogue
Did you consider a solution that didn't involve adding the type as a parameter to ...
4 years, 6 months ago (2016-05-27 14:23:41 UTC) #6
Gang Wu
updated. move model type into ctor.
4 years, 6 months ago (2016-05-27 19:52:24 UTC) #7
maxbogue
Mostly lg, just a couple comments. https://codereview.chromium.org/2018623002/diff/40001/sync/internal_api/model_type_store_impl.cc File sync/internal_api/model_type_store_impl.cc (right): https://codereview.chromium.org/2018623002/diff/40001/sync/internal_api/model_type_store_impl.cc#newcode39 sync/internal_api/model_type_store_impl.cc:39: return std::string(syncer::kModelTypeInfoMap[type].root_tag) + ...
4 years, 6 months ago (2016-05-30 15:34:50 UTC) #8
Gang Wu
updated. https://codereview.chromium.org/2018623002/diff/40001/sync/internal_api/model_type_store_impl.cc File sync/internal_api/model_type_store_impl.cc (right): https://codereview.chromium.org/2018623002/diff/40001/sync/internal_api/model_type_store_impl.cc#newcode39 sync/internal_api/model_type_store_impl.cc:39: return std::string(syncer::kModelTypeInfoMap[type].root_tag) + kDataPrefix; On 2016/05/30 15:34:50, maxbogue ...
4 years, 6 months ago (2016-06-07 20:20:33 UTC) #9
maxbogue
lgtm with a couple nits https://codereview.chromium.org/2018623002/diff/60001/sync/internal_api/public/base/model_type.h File sync/internal_api/public/base/model_type.h (right): https://codereview.chromium.org/2018623002/diff/60001/sync/internal_api/public/base/model_type.h#newcode357 sync/internal_api/public/base/model_type.h:357: // Returns root_tag for ...
4 years, 6 months ago (2016-06-07 23:35:09 UTC) #10
pavely
https://codereview.chromium.org/2018623002/diff/60001/components/browser_sync/browser/profile_sync_service.cc File components/browser_sync/browser/profile_sync_service.cc (right): https://codereview.chromium.org/2018623002/diff/60001/components/browser_sync/browser/profile_sync_service.cc#newcode302 components/browser_sync/browser/profile_sync_service.cc:302: base::Bind(&ModelTypeStore::CreateStore, syncer::DEVICE_INFO, Optional comment: If PSS performed conversion from ...
4 years, 6 months ago (2016-06-08 01:18:07 UTC) #12
Gang Wu
update base on comments https://codereview.chromium.org/2018623002/diff/60001/sync/internal_api/public/base/model_type.h File sync/internal_api/public/base/model_type.h (right): https://codereview.chromium.org/2018623002/diff/60001/sync/internal_api/public/base/model_type.h#newcode357 sync/internal_api/public/base/model_type.h:357: // Returns root_tag for |model_type| ...
4 years, 6 months ago (2016-06-08 01:29:28 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2018623002/100001
4 years, 6 months ago (2016-06-08 01:30:19 UTC) #16
commit-bot: I haz the power
Committed patchset #5 (id:100001)
4 years, 6 months ago (2016-06-08 01:54:47 UTC) #18
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/95868e7bb69e4c5cfb90e7c6ea571c351b96f626 Cr-Commit-Position: refs/heads/master@{#398457}
4 years, 6 months ago (2016-06-08 01:57:12 UTC) #20
Gang Wu
4 years, 6 months ago (2016-06-20 21:39:21 UTC) #21
Message was sent while issue was closed.
https://codereview.chromium.org/2018623002/diff/60001/sync/internal_api/model...
File sync/internal_api/model_type_store_impl.cc (right):

https://codereview.chromium.org/2018623002/diff/60001/sync/internal_api/model...
sync/internal_api/model_type_store_impl.cc:39: return
std::string(syncer::ModelTypeToTag(type)) + kDataPrefix;
On 2016/06/08 01:18:07, pavely wrote:
> syncer::ModelTypeToTag(type) already returns string, no need to contruct new
one
> out of it.
ModelTypeToTag(type) return const char*

https://codereview.chromium.org/2018623002/diff/60001/sync/internal_api/publi...
File sync/internal_api/public/base/model_type.h (right):

https://codereview.chromium.org/2018623002/diff/60001/sync/internal_api/publi...
sync/internal_api/public/base/model_type.h:357: // Returns root_tag for
|model_type| in ModelTypeInfo.
On 2016/06/08 01:18:07, pavely wrote:
> On 2016/06/07 23:35:09, maxbogue wrote:
> > Explain the difference between this and *ToRootTag, since that already
exists.
> 
> Could you place this function right next to ModelTypeToRootTag.
> You can make it distinct by naming it for how it is used (e.g.
> ModelTypeToStorePrefix) rather than what it returns (ModelTypeToRootTag).

Done.

https://codereview.chromium.org/2018623002/diff/60001/sync/internal_api/publi...
File sync/internal_api/public/model_type_store_impl.h (right):

https://codereview.chromium.org/2018623002/diff/60001/sync/internal_api/publi...
sync/internal_api/public/model_type_store_impl.h:111: const std::string
dataPrefix_;
On 2016/06/08 01:18:07, pavely wrote:
> On 2016/06/07 23:35:09, maxbogue wrote:
> > Comment above these?
> 
> Also follow naming conventions: data_prefix_

Done.

Powered by Google App Engine
This is Rietveld 408576698