Module: wine Branch: master Commit: 8b6a3f554a216fb0bb876bea1483befd9b2fabf9 URL: https://source.winehq.org/git/wine.git/?a=commit;h=8b6a3f554a216fb0bb876bea1...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Apr 22 01:49:02 2021 +0200
mshtml: Introduce timer_type enum.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/mshtml/htmlwindow.c | 8 ++++---- dlls/mshtml/mshtml_private.h | 7 ++++++- dlls/mshtml/task.c | 6 ++++-- 3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 9da2f7ccbae..e535cd54bd6 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -1734,7 +1734,7 @@ static HRESULT WINAPI HTMLWindow3_detachEvent(IHTMLWindow3 *iface, BSTR event, I }
static HRESULT window_set_timer(HTMLInnerWindow *This, VARIANT *expr, LONG msec, VARIANT *language, - BOOL interval, LONG *timer_id) + enum timer_type timer_type, LONG *timer_id) { IDispatch *disp = NULL; HRESULT hres; @@ -1757,7 +1757,7 @@ static HRESULT window_set_timer(HTMLInnerWindow *This, VARIANT *expr, LONG msec, if(!disp) return E_FAIL;
- hres = set_task_timer(This, msec, interval, disp, timer_id); + hres = set_task_timer(This, msec, timer_type, disp, timer_id); IDispatch_Release(disp);
return hres; @@ -1770,7 +1770,7 @@ static HRESULT WINAPI HTMLWindow3_setTimeout(IHTMLWindow3 *iface, VARIANT *expre
TRACE("(%p)->(%s %d %s %p)\n", This, debugstr_variant(expression), msec, debugstr_variant(language), timerID);
- return window_set_timer(This->inner_window, expression, msec, language, FALSE, timerID); + return window_set_timer(This->inner_window, expression, msec, language, TIMER_TIMEOUT, timerID); }
static HRESULT WINAPI HTMLWindow3_setInterval(IHTMLWindow3 *iface, VARIANT *expression, LONG msec, @@ -1780,7 +1780,7 @@ static HRESULT WINAPI HTMLWindow3_setInterval(IHTMLWindow3 *iface, VARIANT *expr
TRACE("(%p)->(%p %d %p %p)\n", This, expression, msec, language, timerID);
- return window_set_timer(This->inner_window, expression, msec, language, TRUE, timerID); + return window_set_timer(This->inner_window, expression, msec, language, TIMER_INTERVAL, timerID); }
static HRESULT WINAPI HTMLWindow3_print(IHTMLWindow3 *iface) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index adb71014acb..4cbddb68022 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -1213,7 +1213,12 @@ LONG get_task_target_magic(void) DECLSPEC_HIDDEN; HRESULT push_task(task_t*,task_proc_t,task_proc_t,LONG) DECLSPEC_HIDDEN; void remove_target_tasks(LONG) DECLSPEC_HIDDEN;
-HRESULT set_task_timer(HTMLInnerWindow*,LONG,BOOL,IDispatch*,LONG*) DECLSPEC_HIDDEN; +enum timer_type { + TIMER_TIMEOUT, + TIMER_INTERVAL, +}; + +HRESULT set_task_timer(HTMLInnerWindow*,LONG,enum timer_type,IDispatch*,LONG*) DECLSPEC_HIDDEN; HRESULT clear_task_timer(HTMLInnerWindow*,DWORD) DECLSPEC_HIDDEN;
BOOL parse_compat_version(const WCHAR*,compat_mode_t*) DECLSPEC_HIDDEN; diff --git a/dlls/mshtml/task.c b/dlls/mshtml/task.c index f9d06407fb3..c26f3754fd4 100644 --- a/dlls/mshtml/task.c +++ b/dlls/mshtml/task.c @@ -41,6 +41,7 @@ typedef struct { DWORD id; DWORD time; DWORD interval; + enum timer_type type; IDispatch *disp;
struct list entry; @@ -162,7 +163,7 @@ static BOOL queue_timer(thread_data_t *thread_data, task_timer_t *timer) return FALSE; }
-HRESULT set_task_timer(HTMLInnerWindow *window, LONG msec, BOOL interval, IDispatch *disp, LONG *id) +HRESULT set_task_timer(HTMLInnerWindow *window, LONG msec, enum timer_type timer_type, IDispatch *disp, LONG *id) { thread_data_t *thread_data; task_timer_t *timer; @@ -184,7 +185,8 @@ HRESULT set_task_timer(HTMLInnerWindow *window, LONG msec, BOOL interval, IDispa timer->id = id_cnt++; timer->window = window; timer->time = tc + msec; - timer->interval = interval ? msec : 0; + timer->interval = timer_type == TIMER_INTERVAL ? msec : 0; + timer->type = timer_type; list_init(&timer->entry);
IDispatch_AddRef(disp);