The GTK nsIconChannel implementation first [create a channel](https://searchfox.org/mozilla-central/rev/578d9c83f046d8c361ac6b98b297c27990d468fd/image/decoders/icon/gtk/nsIconChannel.cpp#142-145) using a dummy LoadInfo and immediately afterwards the actual [LoadInfo is set](https://searchfox.org/mozilla-central/rev/578d9c83f046d8c361ac6b98b297c27990d468fd/image/decoders/icon/nsIconProtocolHandler.cpp#58). The Android implementation works similarly. We do the same thing in the somewhat unrelated [`PageIconProtocolHandler`](https://searchfox.org/mozilla-central/rev/578d9c83f046d8c361ac6b98b297c27990d468fd/toolkit/components/places/PageIconProtocolHandler.cpp#224). There was some discussion about this behavior when fixing a null deref in bug 1627644. I don't really see any real justification for why we don't just create the channel with the correct LoadInfo directly there either.
Bug 1967261 Comment 0 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
The GTK nsIconChannel implementation first [creates a channel](https://searchfox.org/mozilla-central/rev/578d9c83f046d8c361ac6b98b297c27990d468fd/image/decoders/icon/gtk/nsIconChannel.cpp#142-145) using a dummy LoadInfo and immediately afterwards the actual [LoadInfo is set](https://searchfox.org/mozilla-central/rev/578d9c83f046d8c361ac6b98b297c27990d468fd/image/decoders/icon/nsIconProtocolHandler.cpp#58). The Android implementation works similarly. We do the same thing in the somewhat unrelated [`PageIconProtocolHandler`](https://searchfox.org/mozilla-central/rev/578d9c83f046d8c361ac6b98b297c27990d468fd/toolkit/components/places/PageIconProtocolHandler.cpp#224). There was some discussion about this behavior when fixing a null deref in bug 1627644. I don't really see any real justification for why we don't just create the channel with the correct LoadInfo directly there either.