mshtml: Factor out get_time_stamp helper.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8b6a3f554a
commit
37a2368703
|
@ -2208,12 +2208,8 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent, compat_mode_t compat_mode, ev
|
||||||
{
|
{
|
||||||
dispex_static_data_t *dispex_data = &DOMEvent_dispex;
|
dispex_static_data_t *dispex_data = &DOMEvent_dispex;
|
||||||
DOMEvent *event = NULL;
|
DOMEvent *event = NULL;
|
||||||
FILETIME time;
|
|
||||||
nsresult nsres;
|
nsresult nsres;
|
||||||
|
|
||||||
/* 1601 to 1970 is 369 years plus 89 leap days */
|
|
||||||
const ULONGLONG time_epoch = (ULONGLONG)(369 * 365 + 89) * 86400 * 1000;
|
|
||||||
|
|
||||||
if(check_event_iface(nsevent, &IID_nsIDOMCustomEvent)) {
|
if(check_event_iface(nsevent, &IID_nsIDOMCustomEvent)) {
|
||||||
DOMCustomEvent *custom_event = heap_alloc_zero(sizeof(*custom_event));
|
DOMCustomEvent *custom_event = heap_alloc_zero(sizeof(*custom_event));
|
||||||
if(!custom_event)
|
if(!custom_event)
|
||||||
|
@ -2247,9 +2243,7 @@ static DOMEvent *alloc_event(nsIDOMEvent *nsevent, compat_mode_t compat_mode, ev
|
||||||
}
|
}
|
||||||
nsIDOMEvent_AddRef(event->nsevent = nsevent);
|
nsIDOMEvent_AddRef(event->nsevent = nsevent);
|
||||||
|
|
||||||
GetSystemTimeAsFileTime(&time);
|
event->time_stamp = get_time_stamp();
|
||||||
event->time_stamp = (((ULONGLONG)time.dwHighDateTime<<32) + time.dwLowDateTime) / 10000
|
|
||||||
- time_epoch;
|
|
||||||
|
|
||||||
nsres = nsIDOMEvent_QueryInterface(nsevent, &IID_nsIDOMUIEvent, (void**)&event->ui_event);
|
nsres = nsIDOMEvent_QueryInterface(nsevent, &IID_nsIDOMUIEvent, (void**)&event->ui_event);
|
||||||
if(NS_SUCCEEDED(nsres))
|
if(NS_SUCCEEDED(nsres))
|
||||||
|
|
|
@ -1212,6 +1212,7 @@ HWND get_thread_hwnd(void) DECLSPEC_HIDDEN;
|
||||||
LONG get_task_target_magic(void) DECLSPEC_HIDDEN;
|
LONG get_task_target_magic(void) DECLSPEC_HIDDEN;
|
||||||
HRESULT push_task(task_t*,task_proc_t,task_proc_t,LONG) DECLSPEC_HIDDEN;
|
HRESULT push_task(task_t*,task_proc_t,task_proc_t,LONG) DECLSPEC_HIDDEN;
|
||||||
void remove_target_tasks(LONG) DECLSPEC_HIDDEN;
|
void remove_target_tasks(LONG) DECLSPEC_HIDDEN;
|
||||||
|
ULONGLONG get_time_stamp(void) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
enum timer_type {
|
enum timer_type {
|
||||||
TIMER_TIMEOUT,
|
TIMER_TIMEOUT,
|
||||||
|
|
|
@ -380,3 +380,14 @@ thread_data_t *get_thread_data(BOOL create)
|
||||||
|
|
||||||
return thread_data;
|
return thread_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ULONGLONG get_time_stamp(void)
|
||||||
|
{
|
||||||
|
FILETIME time;
|
||||||
|
|
||||||
|
/* 1601 to 1970 is 369 years plus 89 leap days */
|
||||||
|
const ULONGLONG time_epoch = (ULONGLONG)(369 * 365 + 89) * 86400 * 1000;
|
||||||
|
|
||||||
|
GetSystemTimeAsFileTime(&time);
|
||||||
|
return (((ULONGLONG)time.dwHighDateTime << 32) + time.dwLowDateTime) / 10000 - time_epoch;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue