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

Issue 757881 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

[Sync] Never return nullptr from ProfileSyncServiceFactory

Project Member Reported by s...@chromium.org, Aug 22 2017

Issue description

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().
 
Status: Archived (was: Available)

Sign in to add a comment