Closed Bug 1394494 Opened 8 years ago Closed 8 years ago

Use a custom Frame::Kind for special BHR frame types

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: nika, Assigned: nika)

References

Details

Attachments

(2 files)

I think this should address your comments and make the behavior for deduplicating stack frames more consistent.
Attachment #8901893 - Flags: review?(nfroyd)
Comment on attachment 8901893 [details] [diff] [review] Use a custom Frame::Kind for special BHR frame types Review of attachment 8901893 [details] [diff] [review]: ----------------------------------------------------------------- r=me. WDYT about the below? ::: toolkit/components/backgroundhangmonitor/HangStack.h @@ +88,5 @@ > , mPC(aPC) > {} > > + explicit Frame(Kind aKind) > + : mKind(aKind) I realize it's a bit different from the other kinds, but maybe: static Frame Content() { return Frame(CONTENT); } and so forth for JIT, WASM, SUPPRESSED, etc. along with a private Frame(Kind) constructor would be better? I guess you'd still want the MOZ_ASSERT in the single-argument Frame constructor, so I'm not totally sure you're winning here. It would have the advantage of making the construction shorter: HangStack::Frame::Content() vs. HangStack::Frame::Frame(HangStack::Frame::Kind::CONTENT);
Attachment #8901893 - Flags: review?(nfroyd) → review+
I think this patch should make the change you suggested. It definitely makes the construction sites nicer, but increases the amount of code a decent amount. What do you think of it?
Attachment #8902335 - Flags: review?(nfroyd)
Comment on attachment 8902335 [details] [diff] [review] Part 2: Switch to using separate static constructor methods for data-free frames Review of attachment 8902335 [details] [diff] [review]: ----------------------------------------------------------------- I like this better, personally.
Attachment #8902335 - Flags: review?(nfroyd) → review+
Pushed by michael@thelayzells.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/f58b56aa6171 Use a custom Frame::Kind for special BHR frame types, r=froydnj
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: