Bug 76303

Summary: [Windows] Convert usage of GetDC to HWndDC.
Product: WebKit Reporter: David Levin <levin>
Component: PlatformAssignee: David Levin <levin>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, ddkilzer, dslomov, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Windows 7   
Bug Depends on: 76737, 76744, 76750, 76889    
Bug Blocks: 76237    
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description David Levin 2012-01-13 13:28:46 PST
I'm not touching the wince, wx, qt, or Cairo ports (because I worry about breaking them and not having lots of time to solve it -- with having to install lots of other stuff, etc.)
Comment 1 David Levin 2012-01-13 14:19:41 PST
Created attachment 122502 [details]
Patch
Comment 2 David Levin 2012-01-13 14:20:17 PST
Adding folks whom I believe work on Windows.
Comment 3 Adam Roben (:aroben) 2012-01-17 08:34:17 PST
Why is this patch obsolete?
Comment 4 David Levin 2012-01-17 08:45:24 PST
(In reply to comment #3)
> Why is this patch obsolete?

Two reasons:
1.I moved the header file.
2. I decided that I hated the OwnPtr thing I did and wanted to make delayed allocation part of the class itself.
Comment 5 David Levin 2012-01-17 15:07:53 PST
Created attachment 122821 [details]
Patch
Comment 6 WebKit Review Bot 2012-01-17 15:10:14 PST
Attachment 122821 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp:812:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebCore/platform/win/HWndDC.h:64:  Use the class HWndDC instead of calling GetDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebKit/win/FullscreenVideoController.cpp:489:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebCore/platform/win/PopupMenuWin.cpp:571:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebKit2/Shared/win/ShareableBitmapWin.cpp:46:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Total errors found: 5 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 7 David Levin 2012-01-17 15:11:59 PST
(In reply to comment #6)
> Attachment 122821 [details] did not pass style-queue:
> 
> Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
> 
> Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp:812:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
> Source/WebCore/platform/win/HWndDC.h:64:  Use the class HWndDC instead of calling GetDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
> Source/WebKit/win/FullscreenVideoController.cpp:489:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
> Source/WebCore/platform/win/PopupMenuWin.cpp:571:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
> Source/WebKit2/Shared/win/ShareableBitmapWin.cpp:46:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
> Total errors found: 5 in 21 files
> 


Some are because I'm not changing over more things in this patch and a few point out the need for me to fix the style checker to look for adoptPtr instead of OwnPtr when looking for the leaky pattern.

Filed: https://bugs.webkit.org/show_bug.cgi?id=76483
Comment 8 David Levin 2012-01-18 15:15:27 PST
Created attachment 123007 [details]
Patch
Comment 9 David Levin 2012-01-18 15:16:50 PST
(In reply to comment #3)
> Why is this patch obsolete?

It is good now. Please feel free to review it :).
Comment 10 WebKit Review Bot 2012-01-18 15:19:04 PST
Attachment 123007 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp:812:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebCore/platform/win/HWndDC.h:64:  Use the class HWndDC instead of calling GetDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebKit/win/FullscreenVideoController.cpp:489:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebCore/platform/win/PopupMenuWin.cpp:571:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebKit2/Shared/win/ShareableBitmapWin.cpp:46:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Total errors found: 5 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 11 David Levin 2012-01-18 21:51:19 PST
Created attachment 123072 [details]
Patch
Comment 12 WebKit Review Bot 2012-01-18 21:53:27 PST
Attachment 123072 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1

Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp:812:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebCore/platform/win/HWndDC.h:64:  Use the class HWndDC instead of calling GetDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebKit/win/FullscreenVideoController.cpp:489:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebCore/platform/win/PopupMenuWin.cpp:571:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Source/WebKit2/Shared/win/ShareableBitmapWin.cpp:46:  Use OwnPtr<HDC> when calling CreateCompatibleDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Total errors found: 5 in 21 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 13 David Levin 2012-01-19 01:39:56 PST
Comment on attachment 123072 [details]
Patch

cq? since it builds fine on Windows now.
Comment 14 David Levin 2012-01-20 13:11:06 PST
Comment on attachment 123072 [details]
Patch

Will break into smaller patches especially for functionality changes.
Comment 15 David Levin 2012-01-24 09:58:43 PST
As soon as the last patch goes through the commit queue this is done.