Closed Bug 71693 Opened 24 years ago Closed 24 years ago

obj.QueryInterface("nsISomething")

Categories

(Core :: XPConnect, defect, P2)

defect

Tracking

()

VERIFIED WONTFIX
mozilla0.9

People

(Reporter: shaver, Assigned: shaver)

Details

Python can do it, and we should too.
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla0.9
I confess to not knowing much about PyXPCOM. But a quick grep in their sources does not find the aformentioned pattern... [x:\trunk\mozilla\extensions\python\xpcom\test]grep queryInterface *.py test_misc.py: .queryInterface(xpcom.components.interfaces.nsISample) test_misc.py: .queryInterface(xpcom.components.interfaces.nsISample) test_misc.py: if not d.has_key(c.queryInterface(xpcom.components.interfaces.n sISupports)): test_misc.py: .queryInterface(xpcom.components.interfaces.nsISupports) test_misc.py: if not d.has_key(c.queryInterface(xpcom.components.interfaces.n sISample)): test_test_component.py: c = c.queryInterface(xpcom.components.interfaces.nsIP ythonTestInterfaceDOMStrings) I vote against this.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → WONTFIX
Do you vote against this because you can't find it in their test cases (it was a pattern in the mail thread you sent me regarding flattening, for example: http://mailarchive.activestate.com/mail/msg/PyXPCom%3A496261 ) or because you think it's a bad idea? I think it's a great readability/usability win, myself. Can you tell me more about why you are against it?
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Do you really want special handling for QI (which xpconnect treats like any other method BTW)? Or do you really want to be able to use a string any place where an iid is expected?
If the latter, then it is a problem that 'iid' is not a type distinguished (in xpidl) from cid. So xpcconvert support to convert strings to nsIDs would have a problem. This leaves us with the former - Special handling for QI. That means that all method calls need to be checked to see if they are QI. And, that this magic iid handling only works with QI and not other uses of iids. Or, do we want to then add xpidl/typelib support for distinguishing nsIID from nsCID? Whcak all uses? or leave old ones in place and let the caller beware? Why not just let people add... const nsISupports = Components.interfaces.nsISupports; ... (as many do) when they want shorthand?
Hrm. Dammit.
Status: REOPENED → RESOLVED
Closed: 24 years ago24 years ago
Resolution: --- → WONTFIX
Marking Verified WontFix -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.