[windows] Convert usages of GetDC to HWndDC Part 2.
authorlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 01:31:05 +0000 (01:31 +0000)
committerlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Jan 2012 01:31:05 +0000 (01:31 +0000)
commit691549bbcf53f61ad4644043f9bf8872a7dd089b
tree559e0db1dff8278b19dddc2ee5be8cf132ee3090
parentd24c6be642085dcc83edd3c2e1c1bb6393c1a234
[windows] Convert usages of GetDC to HWndDC Part 2.
https://bugs.webkit.org/show_bug.cgi?id=76750

Reviewed by Adam Roben.

Source/WebKit/win:

* FullscreenVideoController.cpp:
(createCompatibleDCForWindow): Moved out the code which creates a DC for a window
to keep the same scope for the DC lifetime.
(FullscreenVideoController::draw):  Switch to using OwnPtr<HDC>
since createCompatibleDCForWindow returns a PassOwnPtr.
* WebNodeHighlight.cpp:
(WebNodeHighlight::update):
  Cleaned up leaks from calling GetDC without release.
  Note that there is a potential leak of hdc that previously existed
  and still does in an early exit scenario. (This could be easily fixed
  by using OwnPtr<HDC> but I was trying to keep this patch focused.)
* WebView.cpp:
(WebView::scrollBackingStore): Typical conversion.
(WebView::updateBackingStore): Reduced the scope of windowDC to be
right where it is being used.
(WebView::performLayeredWindowUpdate): Typical conversion.
(WebView::paintIntoBackingStore): Ditto.

Source/WebKit2:

* Shared/win/ShareableBitmapWin.cpp:
(WebKit::ShareableBitmap::windowsContext): Fix incorrect usage of OwnPtr<HDC> which
would do a DeleteDC instead of a ReleaseDC.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105667 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/win/ChangeLog
Source/WebKit/win/FullscreenVideoController.cpp
Source/WebKit/win/WebNodeHighlight.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/win/ShareableBitmapWin.cpp