-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure only one IdentityManagerFactory instance gets created
IdentityManagerFactory is a class meant to be instantiated in the browser process via base::Singleton, thus it's not expected to have several instance of them. However, since PR #7480[1] we're actually creating two instances for Brave: the BraveIdentityManagerFactory (subclass) instanced from ProfileSyncServiceFactory as part of a DependsOn() statement, and another one for every other place in the code (68 callpoints at this time) using DependsOn(IdentityManagerFactory::GetInstance()) to initialize different services. This hasn't rang any alarm until Chromium 92.0.4496.3, but in that release some changes were made[2] including the introduction of the IdentityManagerProvider class, which now DCHECKs for having only one instance of IdentityManagerFactory created in the browser: void SetIdentityManagerProvider(const IdentityManagerProvider& provider) { IdentityManagerProvider& instance = GetIdentityManagerProvider(); DCHECK(!instance); instance = provider; } ...meaning that we will get a crash on startup and all the unit and browser tests crashing on DCHECK-enabled builds, revealing this issue that we didn't know we had until now. This patch, makes changes to ensure we have one IdentityManagerFactory instance only, by removing a few parts of the infrastructure added with PR #7480[1] and simply leveraging chromium_src overrides to implement the changes we need for the IdentityManager: to empty implementations of GetAccountsInCookieJar() and GetPrimaryAccountMutator(). [1] #7480 [2] https://chromium-review.googlesource.com/c/chromium/src/+/2824129 Resolves brave/brave-browser#15659
- Loading branch information
Showing
16 changed files
with
24 additions
and
310 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
chromium_src/chrome/browser/signin/identity_manager_factory.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 6 additions & 12 deletions
18
...dentity_manager/brave_identity_manager.cc → ...blic/identity_manager/identity_manager.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
chromium_src/components/signin/public/identity_manager/identity_manager_builder.h
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
components/signin/public/identity_manager/brave_identity_manager.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.