remove nsAutoArrayPtr usages from toolkit/

RESOLVED FIXED in Firefox 46

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: froydnj, Assigned: haik)

Tracking

unspecified
mozilla46
Points:
---

Firefox Tracking Flags

(firefox46 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
There are just a handful of these:

https://dxr.mozilla.org/mozilla-central/search?q=nsAutoArrayPtr+path%3Atoolkit&redirect=true&case=false

They should be converted to use UniquePtr<T[]> instead; the idiomatic way of declaring and defining a UniquePtr is:

auto var = MakeUnique<T[]>(length);

Since nsAutoArrayPtr implicitly converts to T* and UniquePtr does not, you'll have to add |.get()| calls for all uses of the raw pointer.  Accesses such as |var[i]| do not need any special treatment.
Haik, this would be a good simple first bug to get used to the whole patch workflow. Nathan came up with this for you.
Assignee: nobody → haftandilian
(Assignee)

Comment 2

3 years ago
This is my try link,
https://treeherder.mozilla.org/#/jobs?repo=try&revision=1179a98c6208
A bug was found in the version submitted to try. Executing the
profile manager locally crashed on exit. Fixed that bug in this
patch. Did not re-run try.
(Assignee)

Comment 3

3 years ago
Comment on attachment 8699125 [details] [diff] [review]
remove nsAutoArrayPtr usages from toolkit/

Removed from NULL checks that no longer needed due to infallible allocation.
Attachment #8699125 - Flags: review?(nfroyd)
(Reporter)

Updated

3 years ago
Attachment #8699125 - Flags: review?(nfroyd) → review+
(Assignee)

Updated

3 years ago
Keywords: checkin-needed

Comment 5

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/a20e57b2fd30
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.