Chrome QI of content object fails for new bindings

RESOLVED FIXED in mozilla16

Status

()

Core
XPConnect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bholley, Assigned: bholley)

Tracking

(Blocks: 1 bug)

unspecified
mozilla16
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

A common thing that happens in our test suite is:

enablePrivilege('UniversalXPConnect');
someDOMObject.QueryInterface(Ci.foo).doSomething;

The easiest way to fix this is to use SpecialPowers.wrap(someDOMObject). But this fails for new bindings, because our QueryInterface implementation doesn't unwrap.

As long as we're going to support this pseudo-QI implementation for the new bindings, we should make sure it works from chrome too. Patch coming up.
Created attachment 631766 [details] [diff] [review]
Handle wrappers in new dom binding QI. v1

The |ok| parent check goes away because it's ill-conceived. All it's really checking is that proxies are parented to the global, and it's impossible to port to SpecialPowers, because SpecialPowers will think that the proxy is parented to the SpecialPowers global. I don't think this check is very important, so I removed it.
Attachment #631766 - Flags: review?(bzbarsky)
Comment on attachment 631766 [details] [diff] [review]
Handle wrappers in new dom binding QI. v1

Review of attachment 631766 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/xpconnect/tests/chrome/test_wrappers.xul
@@ +70,5 @@
> +
> +   // Test QI on new dom bindings.
> +   var contentXHR = XPCNativeWrapper(win.wrappedJSObject.xhr);
> +   try {
> +     QIed = contentXHR.QueryInterface(Components.interfaces.nsIClassInfo);

var QIed?
Comment on attachment 631766 [details] [diff] [review]
Handle wrappers in new dom binding QI. v1

r=me
Attachment #631766 - Flags: review?(bzbarsky) → review+
Pushed to try, along with another patch: https://tbpl.mozilla.org/?tree=Try&rev=29d25bdd5cc2
Pushed to inbound: http://hg.mozilla.org/integration/mozilla-inbound/rev/b4dbb556a619
Flags: in-testsuite+
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/b4dbb556a619
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Depends on: 818281
You need to log in before you can comment on or make changes to this bug.