mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 22:07:41 +00:00

Before this commit, one could either capture all stack frames (by passing maxFrameCount = 0) or a maximum of N frames (by passing maxFrameCount = N). This commit introduces the ability to capture the first frame (by default ignoring self hosted frames) with some target principals. This new option required replacing the `unsigned maxFrameCount` parameter with the introduction of a new sum type to describe the stack capturing behavior: StackCapture = AllFrames | MaxFrames(unsigned n) | FirstSubsumedFrame(JSPrincipals* p, bool ignoreSelfHosted) This is obviously more wordy in C++ than we'd like, but does make the stack capturing more explicit rather than relying on the sentinal 0 to stand in for infinity.