Closed
Bug 85310
Opened 23 years ago
Closed 9 years ago
ToNewCString, AssignWithConversion, NS_ConvertASCIItoUCS2 in libnet
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
WORKSFORME
Future
People
(Reporter: nhottanscp, Unassigned)
Details
Attachments
(2 files)
6.26 KB,
patch
|
darin.moz
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
6.84 KB,
patch
|
darin.moz
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
Separated from bug 51355.
Under mozilla/netwerk, there are
59 of ToNewCstring,
43 of AssignWithConversion,
11 of NS_ConvertASCIItoUCS2
Some of them might not be appropriate (i.e. data might not be ASCII only).
Changing them to ToNewUTF8String, NS_ConvertUTF8toUCS2 would not break ASCII
(UTF-8 is a superset of ASCII), though I am not sure about performance
difference if changing all of them unconditionally.
Comment 2•23 years ago
|
||
what is milestone "mozilla1.0" anyway? Moving to future.
Target Milestone: mozilla1.0 → Future
Comment 3•23 years ago
|
||
to gagan. Given time, we should review these call sites.
Assignee: dougt → gagan
Comment 4•20 years ago
|
||
Updated•20 years ago
|
Attachment #151727 -
Flags: superreview?(darin)
Attachment #151727 -
Flags: review?(darin)
Comment 5•20 years ago
|
||
Comment on attachment 151727 [details] [diff] [review]
remove all AssignWithConversion in necko (checked in)
>Index: streamconv/test/TestStreamConv.cpp
> nsresult SendData(const char * aData, nsIStreamListener* aListener, nsIRequest* request) {
>- nsString data;
>- data.AssignWithConversion(aData);
> nsCOMPtr<nsIInputStream> dataStream;
>- nsresult rv = NS_NewStringInputStream(getter_AddRefs(dataStream), data);
>+ nsresult rv = NS_NewCharInputStream(getter_AddRefs(dataStream), aData);
> if (NS_FAILED(rv)) return rv;
>
> return aListener->OnDataAvailable(request, nsnull, dataStream, 0, -1);
> }
note: you're eliminating a string copy here. |dataStream| will hold
a pointer to aData, so we're really counting on the fact that
OnDataAvailable is supposed to consume all of |dataStream| before
returning.
hmm... we should be passing strlen(aData) for the ODA's count param.
but, whatever... this is just test code.
r+sr=darin
Attachment #151727 -
Flags: superreview?(darin)
Attachment #151727 -
Flags: superreview+
Attachment #151727 -
Flags: review?(darin)
Attachment #151727 -
Flags: review+
Comment 6•20 years ago
|
||
Comment on attachment 151727 [details] [diff] [review]
remove all AssignWithConversion in necko (checked in)
thanks, patch checked in.
Attachment #151727 -
Attachment description: remove all AssignWithConversion in necko → remove all AssignWithConversion in necko (checked in)
Comment 7•20 years ago
|
||
this kills *WithConversion (which only matches AppendWithConversion)
Updated•20 years ago
|
Attachment #153719 -
Flags: superreview?(darin)
Attachment #153719 -
Flags: review?(darin)
Updated•20 years ago
|
Attachment #153719 -
Flags: superreview?(darin)
Attachment #153719 -
Flags: superreview+
Attachment #153719 -
Flags: review?(darin)
Attachment #153719 -
Flags: review+
Comment 8•20 years ago
|
||
Comment on attachment 153719 [details] [diff] [review]
remove all *WithConversion from necko (checked in)
checked in
Attachment #153719 -
Attachment description: remove all *WithConversion from necko → remove all *WithConversion from necko (checked in)
Updated•15 years ago
|
Assignee: gagan → nobody
QA Contact: benc → networking
Updated•9 years ago
|
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•