Closed Bug 1691861 Opened 3 years ago Closed 3 years ago

Simplify IconLoader code

Categories

(Core :: Widget, task, P3)

task

Tracking

()

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(16 files)

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

There's some code around mozilla::widget::IconLoader that's a little more complicated than it needs to be; there's a loader and a helper and a bunch of cycle collection.

In this bug I'm trying to remove the helper object and to stop using cycle collection for most of these objects by turning some owning references into non-owning references, so that there are fewer cycles.

Now IconLoader no longer has an unnecessary strong reference to the node.

Depends on D104619

It no longer needs to be cycle-collected because it doesn't have any strong
references to other cycle-collected objects anymore.

Depends on D104621

This breaks another strong reference cycle.

Depends on D104623

Depends on D104631

On Windows we were passing an empty rect to signal "entire image", and on macOS we can move the logic into MOZIconHelper.

Depends on D104632

This code seems to have been broken quite some time ago, but without adverse effect.
I have filed bug 1691868 so that a proper fix can be found.

In the meantime, this preserves the current behavior and is less confusing.

Depends on D104633

Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/4c05e66763e2
Unified build fixes. r=mconley
https://hg.mozilla.org/integration/autoland/rev/b26ff99675eb
Remove IconLoader's mContent field, and pass the node to LoadURI instead. r=mconley
https://hg.mozilla.org/integration/autoland/rev/ae78f34ef0c3
Make the mHelper field of IconLoader a non-owning reference, and make sure it's always cleared with a call to Destroy before the helper goes away. r=mconley
https://hg.mozilla.org/integration/autoland/rev/7446edbd382c
Make IconLoader not cycle-collected. r=mconley
https://hg.mozilla.org/integration/autoland/rev/bcc29a743195
Make the mLoadListener field of IconLoaderHelperCocoa a weak pointer. r=mconley
https://hg.mozilla.org/integration/autoland/rev/84ba3baf8242
Make the mLoadListener field of IconLoaderHelperWin a weak pointer. r=mconley
https://hg.mozilla.org/integration/autoland/rev/c568b1b4d5a1
Make IconLoaderHelperWin not cycle-collected. r=mconley
https://hg.mozilla.org/integration/autoland/rev/ce0f21bd123b
IconLoader::Helper no longer needs to inherit from nsISupports, use inline refcounting for each helper subclass instead. r=mconley
https://hg.mozilla.org/integration/autoland/rev/aa072284a77b
Rename IconLoader::Helper to IconLoader::Listener. r=mconley
https://hg.mozilla.org/integration/autoland/rev/b5706477c6d2
Stop using IconLoaderHelperWin and remove it. r=mconley
https://hg.mozilla.org/integration/autoland/rev/ff63868de6d0
Move IconLoaderHelperCocoa functionality into a MOZIconHelper obj-c class. r=spohl
https://hg.mozilla.org/integration/autoland/rev/5603767d8f01
Stop using IconLoaderHelperCocoa in nsMenuItemIconX. r=mconley
https://hg.mozilla.org/integration/autoland/rev/30c26e68d0a5
Stop using IconLoaderHelperCocoa in nsTouchBarInputIcon. r=mconley
https://hg.mozilla.org/integration/autoland/rev/e300fc03ec3e
Remove IconLoaderHelperCocoa. r=mconley
https://hg.mozilla.org/integration/autoland/rev/0eddb7e6a636
Move image region handling out of IconLoader. r=mconley
https://hg.mozilla.org/integration/autoland/rev/bde601066f66
Remove unused mContentType fields. r=mconley
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: