Changeset 104895 in webkit


Ignore:
Timestamp:
Jan 12, 2012 8:44:06 PM (12 years ago)
Author:
levin@chromium.org
Message:

HwndDC is a better name than OwnGetDC.
https://bugs.webkit.org/show_bug.cgi?id=76235

Reviewed by Dmitry Titov.

Source/JavaScriptCore:

This is a better name for two reasons:

  1. "Own" implies "delete". In this case, the final call is a release (ReleaseDC).
  2. "Ref" would be a better name due to the release but the RefPtr (and OwnPtr) classes always take something to hold on to. In this case, the object (the DC) is created by the class once it is given a Window to ensure that the HDC was actually created using GetDC.

(WTF::HwndDC::HwndDC):
(WTF::HwndDC::~HwndDC):
(WTF::HwndDC::operator HDC):

Source/WebKit/chromium:

  • src/win/WebScreenInfoFactory.cpp:

(WebKit::WebScreenInfoFactory::screenInfo):

Location:
trunk/Source
Files:
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r104886 r104895  
     12012-01-12  David Levin  <levin@chromium.org>
     2
     3        HwndDC is a better name than OwnGetDC.
     4        https://bugs.webkit.org/show_bug.cgi?id=76235
     5
     6        Reviewed by Dmitry Titov.
     7
     8        This is a better name for two reasons:
     9        1. "Own" implies "delete". In this case, the final call is a release (ReleaseDC).
     10        2. "Ref" would be a better name due to the release but the RefPtr (and OwnPtr)
     11           classes always take something to hold on to. In this case, the object (the DC)
     12           is created by the class once it is given a Window to ensure that the HDC
     13           was actually created using GetDC.
     14
     15        * JavaScriptCore.gyp/JavaScriptCore.gyp:
     16        * JavaScriptCore.gypi:
     17        * wtf/win/HwndDCWin.h: Renamed from Source/JavaScriptCore/wtf/win/OwnGetDCWin.h.
     18        (WTF::HwndDC::HwndDC):
     19        (WTF::HwndDC::~HwndDC):
     20        (WTF::HwndDC::operator HDC):
     21
    1222012-01-12  Gavin Barraclough  <barraclough@apple.com>
    223
  • trunk/Source/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp

    r104867 r104895  
    174174            ['exclude', 'OSAllocatorPosix\\.cpp$'],
    175175            ['include', 'OSAllocatorWin\\.cpp$'],
    176             ['include', 'win/OwnGetDCWin\\.h$'],
     176            ['include', 'win/HwndDCWin\\.h$'],
    177177          ],
    178178          'include_dirs!': [
  • trunk/Source/JavaScriptCore/JavaScriptCore.gypi

    r104867 r104895  
    649649            'wtf/unicode/wince/UnicodeWinCE.h',
    650650            'wtf/win/MainThreadWin.cpp',
    651             'wtf/win/OwnGetDCWin.h',
     651            'wtf/win/HwndDCWin.h',
    652652            'wtf/win/OwnPtrWin.cpp',
    653653            'wtf/wince/FastMallocWinCE.h',
  • trunk/Source/JavaScriptCore/wtf/win/HwndDCWin.h

    r104894 r104895  
    2828namespace WTF {
    2929
    30 class OwnGetDC {
     30class HwndDC {
    3131public:
    32     explicit OwnGetDC(HWND hwnd)
     32    explicit HwndDC(HWND hwnd)
    3333        : m_hwnd(hwnd)
    3434        , m_hdc(::GetDC(hwnd))
     
    3636    }
    3737
    38     ~OwnGetDC()
     38    ~HwndDC()
    3939    {
    4040        if (m_hdc)
     
    5454}
    5555
    56 using WTF::OwnGetDC;
     56using WTF::HwndDC;
  • trunk/Source/WebKit/chromium/ChangeLog

    r104867 r104895  
     12012-01-12  David Levin  <levin@chromium.org>
     2
     3        HwndDC is a better name than OwnGetDC.
     4        https://bugs.webkit.org/show_bug.cgi?id=76235
     5
     6        Reviewed by Dmitry Titov.
     7
     8        * src/win/WebScreenInfoFactory.cpp:
     9        (WebKit::WebScreenInfoFactory::screenInfo):
     10
    1112012-01-12  David Levin  <levin@chromium.org>
    212
  • trunk/Source/WebKit/chromium/src/win/WebScreenInfoFactory.cpp

    r104867 r104895  
    3434#include "WebScreenInfo.h"
    3535
    36 #include <wtf/win/OwnGetDCWin.h>
     36#include <wtf/win/HwndDCWin.h>
    3737
    3838#include <windows.h>
     
    6363    EnumDisplaySettings(monitorInfo.szDevice, ENUM_CURRENT_SETTINGS, &devMode);
    6464
    65     OwnGetDC hdc(0);
     65    HwndDC hdc(0);
    6666    ASSERT(hdc);
    6767
Note: See TracChangeset for help on using the changeset viewer.