Closed Bug 763341 Opened 12 years ago Closed 12 years ago

Chrome QI of content object fails for new bindings

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: bholley, Assigned: bholley)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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.
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
Flags: in-testsuite+
Target Milestone: --- → mozilla16
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Depends on: 818281
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: