Closed Bug 2044569 Opened 3 months ago Closed 3 months ago

For functions that take `already_AddRefed<T>&&`, change to `already_AddRefed<T>` (pass by value instead of by rvalue reference), to force an ownership-transfer into the function (in xpcom and several other directories)

Categories

(Core :: XPCOM, task)

task

Tracking

()

RESOLVED DUPLICATE of bug 2044510

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 obsolete file)

Doing s/already_AddRefed<T>&&/already_AddRefed<T>/ in function parameters -- see bug 2044510 comment 0 for explanation.

I'm splitting this up into different directories so that it can be reviewed/landed in a piecewise manner, since the whole-tree patch is so large.

This bug is for the xpcom/ directory.

This adds strictness, in a way that better-matches our intent when we pass
an already_AddRefed as an argument.

See https://bugzilla.mozilla.org/show_bug.cgi?id=2044510#c0 for more details.

Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Summary: For functions that take `already_AddRefed<T>&&`, change to `already_AddRefed<T>` (pass by value instead of by rvalue reference), to force an ownership-transfer into the function → For functions that take `already_AddRefed<T>&&`, change to `already_AddRefed<T>` (pass by value instead of by rvalue reference), to force an ownership-transfer into the function (in xpcom and several other directories)

(In reply to Daniel Holbert [:dholbert] from comment #0)

I'm splitting this up into different directories so that it can be reviewed/landed in a piecewise manner, since the whole-tree patch is so large.

hmm, actually now I'm thinking it's better to just land the whole patch all at once. In the off chance that there are some overridden virtual functions in here (I found a few that are delcared as virtual/override), changing a function signature in one spot (e.g. as part of landing a piecewise patch) might inadvertently break an inheritance relationship with a subclass/superclass elsewhere in the tree.

Tentatively duping back to bug 2044510.

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Duplicate of bug: 2044510
Resolution: --- → DUPLICATE

(I guess I can split up the patch into pieces in a single stack on the main bug, for ease of review so phabricator presents each one nicely, and then land them atomically as a stack to mitigate the potential for inheritance issues that I described in comment 2.)

Comment on attachment 9592887 [details]
Bug 2044569: Pass already_AddRefed types by-value instead of by rvalue reference, in xpcom/. r?#xpcom-reviewers

Revision D304349 was moved to bug 2044510. Setting attachment 9592887 [details] to obsolete.

Attachment #9592887 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: