Files
brave-core/components
Serg a044cc5bde [Origin] Wait for all policy managers before refreshing profile policies (#36193)
* [Origin] Wait for all policy managers before refreshing profile policies

`BraveProfilePolicyProvider` observes both `BraveOriginPolicyManager`
and `AdBlockOnlyModePolicyManager`. Each fires `OnBravePoliciesReady`
independently, so the first notification could call `RefreshPolicies`
before the other manager's `Init()` had run -- producing a bundle that
reflected only one source and flipping `IsFirstPolicyLoadComplete` true
on the empty load.

Introduce `BravePolicyManagerBase` with self-registration and a static
`AllInitialized()`. `OnBravePoliciesReady` early-returns until every
registered manager reports ready; `policies_ready_` is gated on the
same check so `SetProfileID` can't trigger a partial refresh either.
Future managers inheriting from the base are picked up automatically.

Resolves: https://github.com/brave/brave-browser/issues/55276
2026-05-06 11:23:42 -04:00
..
2026-04-27 12:00:54 +01:00