Closed Bug 943373 Opened 6 years ago Closed 6 years ago

Use MOZ_THIS_IN_INITIALIZER_LIST instead of the pragma disabling the check

Categories

(Core :: General, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: mccr8, Assigned: mccr8)

Details

(Whiteboard: [qa-])

Attachments

(4 files)

Ms2ger pointed that MOZ thing out.  See bug 770535 comment 10 for the two places where this is currently happening, though it would be good to make sure with a Windows try push that that is all there is.  Once those are converted, the pragma in xpcprivate can be removed.
Let's generalize this a little.  There aren't many places that are using this.
Assignee: nobody → continuation
Component: XPConnect → General
Summary: Use MOZ_THIS_IN_INITIALIZER_LIST instead of the pragma disabling the check in XPConnect → Use MOZ_THIS_IN_INITIALIZER_LIST instead of the pragma disabling the check
Green try run: https://tbpl.mozilla.org/?tree=Try&rev=8e8112629714

After these patches, the only uses left that I see talking about 4355 are in WebRTC and various imported code.
Attachment #8345015 - Flags: review?(bobbyholley+bmo) → review+
Attachment #8345018 - Flags: review?(bobbyholley+bmo) → review+
Have you verified that these "this" in constructors are safe? If not, we should just disable the warning globally (perhaps in the build config). If people just silence the warning, it will only uglify the source.
FYI MSVC11+ disabled this warning by default.
Attachment #8345017 - Flags: review?(birtles) → review+
(In reply to Masatoshi Kimura [:emk] from comment #8)
> Have you verified that these "this" in constructors are safe? If not, we
> should just disable the warning globally (perhaps in the build config). If
> people just silence the warning, it will only uglify the source.

I did.  People are just sticking raw pointers to |this| in the data structures without calling any method on them.
Attachment #8345020 - Flags: review?(jwalden+bmo) → review+
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.