Open Bug 1359201 Opened 5 years ago Updated 1 year ago
Add a nukeable proxy for Http
Base Channel::m Callbacks
Billm suggested that we could have a nukeable proxy for C++ references "outside" the DOM to references in the DOM. A proxy would be associated with a particular window, and would act like a strong reference until the window got nuked, on page close, when it would get cleared out. This is like a weak reference, except with a specified lifetime. This could prevent many kinds of ghost windows. While this would be a big project to convert everything, I think implementing this just for HttpBaseChannel::mCallbacks could be a big help. Channels aren't cycle collected, and these callbacks can be implemented in JS, so it is very easy to create a cycle through content, leaking the page forever. We also don't seem to test the case of JS implemented mCallbacks very well, but they are heavily used in addons like AdblockPlus, so any bugs there can cause really bad leaks for many users.
Summary: Add a nukable proxy for HttpBaseChannel::mCallbacks → Add a nukeable proxy for HttpBaseChannel::mCallbacks
This doesn't seem completely insane. That said, the channel contract is supposed to be that once you call AsyncOpen the channel will drop the mCallbacks pointer at some point; either before returning from AsyncOpen (on failure return) or after calling OnStopRequest (on successful return from AsyncOpen). Now channel's haven't always _fulfilled_ this contract...
Whiteboard: [MemShrink][necko-next] → [MemShrink:P2][necko-next]
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P2
Moving to p3 because no activity for at least 1 year(s). See https://github.com/mozilla/bug-handling/blob/master/policy/triage-bugzilla.md#how-do-you-triage for more information
Priority: P2 → P3
You need to log in before you can comment on or make changes to this bug.