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

Issue 2732333003: [Sync] ModelTypeStore factory shouldn't require valid PSS to function correctly (Closed)

Created:
3 years, 9 months ago by pavely
Modified:
3 years, 9 months ago
Reviewers:
skym, skau, Olivier
CC:
chromium-reviews, ios-reviews+chrome_chromium.org, ios-reviews_chromium.org, pkl (ping after 24h if needed), noyau+watch_chromium.org, davemoore+watch_chromium.org, oshima+watch_chromium.org, marq+watch_chromium.org, stkhapugin, sync-reviews_chromium.org, sdefresne+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] ModelTypeStore factory shouldn't require valid PSS to function correctly The issue is that PSS::GetModelTypeStoreFactory requires valid PSS which doesn't have to be available when sync is disabled (for example in guest mode on ChromeOS). The reason it is currently wired through PSS is that PSS conveniently has path and blocking task runner required for ModelTypeStore. I added static GetModelTypeStoreFactory function that takes profile path and SequencedWorkerPool. It ensures that, for a given path, all task runners use the same sequence token and thus properly sequneced. Datatypes that wish to be hosted in shared leveldb database should use this factory function. I also fixed issue that backend_map_ is accessed from multiple threads and thus might get corrupt. I wrapped it into a class with lock. BUG=688533 R=skym@chromium.org Review-Url: https://codereview.chromium.org/2732333003 Cr-Commit-Position: refs/heads/master@{#455749} Committed: https://chromium.googlesource.com/chromium/src/+/222de9fb1677cdabfbf8998c17dd0e394f71a81e

Patch Set 1 #

Patch Set 2 : Fix ios build. Add comments. #

Patch Set 3 : Don't DCHECK in EraseBackend, backend initialization could have failed. #

Patch Set 4 : Rebase #

Total comments: 5

Patch Set 5 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -104 lines) Patch
M chrome/browser/chromeos/printing/printers_manager_factory.cc View 1 2 3 2 chunks +4 lines, -10 lines 0 comments Download
M chrome/browser/sync/chrome_sync_client.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/chrome_sync_client.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_factory.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/browser/sync/profile_sync_test_util.cc View 1 chunk +0 lines, -6 lines 0 comments Download
M components/browser_sync/profile_sync_service.h View 1 2 3 4 5 chunks +8 lines, -8 lines 0 comments Download
M components/browser_sync/profile_sync_service.cc View 8 chunks +22 lines, -14 lines 0 comments Download
M components/browser_sync/profile_sync_test_util.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M components/sync/driver/fake_sync_client.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/driver/fake_sync_client.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/sync/driver/sync_client.h View 2 chunks +8 lines, -0 lines 0 comments Download
M components/sync/driver/sync_service_base.h View 2 chunks +10 lines, -5 lines 0 comments Download
M components/sync/driver/sync_service_base.cc View 3 chunks +16 lines, -2 lines 0 comments Download
M components/sync/model/model_type_store.h View 1 chunk +1 line, -1 line 0 comments Download
M components/sync/model_impl/model_type_store_backend.h View 1 2 3 4 chunks +8 lines, -12 lines 0 comments Download
M components/sync/model_impl/model_type_store_backend.cc View 1 2 3 4 9 chunks +64 lines, -14 lines 0 comments Download
M components/sync/model_impl/model_type_store_backend_unittest.cc View 1 chunk +2 lines, -6 lines 0 comments Download
M ios/chrome/browser/reading_list/reading_list_model_factory.cc View 1 2 chunks +5 lines, -5 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_profile_sync_test_util.cc View 1 2 chunks +0 lines, -6 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_sync_client.h View 1 chunk +1 line, -0 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_sync_client.mm View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 42 (34 generated)
pavely
3 years, 9 months ago (2017-03-08 00:13:04 UTC) #7
skym
lgtm https://codereview.chromium.org/2732333003/diff/60001/components/browser_sync/profile_sync_service.cc File components/browser_sync/profile_sync_service.cc (right): https://codereview.chromium.org/2732333003/diff/60001/components/browser_sync/profile_sync_service.cc#newcode1681 components/browser_sync/profile_sync_service.cc:1681: blocking_pool->GetNamedSequenceToken(path); Cool! https://codereview.chromium.org/2732333003/diff/60001/components/browser_sync/profile_sync_service.h File components/browser_sync/profile_sync_service.h (right): https://codereview.chromium.org/2732333003/diff/60001/components/browser_sync/profile_sync_service.h#newcode554 components/browser_sync/profile_sync_service.h:554: ...
3 years, 9 months ago (2017-03-08 19:28:15 UTC) #24
pavely
Adding reviewers for files outside of sync. Guys, PTAL: Olivier: ios/chrome/browser/reading_list/reading_list_model_factory.cc Sean: chrome/browser/chromeos/printing/printers_manager_factory.cc
3 years, 9 months ago (2017-03-08 20:27:56 UTC) #29
pavely
https://codereview.chromium.org/2732333003/diff/60001/components/browser_sync/profile_sync_service.h File components/browser_sync/profile_sync_service.h (right): https://codereview.chromium.org/2732333003/diff/60001/components/browser_sync/profile_sync_service.h#newcode554 components/browser_sync/profile_sync_service.h:554: // the sync LevelDB backend. |base_path| should be set ...
3 years, 9 months ago (2017-03-08 20:41:12 UTC) #32
skau
lgtm chrome/browser/chromeos/printing/* Thanks for the fix!
3 years, 9 months ago (2017-03-08 21:10:24 UTC) #33
Olivier
ios LGTM
3 years, 9 months ago (2017-03-09 08:23:36 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2732333003/80001
3 years, 9 months ago (2017-03-09 15:19:06 UTC) #39
commit-bot: I haz the power
3 years, 9 months ago (2017-03-09 15:24:47 UTC) #42
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/222de9fb1677cdabfbf8998c17dd...

Powered by Google App Engine
This is Rietveld 408576698