From e0157ba201703cec1a098dd40c02462f32a2185e Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sat, 3 Jun 2006 00:39:39 +0200 Subject: [PATCH] mshtml: Store BSCallback in NSContainer and use it instead of load_call. --- dlls/mshtml/mshtml_private.h | 2 +- dlls/mshtml/nsembed.c | 2 +- dlls/mshtml/nsio.c | 2 +- dlls/mshtml/persist.c | 13 ++++++++++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 83bae7f7b05..7223a7e13a9 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -112,7 +112,7 @@ struct NSContainer { HWND hwnd; - BOOL load_call; /* hack */ + BSCallback *bscallback; /* hack */ }; struct BSCallback { diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 907b0f58024..d12326b1be3 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -1153,7 +1153,7 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent) ret->doc = doc; ret->ref = 1; - ret->load_call = FALSE; + ret->bscallback = NULL; if(parent) nsIWebBrowserChrome_AddRef(NSWBCHROME(parent)); diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index f0344e8dfff..561a750e9da 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -589,7 +589,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen return NS_ERROR_UNEXPECTED; } - if(container->load_call) { + if(container->bscallback) { nsIWebBrowserChrome_Release(NSWBCHROME(container)); }else { BOOL cont = before_async_open(This, container); diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index a663fe921ac..55462ad61b8 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c @@ -154,6 +154,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva IMoniker *pimkName, LPBC pibc, DWORD grfMode) { HTMLDocument *This = PERSISTMON_THIS(iface); + BSCallback *bscallback; LPOLESTR url; HRESULT hres; nsresult nsres; @@ -214,24 +215,27 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva } } + bscallback = create_bscallback(This, url); + if(This->nscontainer) { 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, LOAD_FLAGS_NONE, NULL, post_data_stream, NULL); - This->nscontainer->load_call = FALSE; + This->nscontainer->bscallback = NULL; if(post_data_stream) nsIInputStream_Release(post_data_stream); if(NS_SUCCEEDED(nsres)) { + IBindStatusCallback_Release(STATUSCLB(bscallback)); CoTaskMemFree(url); return S_OK; }else { WARN("LoadURI failed: %08lx\n", nsres); } - } + } /* FIXME: Use grfMode */ @@ -240,6 +244,9 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva if(pibc) FIXME("not supported pibc\n"); + IBindStatusCallback_Release(STATUSCLB(bscallback)); + CoTaskMemFree(url); + return S_OK; }