Closed
Bug 220672
Opened 22 years ago
Closed 22 years ago
consider nsIUTF8StringEnumerator for nsIEncodedChannel
Categories
(Core :: Networking, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.6alpha
People
(Reporter: Biesinger, Assigned: Biesinger)
References
()
Details
Attachments
(1 file)
|
10.80 KB,
patch
|
darin.moz
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
As nsIEncodedChannel::contentEncodings is really just a list of strings, using
nsIUTF8StringEnumerator would be more friendly for callers of this interface.
http://lxr.mozilla.org/seamonkey/source/xpcom/ds/nsIStringEnumerator.idl#52
| Assignee | ||
Comment 2•22 years ago
|
||
ok, taking... but I don't know when I'll get to this...
Assignee: darin → cbiesinger
| Assignee | ||
Updated•22 years ago
|
Target Milestone: Future → mozilla1.6alpha
| Assignee | ||
Comment 3•22 years ago
|
||
(not tested yet)
| Assignee | ||
Comment 4•22 years ago
|
||
Comment on attachment 132648 [details] [diff] [review]
patch
ok, tested the only caller (Save link target as), and it works
Attachment #132648 -
Flags: superreview?(bzbarsky)
Attachment #132648 -
Flags: review?(darin)
| Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Comment 5•22 years ago
|
||
Comment on attachment 132648 [details] [diff] [review]
patch
>Index: netwerk/protocol/http/src/nsHttpChannel.cpp
>+nsHttpChannel::nsContentEncodings::GetNext(nsACString& aNextEncoding)
...
> PRBool haveType = PR_FALSE;
> if (CaseInsensitiveFindInReadable(NS_LITERAL_CSTRING("gzip"),
> start,
> end)) {
>+ aNextEncoding = NS_LITERAL_CSTRING(APPLICATION_GZIP);
> haveType = PR_TRUE;
> }
>
> if (!haveType) {
> encoding.BeginReading(start);
> if (CaseInsensitiveFindInReadable(NS_LITERAL_CSTRING("compress"),
> start,
> end)) {
>+ aNextEncoding = NS_LITERAL_CSTRING(APPLICATION_COMPRESS);
>
> haveType = PR_TRUE;
> }
> }
>
> if (! haveType) {
> encoding.BeginReading(start);
> if (CaseInsensitiveFindInReadable(NS_LITERAL_CSTRING("deflate"),
> start,
> end)) {
>+ aNextEncoding = NS_LITERAL_CSTRING(APPLICATION_ZIP);
> haveType = PR_TRUE;
> }
> }
seems like this code could be compacted into a loop to save footprint.
something for later perhaps.
r=darin
Attachment #132648 -
Flags: review?(darin) → review+
Comment 6•22 years ago
|
||
Comment on attachment 132648 [details] [diff] [review]
patch
sr=bzbarsky
Attachment #132648 -
Flags: superreview?(bzbarsky) → superreview+
| Assignee | ||
Comment 7•22 years ago
|
||
checked in
filed Bug 221290 for that loop suggestion
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•