Commit 207fe98e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Moved bscallback to HTMLWindow.

parent 50588739
......@@ -1886,7 +1886,6 @@ static ULONG WINAPI CustomDoc_Release(ICustomDoc *iface)
TRACE("(%p) ref = %u\n", This, ref);
if(!ref) {
set_document_bscallback(&This->basedoc, NULL);
set_current_mon(&This->basedoc, NULL);
if(This->basedoc.doc_node) {
This->basedoc.doc_node->basedoc.doc_obj = NULL;
......
......@@ -158,6 +158,7 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
if(!ref) {
DWORD i;
set_window_bscallback(This, NULL);
window_set_docnode(This, NULL);
release_children(This);
......
......@@ -219,6 +219,8 @@ struct HTMLWindow {
nsIDOMWindow *nswindow;
HTMLWindow *parent;
nsChannelBSC *bscallback;
event_target_t *event_target;
IHTMLEventObj *event;
BOOL *event_vector;
......@@ -358,7 +360,6 @@ struct HTMLDocumentObj {
DWORD update;
/* FIXME: probably should be in document node object */
nsChannelBSC *bscallback;
IMoniker *mon;
LPOLESTR url;
struct list bindings;
......@@ -658,7 +659,7 @@ void init_nsevents(NSContainer*);
void add_nsevent_listener(HTMLWindow*,LPCWSTR);
nsresult get_nsinterface(nsISupports*,REFIID,void**);
void set_document_bscallback(HTMLDocument*,nsChannelBSC*);
void set_window_bscallback(HTMLWindow*,nsChannelBSC*);
void set_current_mon(HTMLDocument*,IMoniker*);
HRESULT start_binding(HTMLDocument*,BSCallback*,IBindCtx*);
void detach_document_bindings(HTMLDocumentObj*);
......
......@@ -951,7 +951,7 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
on_start_nsrequest(This);
/* events are reset when a new document URI is loaded, so re-initialise them here */
if(This->bsc.doc && This->bsc.doc->doc_obj->bscallback == This && This->bsc.doc->doc_obj->nscontainer) {
if(This->bsc.doc && This->bsc.doc->window->bscallback == This && This->bsc.doc->doc_obj->nscontainer) {
update_window_doc(This->bsc.doc->window);
init_nsevents(This->bsc.doc->doc_obj->nscontainer);
}
......@@ -1107,27 +1107,29 @@ IMoniker *get_channelbsc_mon(nsChannelBSC *This)
return This->bsc.mon;
}
void set_document_bscallback(HTMLDocument *doc, nsChannelBSC *callback)
void set_window_bscallback(HTMLWindow *window, nsChannelBSC *callback)
{
BSCallback *iter;
if(doc->doc_obj->bscallback) {
if(doc->doc_obj->bscallback->bsc.binding)
IBinding_Abort(doc->doc_obj->bscallback->bsc.binding);
doc->doc_obj->bscallback->bsc.doc = NULL;
IBindStatusCallback_Release(STATUSCLB(&doc->doc_obj->bscallback->bsc));
if(window->bscallback) {
if(window->bscallback->bsc.binding)
IBinding_Abort(window->bscallback->bsc.binding);
window->bscallback->bsc.doc = NULL;
IBindStatusCallback_Release(STATUSCLB(&window->bscallback->bsc));
}
LIST_FOR_EACH_ENTRY(iter, &doc->doc_obj->bindings, BSCallback, entry) {
iter->doc = NULL;
list_remove(&iter->entry);
if(window->doc_obj) {
LIST_FOR_EACH_ENTRY(iter, &window->doc_obj->bindings, BSCallback, entry) {
iter->doc = NULL;
list_remove(&iter->entry);
}
}
doc->doc_obj->bscallback = callback;
window->bscallback = callback;
if(callback) {
IBindStatusCallback_AddRef(STATUSCLB(&callback->bsc));
callback->bsc.doc = doc;
callback->bsc.doc = &window->doc_obj->basedoc;
}
}
......
......@@ -196,7 +196,7 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
}
}
set_document_bscallback(This, bscallback);
set_window_bscallback(This->window, bscallback);
IUnknown_Release((IUnknown*)bscallback);
CoTaskMemFree(url);
......@@ -292,7 +292,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva
return hres;
if(!bind_complete)
return start_binding(This, (BSCallback*)This->doc_obj->bscallback, pibc);
return start_binding(This, (BSCallback*)This->window->bscallback, pibc);
return S_OK;
}
......@@ -556,7 +556,7 @@ static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM
if(FAILED(hres))
return hres;
return channelbsc_load_stream(This->doc_obj->bscallback, pStm);
return channelbsc_load_stream(This->window->bscallback, pStm);
}
static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm,
......
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