Closed Bug 947448 Opened 6 years ago Closed 6 years ago

Define nsXPCWrappedJS::IsRootWrapper() method

Categories

(Core :: XPConnect, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(1 file)

If a wrapped JS's root is the wrapper itself, then it is the root wrapper.  This is checked a number of places, but having it as an explicitly defined predicate makes it clearer what is happening, without needing comments all over the place.
Attachment #8344213 - Flags: review?(bobbyholley+bmo)
Comment on attachment 8344213 [details] [diff] [review]
Define and use nsXPCWrappedJS::IsRootWrapper.

Review of attachment 8344213 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/xpconnect/src/XPCWrappedJS.cpp
@@ +545,5 @@
>  #ifdef DEBUG
>      XPC_LOG_ALWAYS(("nsXPCWrappedJS @ %x with mRefCnt = %d", this, mRefCnt.get()));
>          XPC_LOG_INDENT();
>  
> +        bool isRoot = IsRootWrapper();

seems like we could just nix isRoot here and inline IsRootWrapper(). Not that it matters much...
Attachment #8344213 - Flags: review?(bobbyholley+bmo) → review+
(In reply to Bobby Holley (:bholley) from comment #3)
> seems like we could just nix isRoot here and inline IsRootWrapper(). Not
> that it matters much...
Fixed.

Thanks for the various reviews.

https://hg.mozilla.org/integration/mozilla-inbound/rev/8d80dc68e35a
https://hg.mozilla.org/mozilla-central/rev/8d80dc68e35a
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.