Closed Bug 1637487 Opened 6 years ago Closed 6 years ago

Refactor MixedContentBlocker::ShouldLoad to remove duplicated logic

Categories

(Core :: DOM: Security, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

References

Details

(Whiteboard: [domsecurity-backlog1])

Attachments

(9 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

The logic in ShouldLoad for dealing with adding/removing flags seems a lot more complex than it needs to be.

I have a set of patches to try factor out the logic and reduce the duplication, which I think will make it easier to reason about for adding fission support.

Blocks: 1584157
Type: defect → task
Priority: -- → P3
Whiteboard: [domsecurity-backlog1]

We previously were checking the nsresult inconsistently.

Assignee: nobody → matt.woodrow
Status: NEW → ASSIGNED

This looks like it was necessary a long time ago, but now just runs the same calls as the calling code, so unnecessarily splits the logic into two.

Depends on D75019

Factor out broken flag clearing

Depends on D75021

Pushed by mwoodrow@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b83f49bc11b0 GetState is infallible, so rely on the result. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/ab9df2f2d11f Refactor calls to OnSecurityChange to all be a single call at the end of ShouldLoad. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/83362625c297 Flatten the mixed content event runner into the calling code, so it's no longer needed. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/286e5ee6517f Fold the branches for each pref together, since they do the same thing. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/d1709ebb7f46 Factor out setting of the broken security state flags. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/1a64ef10e773 Factor out updating root Document security flags. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/65bb1114df87 Factor out calls to log changes to mixed content security state. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/c4f0c757cae0 Compute broken flag when we need to use it. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/5633cc2aaa9b Store mixed content security flags as a flags word on Document instead of bools. r=ckerschb
Pushed by mwoodrow@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a6da9185be30 GetState is infallible, so rely on the result. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/a070e28e1293 Refactor calls to OnSecurityChange to all be a single call at the end of ShouldLoad. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/54e745466a1e Flatten the mixed content event runner into the calling code, so it's no longer needed. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/9edfcabb1fb6 Fold the branches for each pref together, since they do the same thing. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/0d2c833ac4d3 Factor out setting of the broken security state flags. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/10b5c92f0200 Factor out updating root Document security flags. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/d615ede24737 Factor out calls to log changes to mixed content security state. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/7b3d6f15776b Compute broken flag when we need to use it. r=ckerschb https://hg.mozilla.org/integration/autoland/rev/56310eefdcdd Store mixed content security flags as a flags word on Document instead of bools. r=ckerschb
Flags: needinfo?(matt.woodrow)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: