switch to smart pointers for strong nsIFrame members

RESOLVED FIXED in Firefox 57

Status

()

Core
CSS Parsing and Computation
RESOLVED FIXED
8 months ago
8 months ago

People

(Reporter: bholley, Assigned: bholley)

Tracking

unspecified
mozilla57
Points:
---

Firefox Tracking Flags

(firefox57 fixed)

Details

Attachments

(3 attachments)

(Assignee)

Description

8 months ago
These were confusing emilio and I today.
(Assignee)

Comment 2

8 months ago
Created attachment 8901511 [details] [diff] [review]
Part 1 - Make static_casts of mContent use GetContent(). v1

This was done with: perl -pi -e 's/\(mContent\)/\(GetContent\(\)\)/g' *.cpp

MozReview-Commit-ID: 7ugPKf5ypGw
Attachment #8901511 - Flags: review?(emilio+bugs)
(Assignee)

Comment 3

8 months ago
Created attachment 8901512 [details] [diff] [review]
Part 2 - Use a smart pointer for nsIFrame::mContent. v1

MozReview-Commit-ID: 5xsLwXkXym7
Attachment #8901512 - Flags: review?(emilio+bugs)
(Assignee)

Comment 4

8 months ago
Created attachment 8901513 [details] [diff] [review]
Part 3 - Use a smart pointer for nsIFrame::mStyleContext. v1

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+

Comment 6

8 months ago
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

Comment 7

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/52d586efd12e
https://hg.mozilla.org/mozilla-central/rev/12ad96ef08c3
https://hg.mozilla.org/mozilla-central/rev/ab66b090d902
Status: NEW → RESOLVED
Last Resolved: 8 months ago
status-firefox57: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.