Closed
Bug 1333974
Opened 8 years ago
Closed 8 years ago
Label ProxyRelease runnables for ~Decoder and DecodedSurfaceProvider::DropImageReference
Categories
(Core :: XPCOM, defect, P2)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla54
Tracking | Status | |
---|---|---|
firefox54 | --- | fixed |
People
(Reporter: billm, Assigned: mccr8)
References
Details
Attachments
(3 files)
This bug is about labeling the runnables in nsProxyRelease.{cpp,h}.
This could be tricky since it seems like it depends on what we're releasing. Some destructors might touch content and need to be in a certain DocGroup.
Updated•8 years ago
|
Priority: -- → P2
Assignee | ||
Updated•8 years ago
|
Component: DOM → XPCOM
Assignee | ||
Comment 1•8 years ago
|
||
I think the first step here is to extend the "hacky patch" of bug 1331804 to NS_ProxyRelease and NS_ReleaseOnMainThread, to figure out what exactly is being proxied so frequently. I think like runnables themselves, these will have to be patched on a case-by-case basis. Then some mechanism will need to be set up to allow that (assuming that these are concentrated enough for it to be worthwhile to label these).
Assignee: nobody → continuation
Assignee | ||
Comment 2•8 years ago
|
||
I hacked up a patch to pass through the call site for NS_ProxyRelease and NS_ReleaseOnMainThread, then loaded nytimes.com and scrolled up and down a few times, and this is what it turned up:
158 Running anon_romt(/home/amccreight/mc/image/Decoder.cpp:80)
116 Running anon_romt(/home/amccreight/mc/image/DecodedSurfaceProvider.cpp:52)
2 Running anon_romt(/home/amccreight/mc/image/AnimationSurfaceProvider.cpp:53)
So, mostly image lib stuff.
Assignee | ||
Comment 3•8 years ago
|
||
Assignee | ||
Comment 4•8 years ago
|
||
(Those top two call sites are in Decoder::~Decoder and DecodedSurfaceProvider::DropImageReference.)
Assignee | ||
Updated•8 years ago
|
Summary: Label ProxyRelease runnables → Label ProxyRelease runnables for ~Decoder and DecodedSurfaceProvider::DropImageReference
Comment 5•8 years ago
|
||
Is there anything that js/content can observe from these references being dropped? It doesn't seem like it.
Reporter | ||
Comment 6•8 years ago
|
||
It's not uncommon for destructors to end up calling into JS. I don't know if that's the case here, but it can happen in general.
Comment 7•8 years ago
|
||
I looked through the RasterImage destructor, everything it calls, and every destructor for fields of RasterImge that would be called, I can't find a path to anything that could be observable from js/content, or run js.
The closest I could find is that RasterImage::OnSurfaceDiscard (via removing the image from the surface cache) could be called, which dispatches a runnable that sends a notification.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•8 years ago
|
Attachment #8832256 -
Flags: review?(tnikkel)
Assignee | ||
Comment 10•8 years ago
|
||
Part 1 is rather hideously copy-pasta, but it doesn't quite feel like enough to justify yet another layer of templates in that file. The name's not great, but I feel like "system group" is not going to be a concept that is immediately obvious to be mainthread only, so I left the main thread in there.
Part 2 just uses the new method, in the two places identified by my analysis, plus a third place in image/ that seems to do the same thing, also with a RasterImage.
Comment 11•8 years ago
|
||
mozreview-review |
Comment on attachment 8832256 [details]
Bug 1333974, part 2 - Use new API for images.
https://reviewboard.mozilla.org/r/108590/#review109792
Attachment #8832256 -
Flags: review?(tnikkel) → review+
Comment 12•8 years ago
|
||
(In reply to Andrew McCreight [:mccr8] from comment #10)
> Part 2 just uses the new method, in the two places identified by my
> analysis, plus a third place in image/ that seems to do the same thing, also
> with a RasterImage.
Your analysis in comment 2 actually found all three!
Comment 13•8 years ago
|
||
mozreview-review |
Comment on attachment 8832255 [details]
Bug 1333974, part 1 - Add new API for releasing on main thread using the system group.
https://reviewboard.mozilla.org/r/108588/#review109964
I think it'd be slightly better as `NS_ReleaseOnSystemGroup`; `NS_ReleaseOnMainThreadSystemGroup` makes it sound like there may be other system groups?
Attachment #8832255 -
Flags: review?(nfroyd) → review+
Assignee | ||
Comment 14•8 years ago
|
||
(In reply to Nathan Froyd [:froydnj] from comment #13)
> I think it'd be slightly better as `NS_ReleaseOnSystemGroup`;
> `NS_ReleaseOnMainThreadSystemGroup` makes it sound like there may be other
> system groups?
Yeah, it is a little weird. My only concern is that it isn't obvious that this implies the main thread. I guess I could explicitly mention that in the comment in case people are confused?
Comment 15•8 years ago
|
||
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ecb2dfe369e8
part 1 - Add new API for releasing on main thread using the system group. r=froydnj
https://hg.mozilla.org/integration/autoland/rev/4a3433f44ccf
part 2 - Use new API for images. r=tnikkel
Comment 16•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/ecb2dfe369e8
https://hg.mozilla.org/mozilla-central/rev/4a3433f44ccf
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox54:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in
before you can comment on or make changes to this bug.
Description
•