New transitional function identity::LegacyIsUsernameAllowedByPatternFromPrefs()
As explained in crbug.com/908121, we can't fix SigninManager::Initialize() to require a non-null local_state just yet as that would require manually fixing thousands of tests, so we're adding this transitional function to unblock work on crbug.com/906085 allowing to migrate from SigninManager::IsAllowedUsername right away without depending on those other changes. So, this patch implements a new helper function that will behave more similar to SigninManager::IsAllowedUsername on that it will only check the username against the specified pattern if (1) there's a non-null local state passed and (2) the pattern is registered and a value for it has been set, returning true otherwise. We also include an unit test for this helper function, to help with future refactorings if they happen. Bug: 906085 Change-Id: Idef663d07354fb086a5bc00b1ab447f1811c344d Reviewed-on: https://chromium-review.googlesource.com/c/1350895 Commit-Queue: Mario Sanchez Prada <mario@igalia.com> Reviewed-by:Sylvain Defresne <sdefresne@chromium.org> Reviewed-by:
Colin Blundell <blundell@chromium.org> Cr-Commit-Position: refs/heads/master@{#611190}
Showing
Please register or sign in to comment