Closed
Bug 273357
Opened 21 years ago
Closed 21 years ago
[extension/java/xpcom] query interface does not discover interface
Categories
(Core Graveyard :: Java to XPCOM Bridge, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: michal.ceresna, Assigned: jhpedemonte)
Details
Attachments
(1 file, 2 obsolete files)
3.60 KB,
patch
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041119 Firefox/1.0 (Debian package 1.0-3)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041119 Firefox/1.0 (Debian package 1.0-3)
This applies to the code in extenstion/java/xpcom
lets have a java-xpcom object implemeted by nsIDOMHTMLButtonElement_Stub.
The corresponding idl hierarchy is:
nsIDOMHTMLButtonElement -> nsIDOMHTMLElement -> nsIDOMNode -> nsISupports
then according to the code in XPCOM.queryInterface
QI to nsIDOMHTMLElement works, but QI to nsIDOMNode does not
because the Class.getInterfaces() returns only parent interfaces
and not all ancestors
Moreover, sometimes I've observed that the aIID parameter to the
XPCOM.queryInterface has the '{' prefix and '}' suffix
Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Reporter | ||
Comment 1•21 years ago
|
||
Assignee | ||
Comment 2•21 years ago
|
||
Newer patch from bug 275359.
Attachment #168009 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Updated•21 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•21 years ago
|
||
This is the patch I put together. The only major difference from your patch is
that I remove the ArrayList elements starting from the front; this should
speed up the common case, where QI asks for one of the directly implemented
interfaces.
I also removed the code dealign with the brackets in the IID string. The
string representation of an IID (nsID->ToString()) contains opening and closing
brackets.
The only problem I have with the loop is that the first run through the loop
will try to get the IID for given object, which is unnecessary. We should just
start with its interfaces and superclass, and go from there. Haven't found a
nice way to code that yet.
Attachment #169399 -
Attachment is obsolete: true
Assignee | ||
Comment 4•21 years ago
|
||
Patch checked into trunk. -> FIXED
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•