Closed Bug 1604040 Opened 4 years ago Closed 4 years ago

Add nsDocShell::BrowsingContext getter

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: evilpie, Unassigned)

References

(Blocks 1 open bug)

Details

It seems like nsDocShell::mBrowsingContext can never be null. This is still not totally obvious to me. If this is actually the case adding nsDocShell::BrowsingContext() would make this more obvious and would short some callsite. We can also remove some null-checks.

How about using OwningNonNull or mozilla::NotNull to make the constraint obvious to the compiler?

We already have GetBrowsingContext() for this. Using the name BrowsingContext unfortunately requires every reference to the BrowsingContext type to be fully qualified, which isn't worth the trouble.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.