RESOLVED FIXED 76781
Port RunLoop to WinCE
https://bugs.webkit.org/show_bug.cgi?id=76781
Summary Port RunLoop to WinCE
Patrick R. Gansterer
Reported 2012-01-21 04:40:33 PST
Port RunLoop to WinCE
Attachments
Patch (2.84 KB, patch)
2012-01-21 04:42 PST, Patrick R. Gansterer
no flags
Patch (1.32 KB, patch)
2012-02-10 02:55 PST, Patrick R. Gansterer
no flags
Patrick R. Gansterer
Comment 1 2012-01-21 04:42:26 PST
Adam Roben (:aroben)
Comment 2 2012-01-23 08:23:44 PST
Comment on attachment 123445 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=123445&action=review > Source/WebCore/platform/win/RunLoopWin.cpp:44 > +#if OS(WINCE) > + LONG longPtr = ::GetWindowLong(hWnd, 0); > +#else > LONG_PTR longPtr = ::GetWindowLongPtr(hWnd, 0); > - > +#endif Maybe we should take a different approach here. wtf/MathExtras.h and wtf/StringExtras.h have shim functions that provide compatibility between various compilers/runtimes. Maybe we should have a WindowsExtras.h (maybe in WTF, maybe in WebCore/platform) that does the same thing to bridge the gap between WinCE and other versions of Windows? For example, WindowsExtras.h could have an inline GetWIndowLongPtr function that is defined only on WinCE that just calls through to GetWindowLong. We could do the same thing for SetWindowLong[Ptr]. And we could even have a WinCE-only HWND_MESSAGE that is just 0. What do you think? Seems like that would make it easier to fix these kinds of issues in the future (by just including WindowsExtras.h).
Patrick R. Gansterer
Comment 3 2012-01-23 11:33:18 PST
(In reply to comment #2) > (From update of attachment 123445 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=123445&action=review > > > Source/WebCore/platform/win/RunLoopWin.cpp:44 > > +#if OS(WINCE) > > + LONG longPtr = ::GetWindowLong(hWnd, 0); > > +#else > > LONG_PTR longPtr = ::GetWindowLongPtr(hWnd, 0); > > - > > +#endif > > Maybe we should take a different approach here. wtf/MathExtras.h and wtf/StringExtras.h have shim functions that provide compatibility between various compilers/runtimes. Maybe we should have a WindowsExtras.h (maybe in WTF, maybe in WebCore/platform) that does the same thing to bridge the gap between WinCE and other versions of Windows? For example, WindowsExtras.h could have an inline GetWIndowLongPtr function that is defined only on WinCE that just calls through to GetWindowLong. We could do the same thing for SetWindowLong[Ptr]. And we could even have a WinCE-only HWND_MESSAGE that is just 0. What do you think? Seems like that would make it easier to fix these kinds of issues in the future (by just including WindowsExtras.h). I'd prefere a solution with WindowsExtras.h too, but I'm not a big fan of "implementing" a function with the same name on WinCE. IMHO a wrapper function witch does the correct stuff for both platform would be better. This function can do the cast to LONG_PTR on Win32 then too. Defining HWND_MESSAGE to 0 should be ok and can be done via an #ifndef HWND_MESSAGE.
Adam Roben (:aroben)
Comment 4 2012-01-23 12:12:48 PST
Comment on attachment 123445 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=123445&action=review >>> Source/WebCore/platform/win/RunLoopWin.cpp:44 >>> +#endif >> >> Maybe we should take a different approach here. wtf/MathExtras.h and wtf/StringExtras.h have shim functions that provide compatibility between various compilers/runtimes. Maybe we should have a WindowsExtras.h (maybe in WTF, maybe in WebCore/platform) that does the same thing to bridge the gap between WinCE and other versions of Windows? For example, WindowsExtras.h could have an inline GetWIndowLongPtr function that is defined only on WinCE that just calls through to GetWindowLong. We could do the same thing for SetWindowLong[Ptr]. And we could even have a WinCE-only HWND_MESSAGE that is just 0. What do you think? Seems like that would make it easier to fix these kinds of issues in the future (by just including WindowsExtras.h). > > I'd prefere a solution with WindowsExtras.h too, but I'm not a big fan of "implementing" a function with the same name on WinCE. IMHO a wrapper function witch does the correct stuff for both platform would be better. This function can do the cast to LONG_PTR on Win32 then too. Defining HWND_MESSAGE to 0 should be ok and can be done via an #ifndef HWND_MESSAGE. What specifically concerns you about implementing GetWindowLongPtr on WinCE? A differently-named-and-typed wrapper function could be good if it made the code clearer; what do you suggest as a name and signature? We tend not to use macros for constants, so I'd recommend a "const HWND HWND_MESSAGE = 0;", similar to constants like piFloat in MathExtras.h.
Patrick R. Gansterer
Comment 5 2012-02-10 02:55:36 PST
WebKit Review Bot
Comment 6 2012-02-13 10:09:10 PST
Comment on attachment 126485 [details] Patch Clearing flags on attachment: 126485 Committed r107585: <http://trac.webkit.org/changeset/107585>
WebKit Review Bot
Comment 7 2012-02-13 10:09:17 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.