Changeset 141248 in webkit
- Timestamp:
- Jan 30, 2013 3:58:08 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141245 r141248 1 2013-01-30 Patrick Gansterer <paroga@webkit.org> 2 3 Port SharedTimerWin.cpp to WinCE 4 https://bugs.webkit.org/show_bug.cgi?id=103724 5 6 Reviewed by Brent Fulgham. 7 8 Add #if !OS(WINCE) around some parts of the code, so it can be used by the WinCE port too. 9 10 * PlatformWinCE.cmake: 11 * platform/win/SharedTimerWin.cpp: 12 (WebCore): 13 (WebCore::TimerWindowWndProc): 14 (WebCore::initializeOffScreenTimerWindow): 15 (WebCore::setSharedTimerFireInterval): 16 (WebCore::stopSharedTimer): 17 * platform/wince/SharedTimerWinCE.cpp: Removed. 18 1 19 2013-01-30 Andrey Lushnikov <lushnikov@chromium.org> 2 20 -
trunk/Source/WebCore/PlatformWinCE.cmake
r136790 r141248 54 54 platform/win/SearchPopupMenuWin.cpp 55 55 platform/win/SharedBufferWin.cpp 56 platform/win/SharedTimerWin.cpp 56 57 platform/win/SoundWin.cpp 57 58 platform/win/SystemInfo.cpp … … 65 66 platform/wince/FileSystemWince.cpp 66 67 platform/wince/KURLWince.cpp 67 platform/wince/SharedTimerWince.cpp68 68 69 69 platform/network/win/CredentialStorageWin.cpp -
trunk/Source/WebCore/platform/win/SharedTimerWin.cpp
r91206 r141248 41 41 #endif 42 42 43 #include <windows.h>43 #include "WindowsExtras.h" 44 44 #include <mmsystem.h> 45 45 … … 67 67 static void (*sharedTimerFiredFunction)(); 68 68 69 static HANDLE timer; 69 70 static HWND timerWindowHandle = 0; 71 const LPCWSTR kTimerWindowClassName = L"TimerWindowClass"; 72 73 #if !OS(WINCE) 70 74 static UINT timerFiredMessage = 0; 71 75 static HANDLE timerQueue; 72 static HANDLE timer;73 76 static bool highResTimerActive; 74 77 static bool processingCustomTimerMessage = false; 75 78 static LONG pendingTimers; 76 79 77 const LPCWSTR kTimerWindowClassName = L"TimerWindowClass";78 80 const int timerResolution = 1; // To improve timer resolution, we call timeBeginPeriod/timeEndPeriod with this value to increase timer resolution to 1ms. 79 81 const int highResolutionThresholdMsec = 16; // Only activate high-res timer for sub-16ms timers (Windows can fire timers at 16ms intervals without changing the system resolution). 80 82 const int stopHighResTimerInMsec = 300; // Stop high-res timer after 0.3 seconds to lessen power consumption (we don't use a smaller time since oscillating between high and low resolution breaks timer accuracy on XP). 83 #endif 81 84 82 85 enum { … … 98 101 #endif 99 102 100 if (message == timerFiredMessage) { 103 if (message == WM_TIMER) { 104 if (wParam == sharedTimerID) { 105 KillTimer(timerWindowHandle, sharedTimerID); 106 sharedTimerFiredFunction(); 107 } 108 #if !OS(WINCE) 109 else if (wParam == endHighResTimerID) { 110 KillTimer(timerWindowHandle, endHighResTimerID); 111 highResTimerActive = false; 112 timeEndPeriod(timerResolution); 113 } 114 } else if (message == timerFiredMessage) { 101 115 InterlockedExchange(&pendingTimers, 0); 102 116 processingCustomTimerMessage = true; 103 117 sharedTimerFiredFunction(); 104 118 processingCustomTimerMessage = false; 105 } else if (message == WM_TIMER) { 106 if (wParam == sharedTimerID) { 107 KillTimer(timerWindowHandle, sharedTimerID); 108 sharedTimerFiredFunction(); 109 } else if (wParam == endHighResTimerID) { 110 KillTimer(timerWindowHandle, endHighResTimerID); 111 highResTimerActive = false; 112 timeEndPeriod(timerResolution); 113 } 119 #endif 114 120 } else 115 121 return DefWindowProc(hWnd, message, wParam, lParam); … … 122 128 if (timerWindowHandle) 123 129 return; 124 130 131 #if OS(WINCE) 132 WNDCLASS wcex; 133 memset(&wcex, 0, sizeof(WNDCLASS)); 134 #else 125 135 WNDCLASSEX wcex; 126 136 memset(&wcex, 0, sizeof(WNDCLASSEX)); 127 137 wcex.cbSize = sizeof(WNDCLASSEX); 138 #endif 139 128 140 wcex.lpfnWndProc = TimerWindowWndProc; 129 141 wcex.hInstance = WebCore::instanceHandle(); 130 142 wcex.lpszClassName = kTimerWindowClassName; 143 #if OS(WINCE) 144 RegisterClass(&wcex); 145 #else 131 146 RegisterClassEx(&wcex); 147 #endif 132 148 133 149 timerWindowHandle = CreateWindow(kTimerWindowClassName, 0, 0, 134 150 CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, HWND_MESSAGE, 0, WebCore::instanceHandle(), 0); 151 152 #if !OS(WINCE) 135 153 timerFiredMessage = RegisterWindowMessage(L"com.apple.WebKit.TimerFired"); 154 #endif 136 155 } 137 156 … … 141 160 } 142 161 162 #if !OS(WINCE) 143 163 static void NTAPI queueTimerProc(PVOID, BOOLEAN) 144 164 { … … 146 166 PostMessage(timerWindowHandle, timerFiredMessage, 0, 0); 147 167 } 168 #endif 148 169 149 170 void setSharedTimerFireInterval(double interval) … … 161 182 bool timerSet = false; 162 183 184 #if !OS(WINCE) 163 185 if (Settings::shouldUseHighResolutionTimers()) { 164 186 if (interval < highResolutionThresholdMsec) { … … 192 214 } 193 215 } 216 #endif // !OS(WINCE) 194 217 195 218 if (timerSet) { … … 206 229 void stopSharedTimer() 207 230 { 231 #if !OS(WINCE) 208 232 if (timerQueue && timer) { 209 233 DeleteTimerQueueTimer(timerQueue, timer, 0); 210 234 timer = 0; 211 235 } 236 #endif 212 237 213 238 if (timerID) {
Note: See TracChangeset
for help on using the changeset viewer.