New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 840720 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Closed: Nov 6
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Task



Sign in to add a comment

ProfileSyncService implements too many interfaces

Project Member Reported by treib@chromium.org, May 8 2018

Issue description

ProfileSyncService implements way too many interfaces. Hopefully some of these can be extracted into separate classes. Full list as of right now:

- syncer::SyncService
  - syncer::DataTypeEncryptionHandler
  - KeyedService
- syncer::SyncEngineHost
- syncer::SyncPrefObserver
- syncer::DataTypeManagerObserver
- syncer::UnrecoverableErrorHandler
- OAuth2TokenService::Observer
- identity::IdentityManager::Observer
- GaiaCookieManagerService::Observer
 
The other related cleanup task is to revisit whether some of those interfaces (namely SyncService) can be split into smaller ones.

Comment 2 by treib@chromium.org, May 8 2018

Initial survey:

SyncService and KeyedService are fine.

Identity-related things: See also  bug 825190 .
- OAuth2TokenService::Observer might get removed mid-term.
- GaiaCookieManagerService::Observer is only for detecting cookie jar stats (mismatch, empty), I think this should get obsolete with DICE.
- IdentityManager::Observer should be fine, could maybe be extracted into a new "SyncAccountTracker" or something like that.

SyncEngineHost: This is basically an observer for the SyncEngine, and it has lots of methods. Maybe the whole SyncEngine lifetime can be extracted into another class.

SyncPrefObserver: Only used for detecting changes to the "sync managed" pref, i.e. whether Sync is forced off by policy. Probably fine.

DataTypeManagerObserver: Gets notified of OnConfigureStart and OnConfigureDone. Doesn't seem like this can be easily extracted.

UnrecoverableErrorHandler: This is passed to the SyncEngine, maybe it can be merged into SyncEngineHost (and extracted along with that)?

Comment 3 by treib@chromium.org, May 22 2018

Owner: treib@chromium.org
Status: Started (was: Available)
https://crrev.com/c/1057508 has extraced OAuth2TokenService::Observer and IdentityManager::Observer into a separate class (SyncAuthManager).
Status: WontFix (was: Started)
I don't think there's any low-hanging fruit left here:
- The identity/OAuth things have been pulled out.
- SyncEngineHost and DataTypeManagerObserver won't be easy to pull out.
- UnrecoverableErrorHandler might be possible to remove, but it's only used for the Directory, so it'll hopefully become obsolete soonish anyway.
- GaiaCookieManagerService::Observer will become obsolete once DICe is fully rolled out.

So let's close this.

Sign in to add a comment