Closed Bug 1469290 Opened Last year Closed Last year

Avoid extra locks in NS_ReadInputStreamToBuffer

Categories

(Core :: Networking, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: baku, Assigned: baku)

References

Details

Attachments

(1 file, 1 obsolete file)

I just went through the code of NS_ReadInputStreamToBuffer and I think we can avoid the locking completely. It's fine exec ReadSegments() on the owning thread for nsIAsyncInputStream if there is available data.
Attached patch stream2.patch (obsolete) — Splinter Review
Attachment #8985925 - Flags: review?(valentin.gosu)
Comment on attachment 8985925 [details] [diff] [review]
stream2.patch

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

I'm not familiar with this class but at least, when you are removing locks in a class that doesn't enforce single-thread usage by any other means, please add assertions for single thread usage.
Attached patch stream2.patchSplinter Review
Attachment #8985925 - Attachment is obsolete: true
Attachment #8985925 - Flags: review?(valentin.gosu)
Attachment #8985951 - Flags: review?(valentin.gosu)
Attachment #8985951 - Flags: review?(valentin.gosu) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f194f3fb2e6e
Avoid extra locks in NS_ReadInputStreamToBuffer, r=valentin
https://hg.mozilla.org/mozilla-central/rev/f194f3fb2e6e
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Depends on: 1470355
You need to log in before you can comment on or make changes to this bug.