Closed Bug 1264787 Opened 3 years ago Closed 3 years ago

Make nsCSSValue's AdoptListValue & AdoptPairListValue methods take a UniquePtr

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
firefox48 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

Bug 1260655 added some handy AdoptListValue and AdoptPairListValue functions which can take ownership from some external object into our nsCSSValue.

Right now, they're exclusively called with UniquePtr-owned objects (which is great!)  So, we should just make them take UniquePtr-flavored args as well, so that we can make the ownership transfer more explicit using Move() (instead of "release" which they use right now)
Attached patch fix v1Splinter Review
(Haven't tested this thoroughly yet, beyond verifying that it seems to compile correctly in layout/style.)
Comment on attachment 8741518 [details] [diff] [review]
fix v1

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

Looks like this is good: https://treeherder.mozilla.org/#/jobs?repo=try&revision=bac35e76f5a8

Requesting review.
Attachment #8741518 - Flags: review?(cam)
(Also: I'm planning on rebasing on top of bug 1110460 before landing -- I suggested adding one more call to one of these methods there, and that call will need the same trivial s/release()/Move/ treatment for it to play nicely with this patch. I'll wait for that bug's patch to be finished & land before landing here, because I don't want to cause bitrot for jwatt while he's addressing my review comments.)
Attachment #8741518 - Flags: review?(cam) → review+
https://hg.mozilla.org/mozilla-central/rev/8bc1d52fcf71
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.