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

Issue 2944993002: Remove dependency on BrowserThread::FILE from Sync code (Closed)

Created:
3 years, 6 months ago by stanisc
Modified:
3 years, 5 months ago
Reviewers:
Devlin, sdefresne, skym
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, sync-reviews_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove dependency on BrowserThread::FILE from Sync code This change moves definition of a task runner for a sync group to a native model code outside of Sync, in this case - to extensions code. This might be a bit controversial because syncer::GROUP_FILE could theoretically include sync types other than syncer::EXTENSION_SETTINGS and syncer::APP_SETTINGS, but in reality those are the only two possible sync types that currently sync on the FILE thread. And since we are migrating to the new TaskScheduler API and sequences, if we need to introduce a new sync type in the future it should run on a new, separate sequence and avoid sharing the FILE group. I added a new function that is supposed to return a singleton instance of SequencedTaskRunner - extensions::GetBackendTaskRunner(). For now the implementation of this function still uses BrowserThread::FILE but that should be changed to use LazySequencedTaskRunner as soon as the rest of extensions storage code is modified to share the same task runner. I noticed that extensions are unavailable of iOS and Android so I removed the syncer::GROUP_FILE option from iOS and Android specific code. To summarize, the next steps are: 1) Change extensions code to use extensions::GetBackendTaskRunner() everywhere the FILE thread is currently used. 2) Modify GetBackendTaskRunner() to use LazySequencedTaskRunner instead of the FILE thread task runner. BUG=689520, 731903 Review-Url: https://codereview.chromium.org/2944993002 Cr-Commit-Position: refs/heads/master@{#482455} Committed: https://chromium.googlesource.com/chromium/src/+/8caf9b2d9cc526400419885f23c373430a34a8f0

Patch Set 1 #

Patch Set 2 : Fixed Android build error #

Patch Set 3 : Changed iOS specific version of CreateModelWorkerForGroup #

Total comments: 10

Patch Set 4 : Addressed feedback and fixed Android test failures #

Total comments: 4

Patch Set 5 : More explicit about returning nullptr ModelSafeWorker for FILE group on Android and iOS #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -27 lines) Patch
M chrome/browser/extensions/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/storage/backend_task_runner.h View 1 2 3 1 chunk +18 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/storage/backend_task_runner.cc View 1 2 3 1 chunk +18 lines, -0 lines 0 comments Download
M chrome/browser/sync/chrome_sync_client.cc View 1 2 3 4 2 chunks +8 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/extension_setting_data_type_controller.cc View 2 chunks +6 lines, -9 lines 0 comments Download
M chrome/browser/sync/test/integration/extension_settings_helper.cc View 1 2 3 5 chunks +11 lines, -13 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_sync_client.mm View 1 2 3 4 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 31 (20 generated)
stanisc
PTAL! rdevlin.cronin@chromium.org - extensions sdefresne@chromium.org - ios skym@chromium.org - sync
3 years, 6 months ago (2017-06-20 22:15:26 UTC) #12
skym
lgtm https://codereview.chromium.org/2944993002/diff/40001/chrome/browser/sync/test/integration/extension_settings_helper.cc File chrome/browser/sync/test/integration/extension_settings_helper.cc (right): https://codereview.chromium.org/2944993002/diff/40001/chrome/browser/sync/test/integration/extension_settings_helper.cc#newcode42 chrome/browser/sync/test/integration/extension_settings_helper.cc:42: CHECK(extensions::GetBackendTaskRunner()->RunsTasksInCurrentSequence()); Would it be more reasonable to have ...
3 years, 6 months ago (2017-06-20 22:22:37 UTC) #13
Devlin
https://codereview.chromium.org/2944993002/diff/40001/chrome/browser/extensions/api/storage/backend_task_runner.cc File chrome/browser/extensions/api/storage/backend_task_runner.cc (right): https://codereview.chromium.org/2944993002/diff/40001/chrome/browser/extensions/api/storage/backend_task_runner.cc#newcode11 chrome/browser/extensions/api/storage/backend_task_runner.cc:11: // TODO(stanisc): crbug.com/731903 : change to LazySequencedTaskRunner once nit: ...
3 years, 6 months ago (2017-06-21 00:25:21 UTC) #14
stanisc
https://codereview.chromium.org/2944993002/diff/40001/chrome/browser/extensions/api/storage/backend_task_runner.cc File chrome/browser/extensions/api/storage/backend_task_runner.cc (right): https://codereview.chromium.org/2944993002/diff/40001/chrome/browser/extensions/api/storage/backend_task_runner.cc#newcode11 chrome/browser/extensions/api/storage/backend_task_runner.cc:11: // TODO(stanisc): crbug.com/731903 : change to LazySequencedTaskRunner once On ...
3 years, 6 months ago (2017-06-21 17:20:55 UTC) #19
Devlin
extensions lgtm with an optional suggetion. https://codereview.chromium.org/2944993002/diff/40001/chrome/browser/extensions/api/storage/backend_task_runner.h File chrome/browser/extensions/api/storage/backend_task_runner.h (right): https://codereview.chromium.org/2944993002/diff/40001/chrome/browser/extensions/api/storage/backend_task_runner.h#newcode13 chrome/browser/extensions/api/storage/backend_task_runner.h:13: // Gets the ...
3 years, 6 months ago (2017-06-21 19:19:32 UTC) #20
stanisc
https://codereview.chromium.org/2944993002/diff/60001/chrome/browser/extensions/api/storage/backend_task_runner.h File chrome/browser/extensions/api/storage/backend_task_runner.h (right): https://codereview.chromium.org/2944993002/diff/60001/chrome/browser/extensions/api/storage/backend_task_runner.h#newcode14 chrome/browser/extensions/api/storage/backend_task_runner.h:14: scoped_refptr<base::SequencedTaskRunner> GetBackendTaskRunner(); On 2017/06/21 19:19:31, Devlin wrote: > Since ...
3 years, 6 months ago (2017-06-22 22:34:16 UTC) #21
stanisc
sdefresne@, please review a small change in ios_chrome_sync_client.mm https://codereview.chromium.org/2944993002/diff/60001/chrome/browser/extensions/api/storage/backend_task_runner.h File chrome/browser/extensions/api/storage/backend_task_runner.h (right): https://codereview.chromium.org/2944993002/diff/60001/chrome/browser/extensions/api/storage/backend_task_runner.h#newcode14 chrome/browser/extensions/api/storage/backend_task_runner.h:14: scoped_refptr<base::SequencedTaskRunner> ...
3 years, 6 months ago (2017-06-23 21:00:23 UTC) #23
Devlin
https://codereview.chromium.org/2944993002/diff/60001/chrome/browser/extensions/api/storage/backend_task_runner.h File chrome/browser/extensions/api/storage/backend_task_runner.h (right): https://codereview.chromium.org/2944993002/diff/60001/chrome/browser/extensions/api/storage/backend_task_runner.h#newcode14 chrome/browser/extensions/api/storage/backend_task_runner.h:14: scoped_refptr<base::SequencedTaskRunner> GetBackendTaskRunner(); On 2017/06/23 21:00:23, stanisc wrote: > On ...
3 years, 6 months ago (2017-06-23 21:23:35 UTC) #24
sdefresne
ios/ lgtm
3 years, 5 months ago (2017-06-25 21:22:50 UTC) #25
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/2944993002/100001
3 years, 5 months ago (2017-06-26 21:44:51 UTC) #28
commit-bot: I haz the power
3 years, 5 months ago (2017-06-26 23:24:25 UTC) #31
Message was sent while issue was closed.
Committed patchset #5 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/8caf9b2d9cc526400419885f23c3...

Powered by Google App Engine
This is Rietveld 408576698