Closed
Bug 1397815
Opened 7 years ago
Closed 7 years ago
stylo: Need memory reporting for button frame's mInnerFocusStyle
Categories
(Core :: CSS Parsing and Computation, enhancement, P4)
Tracking
()
RESOLVED
FIXED
mozilla58
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
patch
|
emilio
:
review+
|
Details | Diff | Splinter Review |
Is there any reason to not make nsIFrame::AddSizeOfExcludingThisForTree virtual, so subclasses can easily report stuff?
Flags: needinfo?(n.nethercote)
Assignee | ||
Comment 1•7 years ago
|
||
Oh, and see bug 1397380 comment 8 item 4.
Updated•7 years ago
|
Priority: -- → P4
Comment 2•7 years ago
|
||
(In reply to Boris Zbarsky [:bz] (still digging out from vacation mail) from comment #0)
> Is there any reason to not make nsIFrame::AddSizeOfExcludingThisForTree
> virtual, so subclasses can easily report stuff?
The only subclass of nsIFrame I can see is nsBox. And I don't see how nsButtonFrameRenderer is related. What am I missing?
Flags: needinfo?(n.nethercote) → needinfo?(bzbarsky)
Comment 3•7 years ago
|
||
(In reply to Nicholas Nethercote [:njn] from comment #2)
> (In reply to Boris Zbarsky [:bz] (still digging out from vacation mail) from
> comment #0)
> > Is there any reason to not make nsIFrame::AddSizeOfExcludingThisForTree
> > virtual, so subclasses can easily report stuff?
>
> The only subclass of nsIFrame I can see is nsBox. And I don't see how
> nsButtonFrameRenderer is related. What am I missing?
nsIFrame has tons of subclasses... 154 instances from DXR: https://dxr.mozilla.org/mozilla-central/search?q=%2Bderived%3AnsIFrame
Assignee | ||
Comment 4•7 years ago
|
||
> And I don't see how nsButtonFrameRenderer is related. What am I missing?
The nsButtonFrameRenderer lives in the mRenderer member of nsHTMLButtonControlFrame, whose inheritance chain looks like this:
nsHTMLButtonControlFrame -> nsContainerFrame -> nsSplittableFrame -> nsFrame -> nsBox -> nsIFrame
If we want to memory-report things hanging off the nsButtonFrameRenderer, we need to reach it from memory-reporting code somehow. One way is to do it while we're doing our frametree walk anyway in AddSizeOfExcludingThisForTree, but that involves making that method virtual, or adding a virtual hook to it, or explicitly checking for a button control frame in the method and calling something on it. We could also look into other ways to register an nsButtonFrameRenderer or nsHTMLButtonControlFrame with memory-reporting code, of course...
Flags: needinfo?(bzbarsky) → needinfo?(n.nethercote)
Comment 5•7 years ago
|
||
(In reply to Boris Zbarsky [:bz] (still digging out from vacation mail) from comment #0)
> Is there any reason to not make nsIFrame::AddSizeOfExcludingThisForTree
> virtual, so subclasses can easily report stuff?
No. We have other similar classes where *SizeOf* functions are virtual.
Flags: needinfo?(n.nethercote)
Updated•7 years ago
|
status-firefox57:
--- → wontfix
status-firefox58:
--- → fix-optional
Assignee | ||
Comment 6•7 years ago
|
||
MozReview-Commit-ID: cJar2LDrCt
Attachment #8917956 -
Flags: review?(emilio)
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment 7•7 years ago
|
||
Comment on attachment 8917956 [details] [diff] [review]
Add memory reporting for button frame's mInnerFocusStyle and other additional style contexts
Review of attachment 8917956 [details] [diff] [review]:
-----------------------------------------------------------------
::: layout/generic/nsFrame.cpp
@@ +10717,5 @@
> }
> +
> + // And our additional style contexts.
> + int32_t index = 0;
> + while (auto* extra = GetAdditionalStyleContext(index++)->AsServo()) {
AsServo dereferences the pointer in debug builds, so I'm not sure this will work as such. With that fixed, like:
while (auto* extra = GetAdditionalStylecontext(index++)) {
// ...
extra->AsServo()->AddSizeOfIncludingThis(aSizes, ...)
}
r=me
Attachment #8917956 -
Flags: review?(emilio) → review+
Assignee | ||
Comment 8•7 years ago
|
||
Good catch!
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b109053be6ac
Add memory reporting for button frame's mInnerFocusStyle and other additional style contexts. r=emilio
Comment 10•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•