mshtml: Store task_magic in HTMLDocumentObj instead of HTMLDocument.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-11-23 17:36:51 +01:00 committed by Alexandre Julliard
parent deee158c00
commit 52a5acaefb
4 changed files with 8 additions and 15 deletions

View File

@ -1291,7 +1291,7 @@ HRESULT setup_edit_mode(HTMLDocumentObj *doc)
if(doc->basedoc.window->mon) { if(doc->basedoc.window->mon) {
/* FIXME: We should find nicer way to do this */ /* FIXME: We should find nicer way to do this */
remove_target_tasks(doc->basedoc.task_magic); remove_target_tasks(doc->task_magic);
mon = doc->basedoc.window->mon; mon = doc->basedoc.window->mon;
IMoniker_AddRef(mon); IMoniker_AddRef(mon);

View File

@ -4858,7 +4858,6 @@ static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex)
doc->outer_unk = outer; doc->outer_unk = outer;
doc->dispex = dispex; doc->dispex = dispex;
doc->task_magic = get_task_target_magic();
HTMLDocument_Persist_Init(doc); HTMLDocument_Persist_Init(doc);
HTMLDocument_OleCmd_Init(doc); HTMLDocument_OleCmd_Init(doc);
@ -4869,13 +4868,6 @@ static void init_doc(HTMLDocument *doc, IUnknown *outer, IDispatchEx *dispex)
ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface, HTMLDocument_cpc); ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)&doc->IHTMLDocument2_iface, HTMLDocument_cpc);
} }
static void destroy_htmldoc(HTMLDocument *This)
{
remove_target_tasks(This->task_magic);
ConnectionPointContainer_Destroy(&This->cp_container);
}
static inline HTMLDocumentNode *impl_from_HTMLDOMNode(HTMLDOMNode *iface) static inline HTMLDocumentNode *impl_from_HTMLDOMNode(HTMLDOMNode *iface)
{ {
return CONTAINING_RECORD(iface, HTMLDocumentNode, node); return CONTAINING_RECORD(iface, HTMLDocumentNode, node);
@ -4925,7 +4917,7 @@ static void HTMLDocumentNode_destructor(HTMLDOMNode *iface)
} }
heap_free(This->event_vector); heap_free(This->event_vector);
destroy_htmldoc(&This->basedoc); ConnectionPointContainer_Destroy(&This->basedoc.cp_container);
} }
static HRESULT HTMLDocumentNode_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret) static HRESULT HTMLDocumentNode_clone(HTMLDOMNode *iface, nsIDOMNode *nsnode, HTMLDOMNode **ret)
@ -5298,7 +5290,8 @@ static ULONG WINAPI HTMLDocumentObj_Release(IUnknown *iface)
DestroyWindow(This->hwnd); DestroyWindow(This->hwnd);
heap_free(This->mime); heap_free(This->mime);
destroy_htmldoc(&This->basedoc); remove_target_tasks(This->task_magic);
ConnectionPointContainer_Destroy(&This->basedoc.cp_container);
release_dispex(&This->dispex); release_dispex(&This->dispex);
if(This->nscontainer) if(This->nscontainer)
@ -5429,6 +5422,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
doc->is_mhtml = is_mhtml; doc->is_mhtml = is_mhtml;
doc->usermode = UNKNOWN_USERMODE; doc->usermode = UNKNOWN_USERMODE;
doc->task_magic = get_task_target_magic();
init_binding_ui(doc); init_binding_ui(doc);

View File

@ -602,8 +602,6 @@ struct HTMLDocument {
HTMLOuterWindow *window; HTMLOuterWindow *window;
LONG task_magic;
ConnectionPointContainer cp_container; ConnectionPointContainer cp_container;
}; };
@ -672,6 +670,7 @@ struct HTMLDocumentObj {
LPWSTR mime; LPWSTR mime;
DWORD update; DWORD update;
LONG task_magic;
}; };
typedef struct nsWeakReference nsWeakReference; typedef struct nsWeakReference nsWeakReference;

View File

@ -424,7 +424,7 @@ HRESULT set_moniker(HTMLOuterWindow *window, IMoniker *mon, IUri *nav_uri, IBind
task = heap_alloc(sizeof(docobj_task_t)); task = heap_alloc(sizeof(docobj_task_t));
task->doc = doc_obj; task->doc = doc_obj;
hres = push_task(&task->header, set_progress_proc, NULL, doc_obj->basedoc.task_magic); hres = push_task(&task->header, set_progress_proc, NULL, doc_obj->task_magic);
if(FAILED(hres)) { if(FAILED(hres)) {
CoTaskMemFree(url); CoTaskMemFree(url);
return hres; return hres;
@ -435,7 +435,7 @@ HRESULT set_moniker(HTMLOuterWindow *window, IMoniker *mon, IUri *nav_uri, IBind
download_task->doc = doc_obj; download_task->doc = doc_obj;
download_task->set_download = set_download; download_task->set_download = set_download;
download_task->url = url; download_task->url = url;
return push_task(&download_task->header, set_downloading_proc, set_downloading_task_destr, doc_obj->basedoc.task_magic); return push_task(&download_task->header, set_downloading_proc, set_downloading_task_destr, doc_obj->task_magic);
} }
return S_OK; return S_OK;