Closed Bug 736046 Opened 13 years ago Closed 13 years ago

nsXMLHttpRequest::Send fails with mChannel being implemented in JS

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 682305

People

(Reporter: ochameau, Unassigned)

Details

Attachments

(1 file)

Attached file Scratchpad test case
I was trying to implement a nsIChannel object in javascript and face the following platform bug. The "end user" error looks like this: $ request.send(null) Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) nsresult: 0x80004005 (NS_ERROR_FAILURE) It is being due to following code returning 2147500037 (NS_ERROR_FAILURE): rv = mChannel->AsyncOpen(listener, nsnull); http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsXMLHttpRequest.cpp#2833 Where `mChannel` is a xpcom object implemented in Javascript. This error seems to be due to non-reflectiveness of nsXMLHttpRequest. Following call dispatch an NS_ERROR_NO_INTERFACE error: http://mxr.mozilla.org/mozilla-central/source/js/xpconnect/src/XPCWrappedNative.cpp#1986 1988 if (mScriptableInfo && 1989 mScriptableInfo->GetFlags().ClassInfoInterfacesOnly() && 1990 !mSet->HasInterface(aInterface) && 1991 !mSet->HasInterfaceWithAncestor(aInterface)) { 1992 return NS_ERROR_NO_INTERFACE; 1993 } Because nsXMLHttpRequest scriptable flags are set to: 64 #define DOM_DEFAULT_SCRIPTABLE_FLAGS 65 (DEFAULT_SCRIPTABLE_FLAGS | 66 nsIXPCScriptable::DONT_ENUM_QUERY_INTERFACE | 67 nsIXPCScriptable::CLASSINFO_INTERFACES_ONLY) I attached a scratchpad test case that highlight this issue. Unfortunatly I was not able to reduce it to less code, as I think we need to register a custom protocol in order to make XHR use a JS channel.
Component: DOM: Core & HTML → DOM
This looks like a duplicate of bug 682305, right?
Oops, yeah.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: