Closed
Bug 237590
Opened 21 years ago
Closed 21 years ago
nsIBinaryInputStream inherits from nsIInputStream but can't be QI'ed to it
Categories
(Core :: Networking, defect)
Core
Networking
Tracking
()
VERIFIED
FIXED
mozilla1.7final
People
(Reporter: bugzilla-mozilla-20000923, Assigned: darin.moz)
Details
Attachments
(1 file, 1 obsolete file)
967 bytes,
patch
|
Biesinger
:
review+
brendan
:
superreview+
brendan
:
approval1.7+
|
Details | Diff | Splinter Review |
As http://lxr.mozilla.org/mozilla/source/xpcom/io/nsIBinaryInputStream.idl#37
shows, nsIBinaryInputStream inherits from nsIInputStream but attempting to QI it
gives this:
Component returned failure code: 0x80004002 (NS_NOINTERFACE)
[nsISupports.QueryInterface]" nsresult: "0x80004002 (NS_NOINTERFACE)" location:
"JS frame :: chrome://chatzilla/content/commands.js :: anonymous :: line 1402"
data: no
Reporter | ||
Comment 1•21 years ago
|
||
This allows the desired QI when tested here.
Comment 2•21 years ago
|
||
hm... from nsBinaryStreams.h:
// Derive from nsIObjectInputStream so this class can be used as a superclass
// by nsObjectInputStream.
class nsBinaryInputStream : public nsIObjectInputStream
so should this also support nsIObjectInputStream in QueryInterface?
Assignee | ||
Comment 3•21 years ago
|
||
Attachment #143994 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #144017 -
Flags: review?(cbiesinger)
Assignee | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.7beta
Updated•21 years ago
|
Attachment #144017 -
Flags: review?(cbiesinger) → review+
Assignee | ||
Updated•21 years ago
|
Attachment #144017 -
Flags: superreview?(brendan)
Comment 4•21 years ago
|
||
Comment on attachment 144017 [details] [diff] [review]
revised patch
I'm not sure we want nsBinaryInputStream QI'ing to nsIObjectInputStream, nor
should nsBinaryOutputStream QI to nsIObjectOutputStream, because the
object-stream stubs call NS_NOTREACHED and return NS_ERROR_NOT_IMPLEMENTED.
It's true that the concrete class implements the interface. If we do this,
then all is well in nsFastLoadFile.cpp. If we don't include the
nsIObject*Stream interface in the corresponding NS_IMPL_ISUPPORTS calls in
nsBinaryStream.cpp, then I guess nsFastLoadFile.cpp needs to list 'em.
Thoughts?
/be
Assignee | ||
Comment 5•21 years ago
|
||
hmm... nsFastLoadFile.cpp does list nsIObject*Stream in its ISUPPORTS_INHERITED
macros. so that's all fine-n-dandy. however, i still think nsBinary*Stream
should list nsIObject*Stream in its QI list. my reasoning is this: suppose in
some other component I want to create a class that is a wrapper for a
nsBinaryInputStream. suppose I want to access
nsIObjectInputStream::GetBuffer/PutBuffer. i'd need QI to work.
perhaps it should just be documented in nsBinary*Stream's contract that it does
not implement all of nsIObject*Stream.
Assignee | ||
Comment 6•21 years ago
|
||
or we could say that nsBinary*Stream inheriting from nsIObject*Stream is an
implementation detail of nsFastLoadFile.
Assignee | ||
Updated•21 years ago
|
Target Milestone: mozilla1.7beta → mozilla1.7final
Comment 7•21 years ago
|
||
Comment on attachment 144017 [details] [diff] [review]
revised patch
Sold. Safe for 1.7 too, I'm approving as well as sr='ing.
/be
Attachment #144017 -
Flags: superreview?(brendan)
Attachment #144017 -
Flags: superreview+
Attachment #144017 -
Flags: approval1.7+
Assignee | ||
Comment 8•21 years ago
|
||
fixed-on-trunk for 1.7 final
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
V/via cvs:
1.22darin%meer.net2004-04-03 09:09 fixes bug 237590 "nsIBinaryInputStream
inherits from nsIInputStream but can't be QI'ed to it" r=biesi sr=brendan a=brendan
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•