Commit 4accd13d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Get nsIWebProgress from notification callback if load group has no observer.

parent 2678126f
......@@ -951,7 +951,7 @@ static HTMLOuterWindow *get_window_from_load_group(nsChannel *This)
static HTMLOuterWindow *get_channel_window(nsChannel *This)
{
nsIWebProgress *web_progress;
nsIWebProgress *web_progress = NULL;
mozIDOMWindowProxy *mozwindow;
HTMLOuterWindow *window;
nsresult nsres;
......@@ -960,25 +960,31 @@ static HTMLOuterWindow *get_channel_window(nsChannel *This)
nsIRequestObserver *req_observer;
nsres = nsILoadGroup_GetGroupObserver(This->load_group, &req_observer);
if(NS_FAILED(nsres) || !req_observer) {
if(NS_FAILED(nsres)) {
ERR("GetGroupObserver failed: %08x\n", nsres);
return NULL;
}
nsres = nsIRequestObserver_QueryInterface(req_observer, &IID_nsIWebProgress, (void**)&web_progress);
nsIRequestObserver_Release(req_observer);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIWebProgress iface: %08x\n", nsres);
return NULL;
if(req_observer) {
nsres = nsIRequestObserver_QueryInterface(req_observer, &IID_nsIWebProgress, (void**)&web_progress);
nsIRequestObserver_Release(req_observer);
if(NS_FAILED(nsres)) {
ERR("Could not get nsIWebProgress iface: %08x\n", nsres);
return NULL;
}
}
}else if(This->notif_callback) {
}
if(!web_progress && This->notif_callback) {
nsres = nsIInterfaceRequestor_GetInterface(This->notif_callback, &IID_nsIWebProgress, (void**)&web_progress);
if(NS_FAILED(nsres)) {
ERR("GetInterface(IID_nsIWebProgress failed: %08x\n", nsres);
return NULL;
}
}else {
ERR("no load group nor notif callback\n");
}
if(!web_progress) {
ERR("Could not find nsIWebProgress\n");
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment