Open
Bug 1424374
Opened 7 years ago
Updated 2 years ago
DOM Cache API should consider using PromiseWindowProxy and weak-refs
Categories
(Core :: Storage: Cache API, enhancement, P3)
Core
Storage: Cache API
Tracking
()
NEW
People
(Reporter: bkelly, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [MemShrink:P2])
Currently the DOM Cache API is holding strong refs to the promise, parent object, and global for every operation it performs:
https://searchfox.org/mozilla-central/source/dom/cache/CacheOpChild.h#75
We should investigate if we can make these weak and use the new PromiseWindowProxy.
Reporter | ||
Comment 1•7 years ago
|
||
Andrew, I was thinking about this a bit more and I actually started to think maybe every API that returns a Promise backed by some internal native operation should use PromiseWindowProxy. If thats the case, though, maybe we should make Promise do that automatically?
For example, if we created a separate internal PromisePrivate structure then the Promise itself could have the weak reference to it and the window.
Fixing this in Promise itself would avoid having to roto-till a bunch of code through the tree and complicating the API. What do you think?
Flags: needinfo?(continuation)
Comment 2•7 years ago
|
||
(In reply to Ben Kelly [:bkelly] from comment #1)
> Fixing this in Promise itself would avoid having to roto-till a bunch of
> code through the tree and complicating the API. What do you think?
That sounds reasonable. I don't know how Promises are used.
Flags: needinfo?(continuation)
Reporter | ||
Comment 3•7 years ago
|
||
I think nearly every DOM returned Promise is held alive by some system activity. We rely on these being resolved at some point or at window close. As we learned with the SW job queue that can fail. So I think fixing this in the Promise class itself would be worth it.
Updated•7 years ago
|
Priority: -- → P3
Updated•7 years ago
|
Whiteboard: [MemShrink] → [MemShrink:P2]
Assignee | ||
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•5 years ago
|
Component: DOM: Core & HTML → Storage: Cache API
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•