mshtml: Store BSCallback in HTMDocument.
This commit is contained in:
parent
7f107fb8da
commit
ccd3399947
|
@ -152,6 +152,8 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
|
|||
if(This->ipsite)
|
||||
IOleDocumentView_SetInPlaceSite(DOCVIEW(This), NULL);
|
||||
|
||||
set_document_bscallback(This, NULL);
|
||||
|
||||
if(This->tooltips_hwnd)
|
||||
DestroyWindow(This->tooltips_hwnd);
|
||||
if(This->hwnd)
|
||||
|
|
|
@ -86,6 +86,8 @@ struct HTMLDocument {
|
|||
IOleInPlaceSite *ipsite;
|
||||
IOleInPlaceFrame *frame;
|
||||
|
||||
BSCallback *bscallback;
|
||||
|
||||
HWND hwnd;
|
||||
HWND tooltips_hwnd;
|
||||
|
||||
|
@ -176,6 +178,8 @@ struct BSCallback {
|
|||
IMoniker *mon;
|
||||
IBinding *binding;
|
||||
|
||||
HTMLDocument *doc;
|
||||
|
||||
nsProtocolStream *nsstream;
|
||||
};
|
||||
|
||||
|
@ -314,8 +318,9 @@ void nsAString_Finish(nsAString*);
|
|||
nsIInputStream *create_nsstream(const char*,PRInt32);
|
||||
nsICommandParams *create_nscommand_params(void);
|
||||
|
||||
BSCallback *create_bscallback(HTMLDocument*,IMoniker*);
|
||||
BSCallback *create_bscallback(IMoniker*);
|
||||
HRESULT start_binding(BSCallback*);
|
||||
void set_document_bscallback(HTMLDocument*,BSCallback*);
|
||||
|
||||
IHlink *Hlink_Create(void);
|
||||
IHTMLSelectionObject *HTMLSelectionObject_Create(nsISelection*);
|
||||
|
|
|
@ -586,7 +586,7 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
|
|||
BSCServiceProvider_QueryService
|
||||
};
|
||||
|
||||
BSCallback *create_bscallback(HTMLDocument *doc, IMoniker *mon)
|
||||
BSCallback *create_bscallback(IMoniker *mon)
|
||||
{
|
||||
BSCallback *ret = mshtml_alloc(sizeof(BSCallback));
|
||||
|
||||
|
@ -604,6 +604,7 @@ BSCallback *create_bscallback(HTMLDocument *doc, IMoniker *mon)
|
|||
ret->nscontext = NULL;
|
||||
ret->nsstream = NULL;
|
||||
ret->binding = NULL;
|
||||
ret->doc = NULL;
|
||||
|
||||
if(mon)
|
||||
IMoniker_AddRef(mon);
|
||||
|
@ -690,7 +691,7 @@ void hlink_frame_navigate(HTMLDocument *doc, IHlinkFrame *hlink_frame,
|
|||
IMoniker *mon;
|
||||
IHlink *hlink;
|
||||
|
||||
callback = create_bscallback(doc, NULL);
|
||||
callback = create_bscallback(NULL);
|
||||
|
||||
if(post_data_stream) {
|
||||
parse_post_data(post_data_stream, &callback->headers, &callback->post_data,
|
||||
|
@ -745,3 +746,20 @@ HRESULT start_binding(BSCallback *bscallback)
|
|||
bscallback->mon = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void set_document_bscallback(HTMLDocument *doc, BSCallback *callback)
|
||||
{
|
||||
if(doc->bscallback) {
|
||||
if(doc->bscallback->binding)
|
||||
IBinding_Abort(doc->bscallback->binding);
|
||||
doc->bscallback->doc = NULL;
|
||||
IBindStatusCallback_Release(STATUSCLB(doc->bscallback));
|
||||
}
|
||||
|
||||
doc->bscallback = callback;
|
||||
|
||||
if(callback) {
|
||||
IBindStatusCallback_AddRef(STATUSCLB(callback));
|
||||
callback->doc = doc;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -668,7 +668,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen
|
|||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
bscallback = create_bscallback(NULL, mon);
|
||||
bscallback = create_bscallback(mon);
|
||||
IMoniker_Release(mon);
|
||||
|
||||
nsIChannel_AddRef(NSCHANNEL(This));
|
||||
|
|
|
@ -218,7 +218,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva
|
|||
}
|
||||
}
|
||||
|
||||
bscallback = create_bscallback(This, pimkName);
|
||||
bscallback = create_bscallback(pimkName);
|
||||
|
||||
task = mshtml_alloc(sizeof(task_t));
|
||||
|
||||
|
@ -260,6 +260,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva
|
|||
if(pibc)
|
||||
FIXME("not supported pibc\n");
|
||||
|
||||
set_document_bscallback(This, bscallback);
|
||||
hres = start_binding(bscallback);
|
||||
|
||||
IBindStatusCallback_Release(STATUSCLB(bscallback));
|
||||
|
@ -508,4 +509,6 @@ void HTMLDocument_Persist_Init(HTMLDocument *This)
|
|||
This->lpPersistFileVtbl = &PersistFileVtbl;
|
||||
This->lpMonikerPropVtbl = &MonikerPropVtbl;
|
||||
This->lpPersistStreamInitVtbl = &PersistStreamInitVtbl;
|
||||
|
||||
This->bscallback = NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue