Lines 73-79
Link Here
|
73 |
protected class XHRHandler implements nsIDOMEventListener { |
73 |
protected class XHRHandler implements nsIDOMEventListener { |
74 |
|
74 |
|
75 |
// Mozilla XHR object |
75 |
// Mozilla XHR object |
76 |
protected nsIXMLHttpRequest xhr = null; |
76 |
protected nsIXMLHttpRequest xhr; |
77 |
|
77 |
|
78 |
public XHRHandler(nsIXMLHttpRequest xhr) { |
78 |
public XHRHandler(nsIXMLHttpRequest xhr) { |
79 |
// cache the xhr to be able to query on ready-state changes |
79 |
// cache the xhr to be able to query on ready-state changes |
Lines 82-88
Link Here
|
82 |
nsIDOMEventTarget eventListener = (nsIDOMEventTarget) xhr.queryInterface(nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID); |
82 |
nsIDOMEventTarget eventListener = (nsIDOMEventTarget) xhr.queryInterface(nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID); |
83 |
eventListener.addEventListener(ERROR_TYPE, this, false); |
83 |
eventListener.addEventListener(ERROR_TYPE, this, false); |
84 |
eventListener.addEventListener(LOAD_TYPE, this, false); |
84 |
eventListener.addEventListener(LOAD_TYPE, this, false); |
85 |
eventListener.addEventListener(READYSTATE_TYPE, this, false); |
85 |
//eventListener.addEventListener(READYSTATE_TYPE, this, false); |
86 |
} |
86 |
} |
87 |
|
87 |
|
88 |
protected final static int COMPLETE_READYSTATE = 4; |
88 |
protected final static int COMPLETE_READYSTATE = 4; |
Lines 253-259
Link Here
|
253 |
* This means that I can QI to nsIXMLHTTPRequest |
253 |
* This means that I can QI to nsIXMLHTTPRequest |
254 |
*/ |
254 |
*/ |
255 |
nsIInterfaceRequestor intReq = httpChannel.getNotificationCallbacks(); |
255 |
nsIInterfaceRequestor intReq = httpChannel.getNotificationCallbacks(); |
256 |
nsIXMLHttpRequest xhr = (nsIXMLHttpRequest) intReq.queryInterface(nsIXMLHttpRequest.NS_IXMLHTTPREQUEST_IID); |
256 |
nsIXMLHttpRequest xhr = (nsIXMLHttpRequest) intReq.getInterface(nsIXMLHttpRequest.NS_IXMLHTTPREQUEST_IID); |
257 |
|
257 |
|
258 |
handleXHRRequest(xhr); |
258 |
handleXHRRequest(xhr); |
259 |
|
259 |
|
Lines 273-279
Link Here
|
273 |
callList.add(call, request); |
273 |
callList.add(call, request); |
274 |
return; |
274 |
return; |
275 |
} catch (Exception e) { |
275 |
} catch (Exception e) { |
276 |
|
276 |
MozIDEUIPlugin.log(e); |
277 |
} |
277 |
} |
278 |
|
278 |
|
279 |
} |
279 |
} |
Lines 304-310
Link Here
|
304 |
nsIInterfaceRequestor intReq = httpChannel.getNotificationCallbacks(); |
304 |
nsIInterfaceRequestor intReq = httpChannel.getNotificationCallbacks(); |
305 |
|
305 |
|
306 |
// can we QI to XHR? |
306 |
// can we QI to XHR? |
307 |
intReq.queryInterface(nsIXMLHttpRequest.NS_IXMLHTTPREQUEST_IID); |
307 |
intReq.getInterface(nsIXMLHttpRequest.NS_IXMLHTTPREQUEST_IID); |
308 |
|
308 |
|
309 |
return; |
309 |
return; |
310 |
} catch (XPCOMException e) { |
310 |
} catch (XPCOMException e) { |