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

Issue 2489433002: [Sync] Move thread checking into the ModelSafeWorker interface. (Closed)

Created:
4 years, 1 month ago by maxbogue
Modified:
4 years, 1 month ago
CC:
chromium-reviews, gcasto+watchlist_chromium.org, vabr+watchlistpasswordmanager_chromium.org, sync-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] Move thread checking into the ModelSafeWorker interface. Previously, several task runners (UI, DB, FILE) were piped through several layers of sync code simply to CHECK that the correct thread was being used. This CL adds ModelSafeWorker::IsOnModelThread() instead. Note that HISTORY and PASSWORDS still don't have an easy way to perform this check, but the situation is no worse than before and sets the stage for future improvement if necessary. BUG=663125 Committed: https://crrev.com/509cc91f68ef68aebfc761bf6bd282c113a1632e Cr-Commit-Position: refs/heads/master@{#430684}

Patch Set 1 #

Patch Set 2 : Rebase. #

Patch Set 3 : Fix iOS hopefully. #

Total comments: 7

Patch Set 4 : Improve/add comments. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -124 lines) Patch
M chrome/browser/sync/profile_sync_service_factory.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/sync/profile_sync_test_util.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M components/browser_sync/profile_sync_service.h View 2 chunks +0 lines, -4 lines 0 comments Download
M components/browser_sync/profile_sync_service.cc View 3 chunks +3 lines, -7 lines 0 comments Download
M components/browser_sync/profile_sync_service_unittest.cc View 3 chunks +5 lines, -10 lines 0 comments Download
M components/browser_sync/profile_sync_test_util.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M components/history/core/browser/history_model_worker.h View 1 chunk +2 lines, -1 line 0 comments Download
M components/history/core/browser/history_model_worker.cc View 1 2 3 1 chunk +7 lines, -0 lines 1 comment Download
M components/password_manager/sync/browser/password_model_worker.h View 1 chunk +2 lines, -1 line 0 comments Download
M components/password_manager/sync/browser/password_model_worker.cc View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M components/sync/driver/glue/browser_thread_model_worker.h View 1 chunk +2 lines, -1 line 0 comments Download
M components/sync/driver/glue/browser_thread_model_worker.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host.h View 1 chunk +0 lines, -2 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl.h View 1 chunk +0 lines, -2 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl.cc View 2 chunks +1 line, -4 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl_unittest.cc View 1 chunk +1 line, -2 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_mock.h View 1 chunk +0 lines, -2 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_mock.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M components/sync/driver/glue/sync_backend_registrar.h View 5 chunks +5 lines, -16 lines 0 comments Download
M components/sync/driver/glue/sync_backend_registrar.cc View 7 chunks +16 lines, -46 lines 0 comments Download
M components/sync/driver/glue/sync_backend_registrar_unittest.cc View 2 chunks +3 lines, -3 lines 0 comments Download
M components/sync/driver/glue/ui_model_worker.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/driver/glue/ui_model_worker.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/sync/engine/model_safe_worker.h View 1 chunk +3 lines, -0 lines 0 comments Download
M components/sync/engine/passive_model_worker.h View 1 chunk +2 lines, -1 line 0 comments Download
M components/sync/engine/passive_model_worker.cc View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M components/sync/test/engine/fake_model_worker.h View 3 chunks +4 lines, -2 lines 0 comments Download
M components/sync/test/engine/fake_model_worker.cc View 1 chunk +7 lines, -3 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.cc View 1 2 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 25 (15 generated)
maxbogue
PTAL! zea@ for sync, sky@ for history, vabr@ for passwords.
4 years, 1 month ago (2016-11-08 03:06:19 UTC) #10
vabr (Chromium)
Passwords component LGTM with the comment below addressed. Thanks! Vaclav https://codereview.chromium.org/2489433002/diff/40001/components/password_manager/sync/browser/password_model_worker.cc File components/password_manager/sync/browser/password_model_worker.cc (right): https://codereview.chromium.org/2489433002/diff/40001/components/password_manager/sync/browser/password_model_worker.cc#newcode66 ...
4 years, 1 month ago (2016-11-08 08:32:45 UTC) #11
sky
LGTM https://codereview.chromium.org/2489433002/diff/40001/components/history/core/browser/history_model_worker.cc File components/history/core/browser/history_model_worker.cc (right): https://codereview.chromium.org/2489433002/diff/40001/components/history/core/browser/history_model_worker.cc#newcode128 components/history/core/browser/history_model_worker.cc:128: // Can't do better without modifying HistoryService. As ...
4 years, 1 month ago (2016-11-08 18:17:00 UTC) #12
Nicolas Zea
Good change. LGTM with a nit (and sky/vabr's comments) https://codereview.chromium.org/2489433002/diff/40001/components/sync/engine/passive_model_worker.cc File components/sync/engine/passive_model_worker.cc (right): https://codereview.chromium.org/2489433002/diff/40001/components/sync/engine/passive_model_worker.cc#newcode26 components/sync/engine/passive_model_worker.cc:26: ...
4 years, 1 month ago (2016-11-08 18:31:04 UTC) #13
maxbogue
Thanks for the quick reviews all! https://codereview.chromium.org/2489433002/diff/40001/components/history/core/browser/history_model_worker.cc File components/history/core/browser/history_model_worker.cc (right): https://codereview.chromium.org/2489433002/diff/40001/components/history/core/browser/history_model_worker.cc#newcode128 components/history/core/browser/history_model_worker.cc:128: // Can't do ...
4 years, 1 month ago (2016-11-08 18:43:23 UTC) #16
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/2489433002/60001
4 years, 1 month ago (2016-11-08 18:43:47 UTC) #20
vabr (Chromium)
Still LGTM, thanks! https://codereview.chromium.org/2489433002/diff/40001/components/password_manager/sync/browser/password_model_worker.cc File components/password_manager/sync/browser/password_model_worker.cc (right): https://codereview.chromium.org/2489433002/diff/40001/components/password_manager/sync/browser/password_model_worker.cc#newcode66 components/password_manager/sync/browser/password_model_worker.cc:66: // Can't do better without modifying ...
4 years, 1 month ago (2016-11-08 19:24:59 UTC) #21
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 1 month ago (2016-11-08 19:31:00 UTC) #22
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/509cc91f68ef68aebfc761bf6bd282c113a1632e Cr-Commit-Position: refs/heads/master@{#430684}
4 years, 1 month ago (2016-11-08 19:40:34 UTC) #24
sky
4 years, 1 month ago (2016-11-08 23:06:50 UTC) #25
Message was sent while issue was closed.
https://codereview.chromium.org/2489433002/diff/60001/components/history/core...
File components/history/core/browser/history_model_worker.cc (right):

https://codereview.chromium.org/2489433002/diff/60001/components/history/core...
components/history/core/browser/history_model_worker.cc:129: // history DB
thread. Since it doesn't, just return true to bypass a CHECK in
You actually could add such a check, but there is work going on to move
HistoryService to a TaskScheduler, which would mean said check wouldn't work.
That bug is here: https://codereview.chromium.org/2486603003/ . I'm adding you
to that bug in case there are issues with it and sync.

Powered by Google App Engine
This is Rietveld 408576698