Closed
Bug 1359201
Opened 8 years ago
Closed 9 months ago
Add a nukeable proxy for HttpBaseChannel::mCallbacks
Categories
(Core :: Networking: Proxy, enhancement, P3)
Core
Networking: Proxy
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: mccr8, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [MemShrink:P2][necko-priority-new][necko-triaged])
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.
Reporter | ||
Updated•8 years ago
|
Summary: Add a nukable proxy for HttpBaseChannel::mCallbacks → Add a nukeable proxy for HttpBaseChannel::mCallbacks
![]() |
||
Comment 1•8 years ago
|
||
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...
Updated•8 years ago
|
Whiteboard: [MemShrink][necko-next] → [MemShrink:P2][necko-next]
Comment 2•7 years ago
|
||
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P2
Comment 3•6 years ago
|
||
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
Reporter | ||
Comment 4•4 years ago
|
||
Bug 1658571 is an example of bad leaks due to callbacks. I think that's nsInputStreamChannel, which is not a subclass of HttpBaseChannel.
Reporter | ||
Comment 5•4 years ago
|
||
I implemented something similar to this for service worker references to promises in bug 1409115, though it looks like the uses of it got removed at some point.
Updated•2 years ago
|
Severity: normal → S3
Comment 6•1 year ago
|
||
Moving bug to Core/Networking: Proxy.
Component: Networking: HTTP → Networking: Proxy
Comment 7•9 months ago
|
||
Do you still think this would be useful?
Flags: needinfo?(continuation)
Whiteboard: [MemShrink:P2][necko-next] → [MemShrink:P2][necko-priority-new]
Reporter | ||
Comment 8•9 months ago
|
||
I think the same basic problem is present, but I personally don't remember seeing any of these issues for a long time, so I think it is fine to close this for now.
Flags: needinfo?(continuation)
Updated•9 months ago
|
Whiteboard: [MemShrink:P2][necko-priority-new] → [MemShrink:P2][necko-priority-new][necko-triaged]
Updated•9 months ago
|
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•