Changeset 20267 in webkit
- Timestamp:
- Mar 17, 2007 5:54:44 PM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r20266 r20267 1 2007-03-17 Dave Hyatt <hyatt@apple.com> 2 3 Prevent starvation of user input and painting when processing timers. 4 If we are already in the processing of a custom timer message, don't allow that 5 processing to do another PostMessage. Force SetTimer to be used instead. 6 7 Reviewed by ggaren 8 9 * platform/win/SharedTimerWin.cpp: 10 (WebCore::TimerWindowWndProc): 11 (WebCore::setSharedTimerFireTime): 12 1 13 2007-03-17 Geoffrey Garen <ggaren@apple.com> 2 14 -
trunk/WebCore/platform/win/SharedTimerWin.cpp
r16515 r20267 41 41 static UINT timerFiredMessage = 0; 42 42 const LPCWSTR kTimerWindowClassName = L"TimerWindowClass"; 43 static bool processingCustomTimerMessage = false; 43 44 44 45 LRESULT CALLBACK TimerWindowWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 45 46 { 46 if (message == timerFiredMessage) 47 if (message == timerFiredMessage) { 48 processingCustomTimerMessage = true; 47 49 sharedTimerFiredFunction(); 48 else 50 processingCustomTimerMessage = false; 51 } else 49 52 return DefWindowProc(hWnd, message, wParam, lParam); 50 53 return 0; … … 95 98 } 96 99 97 if (timerID) 100 if (timerID) { 98 101 KillTimer(0, timerID); 102 timerID = 0; 103 } 99 104 100 if (intervalInMS == 0) { 101 timerID = 0; 105 // We don't allow nested PostMessages, since the custom messages will effectively starve 106 // painting and user input. (Win32 has a tri-level queue with application messages > 107 // user input > WM_PAINT/WM_TIMER.) 108 if (intervalInMS < USER_TIMER_MINIMUM && !processingCustomTimerMessage) { 102 109 // Windows SetTimer does not allow timeouts smaller than 10ms (USER_TIMER_MINIMUM) 103 110 initializeOffScreenTimerWindow(); 104 111 PostMessage(timerWindowHandle, timerFiredMessage, 0, 0); 105 112 } else 106 // FIXME: 1-9ms timeouts may fire too late.107 113 timerID = SetTimer(0, 0, intervalInMS, timerFired); 108 114 }
Note: See TracChangeset
for help on using the changeset viewer.