|
[Sync] Stop accessing BrowserContextKeyedServiceFactory on non-UI thread.
In the past the AsyncDirectoryTypeController was passing a raw pointer
to a ChromeSyncClient to the model thread, where it had
GetSyncableServiceForType called on it. This was needed for several
model types, which has specific logic around only accessing their
SyncableService on their model threads. However, this was also bad, as
BrowserContextKeyedServiceFactorys were being used with a Profile
object on a non-UI thread, which is against the rules.
To fix this, GetSyncableServiceForType returns a callback which should
only be run on the model thread, that will return the same
WeakPtr<SyncableService> that we were used to. The various non-UI
thread model types do slightly different things as each type has
different rules and threading guarantees.
The most involved model type in this CL was extensions, which did not
have sufficient threading constraints to ensure safety. Added weak
pointer support to SyncValueStoreCache to fix this.
BUG= 701326
Review-Url: https://codereview.chromium.org/2769113002
Cr-Commit-Position: refs/heads/master@{#460304}
Committed: https://chromium.googlesource.com/chromium/src/+/cd6b31d4b9613087e1a68c620af83b6fe1892bdf
Total comments: 12
Total comments: 5
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+338 lines, -235 lines) |
Patch |
|
M |
chrome/browser/extensions/api/storage/settings_apitest.cc
|
View
|
1
2
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/storage/settings_sync_util.h
|
View
|
|
3 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/storage/settings_sync_util.cc
|
View
|
1
2
3
4
5
6
|
5 chunks |
+33 lines, -23 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/storage/sync_value_store_cache.h
|
View
|
|
3 chunks |
+5 lines, -0 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/storage/sync_value_store_cache.cc
|
View
|
|
2 chunks |
+5 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/sync/chrome_sync_client.h
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/sync/chrome_sync_client.cc
|
View
|
1
2
3
4
5
6
7
|
6 chunks |
+130 lines, -85 lines |
0 comments
|
Download
|
|
M |
components/autofill/core/browser/webdata/autofill_profile_data_type_controller.h
|
View
|
|
1 chunk |
+0 lines, -3 lines |
0 comments
|
Download
|
|
M |
components/autofill/core/browser/webdata/autofill_profile_data_type_controller.cc
|
View
|
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
|
M |
components/browser_sync/profile_sync_test_util.cc
|
View
|
|
3 chunks |
+6 lines, -5 lines |
0 comments
|
Download
|
|
M |
components/search_engines/search_engine_data_type_controller_unittest.cc
|
View
|
|
2 chunks |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/async_directory_type_controller.cc
|
View
|
|
1 chunk |
+7 lines, -2 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/async_directory_type_controller_unittest.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
components/sync/driver/directory_data_type_controller.h
|
View
|
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/directory_data_type_controller.cc
|
View
|
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/fake_generic_change_processor.h
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/fake_generic_change_processor.cc
|
View
|
|
2 chunks |
+3 lines, -4 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/fake_sync_client.h
|
View
|
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/fake_sync_client.cc
|
View
|
|
2 chunks |
+9 lines, -3 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/generic_change_processor.h
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/generic_change_processor.cc
|
View
|
|
3 chunks |
+3 lines, -6 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/generic_change_processor_factory.h
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/generic_change_processor_factory.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/generic_change_processor_unittest.cc
|
View
|
1
|
3 chunks |
+2 lines, -4 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/shared_change_processor.h
|
View
|
|
4 chunks |
+8 lines, -5 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/shared_change_processor.cc
|
View
|
1
2
3
4
5
|
4 chunks |
+13 lines, -13 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/shared_change_processor_unittest.cc
|
View
|
|
2 chunks |
+5 lines, -4 lines |
0 comments
|
Download
|
|
M |
components/sync/driver/sync_client.h
|
View
|
1
2
3
4
5
|
2 chunks |
+6 lines, -5 lines |
0 comments
|
Download
|
|
M |
ios/chrome/browser/sync/ios_chrome_sync_client.h
|
View
|
1
2
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
ios/chrome/browser/sync/ios_chrome_sync_client.mm
|
View
|
1
2
3
4
|
2 chunks |
+73 lines, -44 lines |
0 comments
|
Download
|
Total messages: 48 (33 generated)
|