Closed
Bug 248810
Opened 20 years ago
Closed 20 years ago
nsIStreamConverter[Service] uses wide strings for mime types
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla1.8alpha2
People
(Reporter: Biesinger, Assigned: Biesinger)
Details
Attachments
(1 file)
65.25 KB,
patch
|
darin.moz
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
nsIStreamConverter and nsIStreamConverterService use wide strings for mime
types. that's completely unnecessary, and a waste of codesize due to conversions
PRUnichar<->char
Assignee | ||
Comment 1•20 years ago
|
||
Assignee | ||
Updated•20 years ago
|
Attachment #151809 -
Flags: superreview?(darin)
Attachment #151809 -
Flags: review?(darin)
Assignee | ||
Updated•20 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8alpha2
Would this...
Index: netwerk/streamconv/src/nsStreamConverterService.cpp
nsCAutoString contractID(NS_ISTREAMCONVERTER_KEY);
contractID.Append("?from=");
contractID.Append(aFromType);
contractID.Append("&to=");
contractID.Append(aToType);
(x 2) be more efficient as a single assign?
nsCAutoString contractID(
NS_LITERAL_CSTRING(NS_ISTREAMCONVERTER_KEY) +
NS_LITERAL_CSTRING("?from=") +
nsDependentCString(aFromType) +
NS_LITERAL_CSTRING("&to=") +
nsDependentString(aToType) );
Or at least using AppendLiteral for the 2 literals.
Comment 3•20 years ago
|
||
Comment on attachment 151809 [details] [diff] [review]
patch
need to rev UUID on interfaces, and please move NS_STREAMCONVERTERSERVICE_CID
into nsNetCID.h ... no CID or ContractID should be declared in an interface
(general rule of thumb).
probably makes sense to keep NS_ISTREAMCONVERTER_KEY in the IDL file though.
i agree with brodie.. maybe do a dependent concat.
r+sr=darin with those changes.
Attachment #151809 -
Flags: superreview?(darin)
Attachment #151809 -
Flags: superreview+
Attachment #151809 -
Flags: review?(darin)
Attachment #151809 -
Flags: review+
Assignee | ||
Comment 4•20 years ago
|
||
hm... ok... I'll make a concat, but I wonder if the cost of the three
constructors & destructors (of the literal strings) is worth it, performance-
and codesize-wise.
Assignee | ||
Comment 5•20 years ago
|
||
(add two ctors/dtors to the list - nsDependentCString)
Assignee | ||
Comment 6•20 years ago
|
||
checked in
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 7•20 years ago
|
||
(In reply to comment #4)
> hm... ok... I'll make a concat, but I wonder if the cost of the three
> constructors & destructors (of the literal strings) is worth it, performance-
> and codesize-wise.
good point... though ctors are inlined
You need to log in
before you can comment on or make changes to this bug.
Description
•