Closed
Bug 283489
Opened 19 years ago
Closed 19 years ago
Expose 64-bit content length on channels
Categories
(Core :: Networking, defect, P1)
Core
Networking
Tracking
()
RESOLVED
FIXED
mozilla1.8beta2
People
(Reporter: Biesinger, Assigned: Biesinger)
References
Details
(Keywords: arch)
Attachments
(7 files, 4 obsolete files)
5.26 KB,
text/plain
|
Details | |
6.33 KB,
text/plain
|
Details | |
13.12 KB,
text/plain
|
Details | |
11.51 KB,
text/plain
|
Details | |
65.91 KB,
patch
|
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
13.41 KB,
text/plain
|
Details | |
927 bytes,
patch
|
bzbarsky
:
review+
bzbarsky
:
superreview+
brendan
:
approval1.8b2+
|
Details | Diff | Splinter Review |
I have a patch to make HTTP and FTP expose a 64-bit content length via nsIPropertyBag2. the patch also makes HTTP, FTP and File channels inherit nsHashPropertyBag. They no longer implement nsIProperties. docshell and xpinstall are fixed up accordingly.
Assignee | ||
Comment 1•19 years ago
|
||
this patch depends on bug 270224's patch I also made nsFtpConnectionThread own a nsRefPtr<nsFTPChannel> rather than nsCOMPtr<nsIFTPChannel>, simplifying some code.
Attachment #175464 -
Flags: review?(darin)
Assignee | ||
Comment 2•19 years ago
|
||
so, question... "content-length" is a quite generic thing. But the other properties we have in the tree live in namespaces (docshell.*, test.*). Should content-length too? Maybe general.content-length?
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.8beta2
Comment 3•19 years ago
|
||
yeah, i wonder about that too. there are two issues: 1) we want to keep property names simple (think: request.props["content-length"]) 2) we want to give consumers the ability to store arbitrary properties on the channel. we want to avoid conflicts between necko defined properties and consumer defined properties.
Comment 4•19 years ago
|
||
btw, the patch looks really great. let's just sort out this issue, and i think we'll be good to go.
Assignee | ||
Comment 5•19 years ago
|
||
Comment on attachment 175464 [details] [diff] [review] patch ok, I'll go with just "content-length", to keep names simple. user-defined properties should have some prefix. I'll add a nsChannelProperties.h file containing the properties exposed by necko. I don't think IDL can have string constants, unfortunately...
Attachment #175464 -
Attachment is obsolete: true
Attachment #175464 -
Flags: review?(darin)
Assignee | ||
Comment 6•19 years ago
|
||
Maybe nsChannelProperties.h should include the NS_LITERAL_STRING(..) so users don't have to?
Attachment #177065 -
Flags: review?(darin)
Assignee | ||
Comment 7•19 years ago
|
||
Comment 8•19 years ago
|
||
To make this efficient we should probably do something like this for necko: http://lxr.mozilla.org/seamonkey/source/extensions/webservices/soap/src/nsSOAPUtils.h#87 We might want to think about tricks that we could play to leverage something like this throughout gecko when we link it all together statically or as part of libxul.
Assignee | ||
Comment 9•19 years ago
|
||
(In reply to comment #8) > To make this efficient we should probably do something like this for necko: > http://lxr.mozilla.org/seamonkey/source/extensions/webservices/soap/src/nsSOAPUtils.h#87 wouldn't be useful for channels outside of libnecko, is that a concern?
Comment 10•19 years ago
|
||
think in terms of libxul :-) no, but seriously... if done right, we could control how these are used depending on how we are building gecko. it probably just takes some clever macroing.
Assignee | ||
Comment 11•19 years ago
|
||
(In reply to comment #10) > think in terms of libxul :-) last I checked mailnews still had some channel implementations, and won't be part of libxul :-) (not to mention extensions...) > no, but seriously... if done right, we could control how these are used > depending on how we are building gecko. it probably just takes some clever > macroing. ah, so depending on whether (say) _IMPL_NS_NECKO is defined, this uses the NS_LITERAL_STRING or such a class member? that'd work... would require spreading some defining over the necko makefiles (not in the dirs that end up in necko2.dll though :) )
Assignee | ||
Comment 12•19 years ago
|
||
of course the question is, does the cost nsDependentString c/dtor matter? (I'm assuming here that the compiler supports 2-byte wchar_t, to my knowledge the win/mac/linux compilers all do)
Comment 13•19 years ago
|
||
constructing a nsDependentString means initializing 4 words on the stack, and then you have to push the address of that object when calling a function. if you already have the object, then you save on codesize. i think we should do away with necko2 fwiw, and just merge the two libraries.
Assignee | ||
Comment 14•19 years ago
|
||
something like this, then?
Attachment #177290 -
Flags: review?(darin)
Assignee | ||
Comment 15•19 years ago
|
||
(this interdiff does not show all the makefile changes which only add a -D_IMPL_NS_NECKO)
Assignee | ||
Comment 16•19 years ago
|
||
Updated•19 years ago
|
Attachment #177065 -
Flags: review?(darin)
Comment 17•19 years ago
|
||
I think you should move the nsNeckoStrings thingy into its own header file. Then include it in nsChannelProperties.h optionally. The reason for this is that we might have some wide strings that we want to use in necko that are not channel properties.
Comment 18•19 years ago
|
||
nsNeckoStrings.cpp would be nice too instead of putting everything in nsNetModule.cpp. Otherwise, this looks pretty good. How do you feel about NS_CHANNEL_PROP_CONTENT_LENGTH instead of NS_CHANNEL_PROPERTY_CONTENT_LENGTH? Less typing, and it is still plenty readable in my opinion. Nit: watch out for overly long lines. Try to break at 80 chars.
Comment 19•19 years ago
|
||
Also, nsNetStrings might be better than nsNeckoStrings since we generally don't refer to "necko" in code like that ;-)
Assignee | ||
Comment 20•19 years ago
|
||
(In reply to comment #18) > NS_CHANNEL_PROP_CONTENT_LENGTH instead of NS_CHANNEL_PROPERTY_CONTENT_LENGTH? > Less typing, and it is still plenty readable in my opinion. Good idea. I had problems fitting lines within 80 characters, and with no obvious place to break them.
Assignee | ||
Comment 21•19 years ago
|
||
with those changes. Things I'm unsure about: - should I move the gNeckoStrings into a NS_InitNetStrings function, implemented in nsNetStrings.cpp and called from nsNetModule? - should nsNetStrings.h be exported? I'm doing that now, but it's really a necko-internal header...
Attachment #178191 -
Flags: review?(darin)
Assignee | ||
Comment 22•19 years ago
|
||
it was a pain to generate this interdiff. I had to mangle the patch a bit, so the shown context may not match current cvs. the actual changes should be right, though.
Assignee | ||
Updated•19 years ago
|
Attachment #177065 -
Attachment is obsolete: true
Attachment #177290 -
Attachment is obsolete: true
Assignee | ||
Updated•19 years ago
|
Attachment #177290 -
Attachment is obsolete: false
Attachment #177290 -
Flags: review?(darin)
Comment 23•19 years ago
|
||
Comment on attachment 178191 [details] [diff] [review] patch v4 also, please change _IMPL_NS_NECKO to IMPL_NS_NET (see bug 266011) > + PRUint32 mSetCacheToken : 1; looks like that is part of some other patch. oh, and nsNeckoStartup should be nsNetStartup. r=darin with those changes.
Attachment #178191 -
Flags: review?(darin) → review+
Assignee | ||
Comment 24•19 years ago
|
||
(In reply to comment #23) > oh, and nsNeckoStartup should be nsNetStartup. I was trying to be consistent with the existing nsNeckoShutdown; should I change both?
Assignee | ||
Comment 25•19 years ago
|
||
this also changes nsNeckoShutdown to nsNetShutdown
Attachment #177290 -
Attachment is obsolete: true
Attachment #178191 -
Attachment is obsolete: true
Attachment #178746 -
Flags: superreview?(bzbarsky)
Assignee | ||
Comment 26•19 years ago
|
||
Assignee | ||
Comment 27•19 years ago
|
||
please ignore the xpinstall makefile change. that one depends on other changes that are not checked in yet.
Comment 28•19 years ago
|
||
Comment on attachment 178746 [details] [diff] [review] patch v5 >Index: netwerk/base/public/nsIChannel.idl >+ * Callers should prefer getting the "content-length" property >+ * using nsIPropertyBag2 as 64-bit value, if available. "as a 64-bit value by QIing the channel to nsIPropertyBag2, if that interface is exposed by the channel". >Index: netwerk/protocol/http/src/nsHttpChannel.cpp Note that nsHttpChannel::SetContentLength throws... Arguably, we should make the 64-bit version throw as well, for consistency. Otherwise we can easily get mismatches between the two numbers even while in the 32-bit range. sr=bzbarsky with those nits picked.
Attachment #178746 -
Flags: superreview?(bzbarsky) → superreview+
Comment 29•19 years ago
|
||
So, it sounds like we might want to have a way to lock properties as readonly. Hmm.
Assignee | ||
Comment 30•19 years ago
|
||
I checked this patch in since freeze is tonight. Bug 289162 filed on locking properties.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Attachment #179870 -
Flags: superreview?(bzbarsky)
Attachment #179870 -
Flags: review?(cbiesinger)
Updated•19 years ago
|
Attachment #179870 -
Flags: superreview?(bzbarsky)
Attachment #179870 -
Flags: superreview+
Attachment #179870 -
Flags: review?(cbiesinger)
Attachment #179870 -
Flags: review+
Attachment #179870 -
Flags: approval1.8b2?
Comment 32•19 years ago
|
||
Comment on attachment 179870 [details] [diff] [review] fix leak regression a=brendan@mozilla.org /be
Attachment #179870 -
Flags: approval1.8b2? → approval1.8b2+
Comment 33•19 years ago
|
||
> Created an attachment (id=179870) [edit]
> fix leak regression
We should probably get in the habit of putting non-virtual destructors in
private sections.
Comment 34•19 years ago
|
||
did this fix cause bug 289724 ? (Mac-only)
You need to log in
before you can comment on or make changes to this bug.
Description
•