Commit 826f7c0c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shdocvw: Store task list in DocHost object instead of using LPARAM.

parent d9f49ba2
...@@ -33,26 +33,32 @@ static ATOM doc_view_atom = 0; ...@@ -33,26 +33,32 @@ static ATOM doc_view_atom = 0;
void push_dochost_task(DocHost *This, task_header_t *task, task_proc_t proc, task_destr_t destr, BOOL send) void push_dochost_task(DocHost *This, task_header_t *task, task_proc_t proc, task_destr_t destr, BOOL send)
{ {
BOOL is_empty;
task->proc = proc; task->proc = proc;
task->destr = destr; task->destr = destr;
/* FIXME: Don't use lParam */ is_empty = list_empty(&This->task_queue);
list_add_tail(&This->task_queue, &task->entry);
if(send) if(send)
SendMessageW(This->frame_hwnd, WM_DOCHOSTTASK, 0, (LPARAM)task); SendMessageW(This->frame_hwnd, WM_DOCHOSTTASK, 0, 0);
else else if(is_empty)
PostMessageW(This->frame_hwnd, WM_DOCHOSTTASK, 0, (LPARAM)task); PostMessageW(This->frame_hwnd, WM_DOCHOSTTASK, 0, 0);
} }
LRESULT process_dochost_task(DocHost *This, LPARAM lparam) LRESULT process_dochost_tasks(DocHost *This)
{ {
task_header_t *task = (task_header_t*)lparam; task_header_t *task;
task->proc(This, task); while(!list_empty(&This->task_queue)) {
task = LIST_ENTRY(This->task_queue.next, task_header_t, entry);
list_remove(&task->entry);
if(task->destr) task->proc(This, task);
task->destr(task); task->destr(task);
else }
heap_free(task);
return 0; return 0;
} }
...@@ -860,6 +866,7 @@ void DocHost_Init(DocHost *This, IDispatch *disp, const IDocHostContainerVtbl* c ...@@ -860,6 +866,7 @@ void DocHost_Init(DocHost *This, IDispatch *disp, const IDocHostContainerVtbl* c
This->container_vtbl = container; This->container_vtbl = container;
This->ready_state = READYSTATE_UNINITIALIZED; This->ready_state = READYSTATE_UNINITIALIZED;
list_init(&This->task_queue);
DocHost_ClientSite_Init(This); DocHost_ClientSite_Init(This);
DocHost_Frame_Init(This); DocHost_Frame_Init(This);
......
...@@ -649,7 +649,7 @@ ie_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) ...@@ -649,7 +649,7 @@ ie_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
case WM_NOTIFY: case WM_NOTIFY:
return iewnd_OnNotify(This, wparam, lparam); return iewnd_OnNotify(This, wparam, lparam);
case WM_DOCHOSTTASK: case WM_DOCHOSTTASK:
return process_dochost_task(&This->doc_host->doc_host, lparam); return process_dochost_tasks(&This->doc_host->doc_host);
case WM_UPDATEADDRBAR: case WM_UPDATEADDRBAR:
return update_addrbar(This, lparam); return update_addrbar(This, lparam);
} }
......
...@@ -63,7 +63,7 @@ static LRESULT WINAPI shell_embedding_proc(HWND hwnd, UINT msg, WPARAM wParam, L ...@@ -63,7 +63,7 @@ static LRESULT WINAPI shell_embedding_proc(HWND hwnd, UINT msg, WPARAM wParam, L
case WM_SIZE: case WM_SIZE:
return resize_window(This, LOWORD(lParam), HIWORD(lParam)); return resize_window(This, LOWORD(lParam), HIWORD(lParam));
case WM_DOCHOSTTASK: case WM_DOCHOSTTASK:
return process_dochost_task(&This->doc_host, lParam); return process_dochost_tasks(&This->doc_host);
} }
return DefWindowProcW(hwnd, msg, wParam, lParam); return DefWindowProcW(hwnd, msg, wParam, lParam);
......
...@@ -83,6 +83,7 @@ typedef void (*task_proc_t)(DocHost*, struct _task_header_t*); ...@@ -83,6 +83,7 @@ typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
typedef void (*task_destr_t)(struct _task_header_t*); typedef void (*task_destr_t)(struct _task_header_t*);
typedef struct _task_header_t { typedef struct _task_header_t {
struct list entry;
task_proc_t proc; task_proc_t proc;
task_destr_t destr; task_destr_t destr;
} task_header_t; } task_header_t;
...@@ -126,6 +127,8 @@ struct DocHost { ...@@ -126,6 +127,8 @@ struct DocHost {
HWND hwnd; HWND hwnd;
HWND frame_hwnd; HWND frame_hwnd;
struct list task_queue;
LPOLESTR url; LPOLESTR url;
VARIANT_BOOL silent; VARIANT_BOOL silent;
...@@ -247,7 +250,7 @@ void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDE ...@@ -247,7 +250,7 @@ void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDE
#define WM_DOCHOSTTASK (WM_USER+0x300) #define WM_DOCHOSTTASK (WM_USER+0x300)
void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN; void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN;
LRESULT process_dochost_task(DocHost*,LPARAM) DECLSPEC_HIDDEN; LRESULT process_dochost_tasks(DocHost*) DECLSPEC_HIDDEN;
HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
void InternetExplorer_WebBrowser_Init(InternetExplorer*) DECLSPEC_HIDDEN; void InternetExplorer_WebBrowser_Init(InternetExplorer*) DECLSPEC_HIDDEN;
......
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