Closed
Bug 632227
Opened 14 years ago
Closed 14 years ago
NetUtil should have a helper method to read an input stream asynchronously
Categories
(Core :: Networking, defect)
Tracking
()
RESOLVED
FIXED
mozilla5
People
(Reporter: sdwilsh, Assigned: sdwilsh)
References
Details
(Keywords: dev-doc-complete)
Attachments
(1 file, 2 obsolete files)
3.99 KB,
patch
|
Details | Diff | Splinter Review |
It turns out to be really hard to read an input stream asynchronously (at least from JS). I'd like to make that easier with a new method on NetUtil. I considered modifying asyncFetch (and could still), but I feel like asyncRead makes more sense.
Input welcome.
Assignee | ||
Comment 1•14 years ago
|
||
On second thought, the code is nearly identical for this new case. asyncFetch is probably the right place for this.
Assignee | ||
Comment 2•14 years ago
|
||
This was surprisingly painless.
Attachment #510439 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 3•14 years ago
|
||
Managed to miss two spots in the java-doc comment that talks about the source. Fixed now.
Attachment #510439 -
Attachment is obsolete: true
Attachment #510440 -
Flags: review?(bzbarsky)
Attachment #510439 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 4•14 years ago
|
||
I guess biesi might be a good person for sr?
Assignee | ||
Updated•14 years ago
|
Whiteboard: [needs review bz]
Comment 5•14 years ago
|
||
Comment on attachment 510440 [details] [diff] [review]
v1.1
r=me
Attachment #510440 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Updated•14 years ago
|
Attachment #510440 -
Flags: superreview?(cbiesinger)
Assignee | ||
Updated•14 years ago
|
Whiteboard: [needs review bz] → [needs sr biesi]
Comment 6•14 years ago
|
||
Is it guaranteed that pump stays alive?
Assignee | ||
Comment 7•14 years ago
|
||
(In reply to comment #6)
> Is it guaranteed that pump stays alive?
Hmm, AFAICT, nothing. I think we have the same problem with the existing implementation and |channel|. bz - am I missing something here?
Comment 8•14 years ago
|
||
The pump is kept alive through the read process, yes. Basically, either the pump is waiting on the stream (and then the stream is keeping it alive) or it's inside OnInputStreamReady and there's a ref to it on the stack.
Similar with channels; between AsyncOpen returning and OnStopRequest being called the channel is kept alive by the necko machinery.
Updated•14 years ago
|
Attachment #510440 -
Flags: superreview?(cbiesinger) → superreview+
Assignee | ||
Comment 9•14 years ago
|
||
Attachment #510440 -
Attachment is obsolete: true
Assignee | ||
Comment 10•14 years ago
|
||
(In reply to comment #8)
> The pump is kept alive through the read process, yes. Basically, either the
> pump is waiting on the stream (and then the stream is keeping it alive) or it's
> inside OnInputStreamReady and there's a ref to it on the stack.
>
> Similar with channels; between AsyncOpen returning and OnStopRequest being
> called the channel is kept alive by the necko machinery.
Thanks for the clarification!
Assignee | ||
Comment 11•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Flags: in-testsuite? → in-testsuite+
Keywords: checkin-needed → dev-doc-needed
Resolution: --- → FIXED
Whiteboard: [can land]
Target Milestone: --- → mozilla2.2
Comment 12•14 years ago
|
||
Updated documentation:
https://developer.mozilla.org/en/JavaScript_code_modules/NetUtil.jsm
Also mentioned on Firefox 5 for developers.
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•