<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>76737</bug_id>
          
          <creation_ts>2012-01-20 13:59:49 -0800</creation_ts>
          <short_desc>Allow delayed DC allocation in HWndDC.</short_desc>
          <delta_ts>2012-01-23 18:03:40 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Platform</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows Vista</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>76303</blocked>
    
    <blocked>76889</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="David Levin">levin</reporter>
          <assigned_to name="David Levin">levin</assigned_to>
          <cc>aroben</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>dimich</cc>
    
    <cc>dslomov</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>539771</commentid>
    <comment_count>0</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2012-01-20 13:59:49 -0800</bug_when>
    <thetext>See summary.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539776</commentid>
    <comment_count>1</comment_count>
      <attachid>123375</attachid>
    <who name="David Levin">levin</who>
    <bug_when>2012-01-20 14:04:36 -0800</bug_when>
    <thetext>Created attachment 123375
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539777</commentid>
    <comment_count>2</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2012-01-20 14:06:30 -0800</bug_when>
    <thetext>I&apos;ll gladly accept a review from anyone who will provide one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539779</commentid>
    <comment_count>3</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-01-20 14:08:13 -0800</bug_when>
    <thetext>Attachment 123375 did not pass style-queue:

Failed to run &quot;[&apos;Tools/Scripts/check-webkit-style&apos;, &apos;--diff-files&apos;, u&apos;Source/WebCore/ChangeLog&apos;, u&apos;Source/WebCor...&quot; exit_code: 1

Source/WebCore/platform/win/HWndDC.h:64:  Use the class HWndDC instead of calling GetDC to avoid potential memory leaks.  [runtime/leaky_pattern] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539849</commentid>
    <comment_count>4</comment_count>
      <attachid>123375</attachid>
    <who name="Dmitry Lomov">dslomov</who>
    <bug_when>2012-01-20 15:28:18 -0800</bug_when>
    <thetext>Comment on attachment 123375
Patch

Looks good to me. Any usages in the code?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539851</commentid>
    <comment_count>5</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2012-01-20 15:29:47 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 123375 [details])
&gt; Looks good to me. Any usages in the code?

See the last patch in https://bugs.webkit.org/show_bug.cgi?id=76303 I was asked to make it into smaller patches so this is part of my attempt to do so.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>540568</commentid>
    <comment_count>6</comment_count>
      <attachid>123375</attachid>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2012-01-23 08:38:42 -0800</bug_when>
    <thetext>Comment on attachment 123375
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=123375&amp;action=review

&gt; Source/WebCore/platform/win/HWndDC.h:37
&gt; +    explicit HWndDC()

&quot;explicit&quot; is only needed for constructs that have one (and only one) required parameter.

&gt; Source/WebCore/platform/win/HWndDC.h:60
&gt; +    HDC changeWindowDC(HWND hwnd)

&quot;changeWindowDC&quot; sounds like a function that takes an HDC, not an HWND. Maybe &quot;setHwnd&quot; would be a clearer name?

&gt; Source/WebCore/platform/win/HWndDC.h:68
&gt; +    void clearDC()

I think this could just be called &quot;clear&quot;. It would be nice if &quot;myHwndDC = nullptr&quot; did the same thing as &quot;myHwndDC.clear()&quot;, to match classes like RefPtr and OwnPtr.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>540572</commentid>
    <comment_count>7</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2012-01-23 08:41:52 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; (From update of attachment 123375 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=123375&amp;action=review
&gt;
&gt; &gt; Source/WebCore/platform/win/HWndDC.h:68
&gt; &gt; +    void clearDC()
&gt; 
&gt; I think this could just be called &quot;clear&quot;. It would be nice if &quot;myHwndDC = nullptr&quot; did the same thing as &quot;myHwndDC.clear()&quot;, to match classes like RefPtr and OwnPtr.

My concern with this is that I don&apos;t know what the operator= should do if it isn&apos;t a nullptr. Maybe I could make it only work for nullptr.... I&apos;ll have to try to figure that out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>540963</commentid>
    <comment_count>8</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2012-01-23 16:37:03 -0800</bug_when>
    <thetext>Committed as http://trac.webkit.org/changeset/105656

Addressed everything except I didn&apos;t add the operator= for now. It wouldn&apos;t be used anywhere in my current set of changes anyway. We could add it later if it becomes important.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>123375</attachid>
            <date>2012-01-20 14:04:36 -0800</date>
            <delta_ts>2012-01-23 08:38:42 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-76737-20120120140435.patch</filename>
            <type>text/plain</type>
            <size>2052</size>
            <attacher name="David Levin">levin</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTA1MTkxCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggOTVkZDk4NWJkMTY3NTE5
YmEyODVjZWNhZmFkNzY0MzI4OGExNWJhYS4uYjk0MmJmMmJlMzVjNGE5MDRlMWI5NzVhNzVkMDBi
ZTYzMDRkZmZiZSAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDIxIEBACisyMDEyLTAxLTE4ICBEYXZp
ZCBMZXZpbiAgPGxldmluQGNocm9taXVtLm9yZz4KKworICAgICAgICBBbGxvdyBkZWxheWVkIERD
IGFsbG9jYXRpb24gaW4gSFduZERDLgorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9z
aG93X2J1Zy5jZ2k/aWQ9NzY3MzcKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMh
KS4KKworICAgICAgICBObyBuZXcgZnVuY3Rpb25hbGl0eSBleHBvc2VkIHNvIG5vIG5ldyB0ZXN0
cy4KKworICAgICAgICAqIHBsYXRmb3JtL3dpbi9IV25kREMuaDogQ2hhbmdlZCB0aGlzIHNsaWdo
dGx5IHRvIGFsbG93CisgICAgICAgIGZvciBhbGxvY2F0aW5nIGEgd2luZG93IERDIGFmdGVyIHRo
ZSBpbml0aWFsIGNyZWF0aW9uIHNpbmNlCisgICAgICAgIHRoaXMgcGF0dGVybiBvY2N1cnJzIGlu
IHNldmVyYWwgcGxhY2VzIHNvIHRoaXMgbWFrZXMgaXQgZWFzeSB0bworICAgICAgICByZXBsYWNl
IHRoZW0gaW4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aHduZCkpCkBAIC00OCw4ICs1
NCwyNCBAQCBwdWJsaWM6CiAKICAgICB+SFduZERDKCkKICAgICB7Ci0gICAgICAgIGlmIChtX2hk
YykKLSAgICAgICAgICAgIDo6UmVsZWFzZURDKG1faHduZCwgbV9oZGMpOworICAgICAgICBjbGVh
ckRDKCk7CisgICAgfQorCisgICAgSERDIGNoYW5nZVdpbmRvd0RDKEhXTkQgaHduZCkKKyAgICB7
CisgICAgICAgIGNsZWFyREMoKTsKKyAgICAgICAgbV9od25kID0gaHduZDsKKyAgICAgICAgbV9o
ZGMgPSA6OkdldERDKGh3bmQpOworICAgICAgICByZXR1cm4gbV9oZGM7CisgICAgfQorCisgICAg
dm9pZCBjbGVhckRDKCkKKyAgICB7CisgICAgICAgIGlmICghbV9oZGMpCisgICAgICAgICAgICBy
ZXR1cm47CisgICAgICAgIDo6UmVsZWFzZURDKG1faHduZCwgbV9oZGMpOworICAgICAgICBtX2h3
bmQgPSAwOworICAgICAgICBtX2hkYyA9IDA7CiAgICAgfQogCiAgICAgb3BlcmF0b3IgSERDKCkK
</data>
<flag name="review"
          id="124415"
          type_id="1"
          status="+"
          setter="aroben"
    />
    <flag name="commit-queue"
          id="124417"
          type_id="3"
          status="-"
          setter="aroben"
    />
          </attachment>
      

    </bug>

</bugzilla>