Make nsHttpConnectionInfo::Clone() return already_AddRefed<>

RESOLVED FIXED in Firefox 67

Status

()

enhancement
RESOLVED FIXED
2 months ago
2 months ago

People

(Reporter: mccr8, Assigned: mccr8)

Tracking

unspecified
mozilla67
Points:
---

Firefox Tracking Flags

(firefox67 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

2 months ago

I looked at Valentin's patch in bug 1512472, and went through and checked every other place we create a nsHttpConnectionInfo. The Clone method also assigns to a raw pointer. The code as it is looks okay to me, but it could be made more robust by assigning into a RefPtr and returning an already_AddRefed or RefPtr. This will require a minor change to the caller in nsHttpConnectionInfo::CloneAsDirectRoute(), but I think the rest of the callers should work as-is.

Assignee

Comment 1

2 months ago

This will make it harder for callers of this method to accidentally
leak the connection info.

Comment 2

2 months ago
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/be4af23f4c1a
Make nsHttpConnectionInfo::Clone() return already_AddRefed<>. r=valentin

Comment 3

2 months ago
bugherder
Status: NEW → RESOLVED
Last Resolved: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
You need to log in before you can comment on or make changes to this bug.