Circular dependency between ProfileSyncServiceFactory and SupervisedUserServiceFactory |
||
Issue descriptionRight now ProfileSyncServiceFactory declares dependencies for all of the BrowserContextKeyedServiceFactories that ChromeSyncClient accesses. This seems like it should make sense because ChromeSyncClient is directly owned by the ProfileSyncService, and as long as the ProfileSyncService is alive, then ChromeSyncClient may be accessing these factories to retrieve various SyncableServices/SyncBridges by model type. However, to access the SyncableService for SUPERVISED_USER_WHITELISTS, we go through the SupervisedUserServiceFactory, which wants to depend on the ProfileSyncServiceFactory. This is because in SupervisedUserService::Init() it seemingly wants to call ProfileSyncService::AddPreferenceProvider() to control forced/preferred types. It doesn't immediately seem unreasonable to me that a model type's chrome/browser/* logic would want to interact with the PSS. I'm not sure what a good solution here looks like. Historically we thread jumped with the Profile object and accessed BrowserContextKeyedServiceFactories on the wrong thread, but https://codereview.chromium.org/2769113002/ should remove that quirk, hopefully. It may be possible that we just drop all the deps of the PSS and just null check everything before we use it?
,
Apr 26 2017
Some context about a potential solution https://codereview.chromium.org/2768923005/
,
May 9 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1c532233baf652b7af9189fb2bce159ae172e739 commit 1c532233baf652b7af9189fb2bce159ae172e739 Author: rishiag <rishiag@chromium.org> Date: Tue May 09 16:58:35 2017 ProfileSyncService: Handle null SupervisedUserService SupervisedUserService might be null as profilesyncservice does not depend on it. So handle null service gracefully instead of npe. Since services are created one per profile, this can happen only when browser is exiting. BUG= 705545 Review-Url: https://codereview.chromium.org/2847803008 Cr-Commit-Position: refs/heads/master@{#470356} [modify] https://crrev.com/1c532233baf652b7af9189fb2bce159ae172e739/chrome/browser/supervised_user/supervised_user_service_factory.cc [modify] https://crrev.com/1c532233baf652b7af9189fb2bce159ae172e739/chrome/browser/supervised_user/supervised_user_service_factory.h [modify] https://crrev.com/1c532233baf652b7af9189fb2bce159ae172e739/chrome/browser/sync/chrome_sync_client.cc [modify] https://crrev.com/1c532233baf652b7af9189fb2bce159ae172e739/chrome/browser/sync/profile_sync_service_factory.cc
,
May 9 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by s...@chromium.org
, Mar 28 2017Labels: -Type-Bug Type-Task
Owner: s...@chromium.org
Status: Assigned (was: Untriaged)