Commit e0157ba2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Store BSCallback in NSContainer and use it instead of load_call.

parent 813e82f2
...@@ -112,7 +112,7 @@ struct NSContainer { ...@@ -112,7 +112,7 @@ struct NSContainer {
HWND hwnd; HWND hwnd;
BOOL load_call; /* hack */ BSCallback *bscallback; /* hack */
}; };
struct BSCallback { struct BSCallback {
......
...@@ -1153,7 +1153,7 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent) ...@@ -1153,7 +1153,7 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent)
ret->doc = doc; ret->doc = doc;
ret->ref = 1; ret->ref = 1;
ret->load_call = FALSE; ret->bscallback = NULL;
if(parent) if(parent)
nsIWebBrowserChrome_AddRef(NSWBCHROME(parent)); nsIWebBrowserChrome_AddRef(NSWBCHROME(parent));
......
...@@ -589,7 +589,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen ...@@ -589,7 +589,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
return NS_ERROR_UNEXPECTED; return NS_ERROR_UNEXPECTED;
} }
if(container->load_call) { if(container->bscallback) {
nsIWebBrowserChrome_Release(NSWBCHROME(container)); nsIWebBrowserChrome_Release(NSWBCHROME(container));
}else { }else {
BOOL cont = before_async_open(This, container); BOOL cont = before_async_open(This, container);
......
...@@ -154,6 +154,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva ...@@ -154,6 +154,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva
IMoniker *pimkName, LPBC pibc, DWORD grfMode) IMoniker *pimkName, LPBC pibc, DWORD grfMode)
{ {
HTMLDocument *This = PERSISTMON_THIS(iface); HTMLDocument *This = PERSISTMON_THIS(iface);
BSCallback *bscallback;
LPOLESTR url; LPOLESTR url;
HRESULT hres; HRESULT hres;
nsresult nsres; nsresult nsres;
...@@ -214,24 +215,27 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva ...@@ -214,24 +215,27 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva
} }
} }
bscallback = create_bscallback(This, url);
if(This->nscontainer) { if(This->nscontainer) {
nsIInputStream *post_data_stream = get_post_data_stream(pibc); nsIInputStream *post_data_stream = get_post_data_stream(pibc);
This->nscontainer->load_call = TRUE; This->nscontainer->bscallback = bscallback;
nsres = nsIWebNavigation_LoadURI(This->nscontainer->navigation, url, nsres = nsIWebNavigation_LoadURI(This->nscontainer->navigation, url,
LOAD_FLAGS_NONE, NULL, post_data_stream, NULL); LOAD_FLAGS_NONE, NULL, post_data_stream, NULL);
This->nscontainer->load_call = FALSE; This->nscontainer->bscallback = NULL;
if(post_data_stream) if(post_data_stream)
nsIInputStream_Release(post_data_stream); nsIInputStream_Release(post_data_stream);
if(NS_SUCCEEDED(nsres)) { if(NS_SUCCEEDED(nsres)) {
IBindStatusCallback_Release(STATUSCLB(bscallback));
CoTaskMemFree(url); CoTaskMemFree(url);
return S_OK; return S_OK;
}else { }else {
WARN("LoadURI failed: %08lx\n", nsres); WARN("LoadURI failed: %08lx\n", nsres);
} }
} }
/* FIXME: Use grfMode */ /* FIXME: Use grfMode */
...@@ -240,6 +244,9 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva ...@@ -240,6 +244,9 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva
if(pibc) if(pibc)
FIXME("not supported pibc\n"); FIXME("not supported pibc\n");
IBindStatusCallback_Release(STATUSCLB(bscallback));
CoTaskMemFree(url);
return S_OK; return S_OK;
} }
......
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