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

Issue 2965153002: Migrate Extensions code to Task Scheduler API (Closed)

Created:
3 years, 5 months ago by stanisc
Modified:
3 years, 5 months ago
Reviewers:
Devlin
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

Migrate Extensions Store/Policy code to Task Scheduler API This changes most of Extensions Store/Policy code to use a dedicated SequencedTaskRunner to post tasks rather than posting on the browser FILE thread. Initially I tried to keep the change limited to the sync related part of the Extensions code. The problem that I ran into is that different types of storage are handled in a generic way on the storage frontend (for example, all them were deleted on FILE thread). So once I migrated the sync storage, I had to modify other storage types as well. Because of that I had to access backend task runner singleton from extensions component so in order to satisfy dependencies I had to move GetBackendTaskRunner() to extensions/browser/api/storage. Some of the tests relied on TestBrowserThreadBundle making all browser threads map to the same physical thread which allowed the test code to satisfy DCHECK_CURRENTLY_ON(BrowserThread::FILE) check while running on the main test thread. With this migration that didn't work anymore so I had to modify ExtensionSettingSyncTest and PolicyValueStoreTest tests to actually post API calls on the right sequence. That was the most difficult part of this change. Other than that the rest of the changes should be straightforward. BUG=689520 Review-Url: https://codereview.chromium.org/2965153002 Cr-Commit-Position: refs/heads/master@{#486250} Committed: https://chromium.googlesource.com/chromium/src/+/6d016c9355721f174c345002f89cb9f750655f6a

Patch Set 1 #

Patch Set 2 : Fixed ExtensionSettingsSyncTest #

Patch Set 3 : Fixed PolicyValueStoreTest #

Patch Set 4 : Removed unneeded BrowserThread using statements and includes. #

Patch Set 5 : Self review #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+1092 lines, -1016 lines) Patch
M chrome/browser/extensions/BUILD.gn View 1 chunk +0 lines, -2 lines 0 comments Download
D chrome/browser/extensions/api/storage/backend_task_runner.h View 1 chunk +0 lines, -18 lines 0 comments Download
D chrome/browser/extensions/api/storage/backend_task_runner.cc View 1 chunk +0 lines, -18 lines 0 comments Download
M chrome/browser/extensions/api/storage/managed_value_store_cache.h View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/storage/managed_value_store_cache.cc View 6 chunks +11 lines, -11 lines 0 comments Download
M chrome/browser/extensions/api/storage/policy_value_store.cc View 1 2 3 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/storage/policy_value_store_unittest.cc View 1 2 7 chunks +23 lines, -12 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_sync_processor.cc View 1 2 3 4 chunks +6 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/storage/settings_sync_unittest.cc View 1 2 21 chunks +906 lines, -839 lines 4 comments Download
M chrome/browser/extensions/api/storage/settings_sync_util.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/storage/sync_storage_backend.cc View 1 2 3 9 chunks +10 lines, -12 lines 0 comments Download
M chrome/browser/extensions/api/storage/sync_value_store_cache.h View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/storage/sync_value_store_cache.cc View 4 chunks +10 lines, -9 lines 0 comments Download
M chrome/browser/extensions/api/storage/syncable_settings_storage.cc View 1 2 3 11 chunks +19 lines, -21 lines 0 comments Download
M chrome/browser/sync/chrome_sync_client.cc View 2 chunks +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/extension_setting_data_type_controller.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/extension_settings_helper.cc View 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/api/storage/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
A extensions/browser/api/storage/backend_task_runner.h View 1 chunk +22 lines, -0 lines 0 comments Download
A extensions/browser/api/storage/backend_task_runner.cc View 1 chunk +22 lines, -0 lines 0 comments Download
M extensions/browser/api/storage/local_value_store_cache.cc View 3 chunks +4 lines, -3 lines 0 comments Download
M extensions/browser/api/storage/settings_test_util.cc View 1 2 chunks +2 lines, -2 lines 0 comments Download
M extensions/browser/api/storage/storage_frontend.cc View 4 chunks +9 lines, -11 lines 0 comments Download
M extensions/browser/api/storage/storage_frontend_unittest.cc View 1 4 chunks +4 lines, -4 lines 0 comments Download
M extensions/browser/value_store/lazy_leveldb.cc View 1 7 chunks +9 lines, -8 lines 0 comments Download
M extensions/browser/value_store/legacy_value_store_factory.cc View 4 chunks +4 lines, -6 lines 0 comments Download
M extensions/browser/value_store/leveldb_value_store.cc View 9 chunks +15 lines, -14 lines 0 comments Download

Messages

Total messages: 23 (17 generated)
stanisc
PTAL!
3 years, 5 months ago (2017-07-12 18:28:12 UTC) #15
Devlin
https://codereview.chromium.org/2965153002/diff/80001/chrome/browser/extensions/api/storage/settings_sync_unittest.cc File chrome/browser/extensions/api/storage/settings_sync_unittest.cc (left): https://codereview.chromium.org/2965153002/diff/80001/chrome/browser/extensions/api/storage/settings_sync_unittest.cc#oldcode422 chrome/browser/extensions/api/storage/settings_sync_unittest.cc:422: // Maintain dictionaries mirrored to the expected values of ...
3 years, 5 months ago (2017-07-12 22:58:00 UTC) #16
stanisc
https://codereview.chromium.org/2965153002/diff/80001/chrome/browser/extensions/api/storage/settings_sync_unittest.cc File chrome/browser/extensions/api/storage/settings_sync_unittest.cc (left): https://codereview.chromium.org/2965153002/diff/80001/chrome/browser/extensions/api/storage/settings_sync_unittest.cc#oldcode422 chrome/browser/extensions/api/storage/settings_sync_unittest.cc:422: // Maintain dictionaries mirrored to the expected values of ...
3 years, 5 months ago (2017-07-12 23:42:49 UTC) #17
Devlin
lgtm; thanks for doing this!
3 years, 5 months ago (2017-07-13 00:54:18 UTC) #18
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/2965153002/80001
3 years, 5 months ago (2017-07-13 01:25:31 UTC) #20
commit-bot: I haz the power
3 years, 5 months ago (2017-07-13 03:12:41 UTC) #23
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/6d016c9355721f174c345002f89c...

Powered by Google App Engine
This is Rietveld 408576698