Hello,

For webclient, I'm trying to enable my nsIWebProgressListener to be
notified of XMLHttpRequestTraffic.  I've found this bug, which seems
related:

https://bugzilla.mozilla.org/show_bug.cgi?id=290127

Putting it in the debugger, I see why my existing
nsIWebProgressListener
is not being called:

Given this stack trace:

nsLoadGroup::AddRequest(nsLoadGroup * const 0x0cb77cd8, nsIRequest *
0x0e6c5480, nsISupports * 0x00000000) line 632
nsHttpChannel::AsyncOpen(nsHttpChannel * const 0x0e6c5480,
nsIStreamListener * 0x0e6e86a8, nsISupports * 0x00000000) line 3349
nsXMLHttpRequest::Send(nsXMLHttpRequest * const 0x0e6e8698, nsIVariant
* 0x0d6b1fa8) line 1603 + 46 bytes
XPTC_InvokeByIndex(nsISupports * 0x0e6e8698, unsigned int 13, unsigned
int 1, nsXPTCVariant * 0x0cc0b9c0) line 102
XPCWrappedNative::CallMethod(XPCCallContext & {...},
XPCWrappedNative::CallMode CALL_METHOD) line 2156 + 41 bytes
XPC_WN_CallMethod(JSContext * 0x0cbb3e80, JSObject * 0x0d71ffb0,
unsigned int 1, long * 0x0d6fdc10, long * 0x0cc0bc94) line 1451 + 14
bytes
js_Invoke(JSContext * 0x0cbb3e80, unsigned int 1, unsigned int 0) line
1187 + 23 bytes
js_Interpret(JSContext * 0x0cbb3e80, unsigned char * 0x0d73f053, long
* 0x0cc0c7b0) line 3586 + 15 bytes
js_Invoke(JSContext * 0x0cbb3e80, unsigned int 2, unsigned int 6) line
1207 + 19 bytes
fun_apply(JSContext * 0x0cbb3e80, JSObject * 0x0d71ff40, unsigned int
2, long * 0x0d6fdb1c, long * 0x0cc0c8f8) line 1666 + 15 bytes
js_Invoke(JSContext * 0x0cbb3e80, unsigned int 2, unsigned int 0) line
1187 + 23 bytes
js_Interpret(JSContext * 0x0cbb3e80, unsigned char * 0x0d4017ea, long
* 0x0cc0d414) line 3586 + 15 bytes
js_Invoke(JSContext * 0x0cbb3e80, unsigned int 2, unsigned int 1) line
1207 + 19 bytes
js_Interpret(JSContext * 0x0cbb3e80, unsigned char * 0x0d73e02d, long
* 0x0cc0dee0) line 3130 + 15 bytes
js_Invoke(JSContext * 0x0cbb3e80, unsigned int 1, unsigned int 2) line
1207 + 19 bytes
nsXPCWrappedJSClass::CallMethod(nsXPCWrappedJSClass * const
0x0d4acfb8, nsXPCWrappedJS * 0x0d522218, unsigned short 3, const
nsXPTMethodInfo * 0x0ce05bf0, nsXPTCMiniVariant * 0x0cc0e270) line
1410 + 22 bytes
nsXPCWrappedJS::CallMethod(nsXPCWrappedJS * const 0x0d522218, unsigned
short 3, const nsXPTMethodInfo * 0x0ce05bf0, nsXPTCMiniVariant *
0x0cc0e270) line 462
PrepareAndDispatch(nsXPTCStubBase * 0x0d522218, unsigned int 3,
unsigned int * 0x0cc0e320, unsigned int * 0x0cc0e310) line 117 + 31
bytes
SharedStub() line 147
nsEventListenerManager::HandleEventSubType(nsListenerStruct *
0x0e6912c0, nsIDOMEvent * 0x0d429db8, nsIDOMEventTarget * 0x0d751ae8,
unsigned int 4, unsigned int 7) line 1687 + 39 bytes
nsEventListenerManager::HandleEvent(nsEventListenerManager * const
0x0e6911e0, nsPresContext * 0x0d426028, nsEvent * 0x0cc0ec48,
nsIDOMEvent * * 0x0cc0e618, nsIDOMEventTarget * 0x0d751ae8, unsigned
int 7, nsEventStatus * 0x0cc0f1d0) line 1791
nsGenericElement::HandleDOMEvent(nsPresContext * 0x0d426028, nsEvent *
0x0cc0ec48, nsIDOMEvent * * 0x0cc0e618, unsigned int 7, nsEventStatus
* 0x0cc0f1d0) line 2193
nsHTMLInputElement::HandleDOMEvent(nsPresContext * 0x0d426028, nsEvent
* 0x0cc0ec48, nsIDOMEvent * * 0x00000000, unsigned int 1,
nsEventStatus * 0x0cc0f1d0) line 1482 + 31 bytes
...

I find that the observers are not notified if the request has
LOAD_BACKGROUND set.

In nsLoadGroup::AddRequest():


    if (!(flags & nsIRequest::LOAD_BACKGROUND)) {
      // This is where the OnStartRequest is sent
    }

How can I best make my nsIWebProgressListener be notified of events on
XMLHttpRequests?

Thanks,

Ed

_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to