Right now if sync is disabled for some reasons we return nullptr from ProfileSyncServiceFactory. This has caused multiple crashing bugs as some developers fail to remember to handle this scenario.
If ProfileSyncServiceFactory never returned ProfileSyncService*, but always a SyncService*, which is a pure virtual interface, we could then return a substitute FakeSyncService instead. This means that this bug is currently blocked on moving all PSS functionality into the SS interface that external callers might need. Once we get there, we might as well rename PSSF to SSF.
When we do this, it may be valuable to remove the member fields of FSS that aren't really needed, to reduce memory footprint. This means removing the const& return types from SyncService, which is largely a pre-C++11 practice anyways.
We may want to consider removing SyncService::HasObserver() to allow FSS to have a more correct implementation.
Anyone who currently has business logic that makes decisions based on if PSSF returns a nullptr for the PSS, should instead switch to calling SyncService::IsSyncAllowed().
Comment 1 by pnoland@chromium.org
, Jan 17 2018