DescriptionFix cyclic dependency between ProfilePolicyConnector and PrefService.
PolicyCertVerifier lives (at least partially) on IO to provide certificate trust anchors to the net subsystem.
The list of trust anchors is provided by the policy subsystem, which lives on UI.
On each usage of one of the trust anchors, the profile must be tainted by setting a specific Pref value, which must happen on UI.
There were several problems and bugs, all of which are solved with this CL:
- NetworkConfigurationUpdater keeps a PolicyCertVerifier* until destruction, although PolicyCertVerifier is invalidated earlier and destructed in parallel on IO.
- Instead of explicitly managing lifetime/dependencies, PolicyCertVerifier accesses ProfilePolicyConnector through a WeakPtr.
- Cyclic static dependency between ProfilePolicyConnector and PrefService.
- Each, the original profile and the OffTheRecordProfile (OTRProfile), have a separate PolicyCertVerifier instance. The ProfilePolicyConnector/UserNetworkConfigurationUpdater are shared however. This wasn't considered during the implementation of the latter. They only have a SetPolicyCertVerifier instead of a AddPolicyCertVerifier method.
- ProfilePolicyConnector stores a Profile* instead of a PrefService* .
This CL moves the certificate related parts out of ProfilePolicyConnector and puts them into a separate keyed service NetworkPolicyService (living on UI, taking care of syncing with IO) which is tightly coupled with the PolicyCertVerifier (purely living on IO).
The new dependencies are:
NetworkConfigurationUpdater --(Observer::OnTrustAnchorsChanged)-> NetworkPolicyService --(post to IO)-> PolicyCertVerifier --(run callback, post to UI)-> NetworkPolicyService
For a summary of the dependencies see the accompanying bug.
Depends on:
https://codereview.chromium.org/53923004/
BUG=312660, 77155
TBR=ben@chromium.org,jcivelli@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=234806
Patch Set 1 : #Patch Set 2 : Fix some includes and nits. #
Total comments: 12
Patch Set 3 : Fix NetworkPolicyServiceFactory to shared service for incognito with original profile. #
Total comments: 25
Patch Set 4 : Addressed comments. #Patch Set 5 : Use callback_list in PolicyCertVerifier. #
Total comments: 45
Patch Set 6 : Addressed Joao's comments. #Patch Set 7 : Rebased. #Patch Set 8 : Addressed last comment and fixed compilation. #Patch Set 9 : Reverted back to callbacks without callback_list. Fixed tests. #Patch Set 10 : Addressed issues as discussed. #Patch Set 11 : Fixed another bug for OTRProfile. #
Total comments: 8
Patch Set 12 : Addressed comments. #
Total comments: 8
Patch Set 13 : Incorporated Will's suggestions. #Patch Set 14 : Rebased. #Patch Set 15 : Rebased #Patch Set 16 : Fix/Extend NetworkConfigurationUpdater unit test. #
Total comments: 14
Patch Set 17 : Addressed comments. #Patch Set 18 : Rebased. #Patch Set 19 : Rebased. #Patch Set 20 : Renamed NetworkPolicyService to PolicyCertService. #Patch Set 21 : Moved the files. #Patch Set 22 : Rebased and resolved conflict. #
Total comments: 1
Patch Set 23 : Fixed. #Messages
Total messages: 39 (0 generated)
|