Closed Bug 1394156 Opened 2 years ago Closed 2 years ago

switch to smart pointers for strong nsIFrame members

Categories

(Core :: CSS Parsing and Computation, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: bholley, Assigned: bholley)

Details

Attachments

(3 files)

These were confusing emilio and I today.
This was done with: perl -pi -e 's/\(mContent\)/\(GetContent\(\)\)/g' *.cpp

MozReview-Commit-ID: 7ugPKf5ypGw
Attachment #8901511 - Flags: review?(emilio+bugs)
MozReview-Commit-ID: 5xsLwXkXym7
Attachment #8901512 - Flags: review?(emilio+bugs)
MozReview-Commit-ID: FizF2iCvp9t
Attachment #8901513 - Flags: review?(emilio+bugs)
Attachment #8901511 - Flags: review?(emilio+bugs) → review+
Attachment #8901512 - Flags: review?(emilio+bugs) → review+
Comment on attachment 8901513 [details] [diff] [review]
Part 3 - Use a smart pointer for nsIFrame::mStyleContext. v1

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

::: layout/generic/nsIFrame.h
@@ +758,5 @@
>    nsStyleContext* StyleContext() const { return mStyleContext; }
>    void SetStyleContext(nsStyleContext* aContext)
>    {
>      if (aContext != mStyleContext) {
> +      RefPtr<nsStyleContext> oldStyleContext = mStyleContext;

nit: You can use mStyleContext.forget() here to avoid a spurious AddRef/Release.
Attachment #8901513 - Flags: review?(emilio+bugs) → review+
Pushed by bholley@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/52d586efd12e
Make static_casts of mContent use GetContent(). r=emilio
https://hg.mozilla.org/integration/autoland/rev/12ad96ef08c3
Use a smart pointer for nsIFrame::mContent. r=emilio
https://hg.mozilla.org/integration/autoland/rev/ab66b090d902
Use a smart pointer for nsIFrame::mStyleContext. r=emilio
You need to log in before you can comment on or make changes to this bug.