mshtml: Correctly handle nsILoadGroup.

This commit is contained in:
Jacek Caban 2006-08-15 21:55:33 +02:00 committed by Alexandre Julliard
parent 498b781e23
commit 9ee2f5e0ad
2 changed files with 29 additions and 2 deletions

View File

@ -309,10 +309,20 @@ static HRESULT WINAPI BindStatusCallback_OnStopBinding(IBindStatusCallback *ifac
TRACE("(%p)->(%08lx %s)\n", This, hresult, debugstr_w(szError));
if(This->nslistener)
if(This->nslistener) {
nsIStreamListener_OnStopRequest(This->nslistener, (nsIRequest*)NSCHANNEL(This->nschannel),
This->nscontext, NS_OK);
if(This->nschannel->load_group) {
nsresult nsres;
nsres = nsILoadGroup_RemoveRequest(This->nschannel->load_group,
(nsIRequest*)NSCHANNEL(This->nschannel), NULL, NS_OK);
if(NS_FAILED(nsres))
ERR("RemoveRequest failed: %08lx\n", nsres);
}
}
return S_OK;
}

View File

@ -602,8 +602,17 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
nsIWebBrowserChrome_Release(NSWBCHROME(container));
if(!This->channel)
if(!This->channel) {
if(This->load_group) {
nsres = nsILoadGroup_AddRequest(This->load_group,
(nsIRequest*)NSCHANNEL(This), NULL);
if(NS_FAILED(nsres))
ERR("AddRequest failed:%08lx\n", nsres);
}
return WINE_NS_LOAD_FROM_MONIKER;
}
}else {
BOOL cont = before_async_open(This, container);
nsIWebBrowserChrome_Release(NSWBCHROME(container));
@ -673,6 +682,14 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
bscallback->nscontext = aContext;
}
if(This->load_group) {
nsres = nsILoadGroup_AddRequest(This->load_group,
(nsIRequest*)NSCHANNEL(This), NULL);
if(NS_FAILED(nsres))
ERR("AddRequest failed:%08lx\n", nsres);
}
start_binding(bscallback);
IBindStatusCallback_Release(STATUSCLB(bscallback));