When I query some interface then previous queried interface methods aren't removed

RESOLVED INVALID

Status

()

Core
XPConnect
RESOLVED INVALID
13 years ago
13 years ago

People

(Reporter: surkov, Assigned: David Bradley)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

577 bytes, application/vnd.mozilla.xul+xml
Details
(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a6) Gecko/20050111
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a6) Gecko/20050111

I query interface 'iface1' from some object. When I query interface 'iface2'
then methods of interface 'iface1' aren't removed from object.

In instance:
var doc=window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
		getInterface(Components.interfaces.nsIWebNavigation);

doc=doc.QueryInterface(Components.interfaces.nsIDocShell);

Variable 'doc' will have methods of interfaces 'nsIWebNavigation' and 'nsIDocShell'.

Reproducible: Always

Steps to Reproduce:
(Reporter)

Comment 1

13 years ago
Created attachment 171858 [details]
testcase
(Assignee)

Comment 2

13 years ago
This behavior is intended and how XPConnect works. XPConnect flattens out the 
interfaces as they are QI'd. Is this causing some problem for you?
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
(Reporter)

Comment 3

13 years ago
No, I haven't any problem. When I worked with COM then I got used to it. I
expect begaviour of QueryInterface() in XPCOM will be like behaviour QI() in
COM. Is there the same behaviour when I work with XPCOM in C++?
You need to log in before you can comment on or make changes to this bug.