RESOLVED FIXED 76235
HwndDC is a better name than OwnGetDC.
https://bugs.webkit.org/show_bug.cgi?id=76235
Summary HwndDC is a better name than OwnGetDC.
David Levin
Reported 2012-01-12 17:34:04 PST
Based on feedback in https://bugs.webkit.org/show_bug.cgi?id=76227#c2 and subsequent discussion.
Attachments
Patch (7.73 KB, patch)
2012-01-12 17:35 PST, David Levin
no flags
Patch (8.17 KB, patch)
2012-01-12 18:19 PST, David Levin
no flags
David Levin
Comment 1 2012-01-12 17:35:35 PST
Dmitry Lomov
Comment 2 2012-01-12 17:46:56 PST
Comment on attachment 122349 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=122349&action=review Looks good. > Source/WebKit/chromium/src/win/WebScreenInfoFactory.cpp:65 > + HwndDC hdc(0); Probably makes sense to make a pass and replace more usages of ::GetDC with this new class.
David Levin
Comment 3 2012-01-12 18:19:38 PST
Dmitry Titov
Comment 4 2012-01-12 18:29:37 PST
Comment on attachment 122355 [details] Patch r=me, I understand there is a separate bug filed to follow up on Dmitry's suggestion to comb the files for other usages of ::GetDC()
WebKit Review Bot
Comment 5 2012-01-12 20:44:23 PST
Comment on attachment 122355 [details] Patch Clearing flags on attachment: 122355 Committed r104895: <http://trac.webkit.org/changeset/104895>
WebKit Review Bot
Comment 6 2012-01-12 20:44:28 PST
All reviewed patches have been landed. Closing bug.
Darin Adler
Comment 7 2012-01-13 09:04:32 PST
Since HWND is “handle to window”, I think it should be HWnd, when things are mixed case, not Hwnd.
David Levin
Comment 8 2012-01-13 09:32:51 PST
(In reply to comment #7) > Since HWND is “handle to window”, I think it should be HWnd, when things are mixed case, not Hwnd. Patch: https://bugs.webkit.org/show_bug.cgi?id=76281
Sam Weinig
Comment 9 2012-01-13 12:56:06 PST
I have two concerns with this patch: 1) It is missing a header guard. 2) I don't think WTF is the right layer for it. It might fit nicely in WebCore/platform though.
David Levin
Comment 10 2012-01-13 13:01:16 PST
(In reply to comment #9) > I have two concerns with this patch: > > 1) It is missing a header guard. Of course :( > 2) I don't think WTF is the right layer for it. It might fit nicely in WebCore/platform though. I'm fine with its 3rd move (OwnGetDC->HwndDC -> HWndDC -> platform/win/HWndDC). However, it feels odd to me that we have OwnPtr<HDC> in the wtf layer (which works for Create*DC) but avoid the thing that can own a GetDC result.
David Levin
Comment 11 2012-01-13 13:18:02 PST
(In reply to comment #10) > (In reply to comment #9) > > I have two concerns with this patch: > > > > 1) It is missing a header guard. > > Of course :( Fixed http://trac.webkit.org/changeset/104976 Waiting on #2 based on your thoughts (and I might land a few other patches first and then do the file move since I already have them done).
Sam Weinig
Comment 12 2012-01-13 13:50:07 PST
(In reply to comment #10) > (In reply to comment #9) > > I have two concerns with this patch: > > > > 1) It is missing a header guard. > > Of course :( > > > 2) I don't think WTF is the right layer for it. It might fit nicely in WebCore/platform though. > > I'm fine with its 3rd move (OwnGetDC->HwndDC -> HWndDC -> platform/win/HWndDC). > > However, it feels odd to me that we have OwnPtr<HDC> in the wtf layer (which works for Create*DC) but avoid the thing that can own a GetDC result. Memory management smart pointers have always had an odd relationship with WTF, nevertheless I still think this one should move up to platform/win.
David Levin
Comment 13 2012-01-13 15:25:39 PST
(In reply to comment #12) > Memory management smart pointers have always had an odd relationship with WTF, nevertheless I still think this one should move up to platform/win. Patch: https://bugs.webkit.org/show_bug.cgi?id=76314
Darin Adler
Comment 14 2012-01-16 16:10:49 PST
(In reply to comment #10) > However, it feels odd to me that we have OwnPtr<HDC> in the wtf layer That is a mistake I made. I don’t think we should be using OwnPtr for things that aren't simple new/delete, but I couldn’t resist expanding it for various Windows handle types. I suppose there’s more to be said on the subject, but that’s the basics.
Note You need to log in before you can comment on or make changes to this bug.