<?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>74159</bug_id>
          
          <creation_ts>2011-12-08 20:18:13 -0800</creation_ts>
          <short_desc>Fix HashMap&lt;..., OwnPtr&lt;...&gt; &gt;::add compilation errors</short_desc>
          <delta_ts>2011-12-09 10:59:32 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</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>74154</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Adrienne Walker">enne</reporter>
          <assigned_to name="Adrienne Walker">enne</assigned_to>
          <cc>darin</cc>
    
    <cc>enne</cc>
    
    <cc>jamesr</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>518066</commentid>
    <comment_count>0</comment_count>
    <who name="Adrienne Walker">enne</who>
    <bug_when>2011-12-08 20:18:13 -0800</bug_when>
    <thetext>Fix HashMap&lt;..., OwnPtr&lt;...&gt; &gt;::add compilation errors</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518073</commentid>
    <comment_count>1</comment_count>
      <attachid>118521</attachid>
    <who name="Adrienne Walker">enne</who>
    <bug_when>2011-12-08 20:34:12 -0800</bug_when>
    <thetext>Created attachment 118521
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518075</commentid>
    <comment_count>2</comment_count>
    <who name="Adrienne Walker">enne</who>
    <bug_when>2011-12-08 20:37:21 -0800</bug_when>
    <thetext>When I saw Adam&apos;s fix for bug 73964, I thought I&apos;d take advantage of using an OwnPtr as the value for a HashMap in CCLayerTilingData.  When I did this (see patch in bug 74154), I got the following compilation error:

/usr/include/c++/4.4/bits/stl_pair.h: In constructor &apos;std::pair&lt;_T1, _T2&gt;::pair(const std::pair&lt;_U1, _U2&gt;&amp;) [with _U1 = std::pair&lt;int, int&gt;, _U2 = std::nullptr_t, _T1 = std::pair&lt;int, int&gt;, _T2 = WTF::OwnPtr&lt;WebCore::CCLayerTilingData::Tile&gt;]&apos;:

/usr/include/c++/4.4/bits/stl_pair.h:101: error: no matching function for call to &apos;WTF::OwnPtr&lt;WebCore::CCLayerTilingData::Tile&gt;::OwnPtr(const std::nullptr_t&amp;)&apos;

So, I added this missing function to OwnPtr.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518336</commentid>
    <comment_count>3</comment_count>
      <attachid>118521</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-12-09 10:37:40 -0800</bug_when>
    <thetext>Comment on attachment 118521
Patch

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

&gt; Source/JavaScriptCore/wtf/OwnPtr.h:44
&gt; +        explicit OwnPtr(const std::nullptr_t&amp;) : m_ptr(0) { }

I see no reason for this to be explicit.

This might work for some compilers, but with others I fear it may break the build. The EWS seems to like it OK.

Since you did not include the entire error, I cannot be sure, but I suspect there may be a way to resolve this entirely in HashTraits.h. For example, it may be a simple matter of overloading some function to take a nullptr_t.

I am not going to say review+ yet because of the “explicit” issue and the fact that I’d like to see the rest of the error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518337</commentid>
    <comment_count>4</comment_count>
      <attachid>118521</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2011-12-09 10:40:17 -0800</bug_when>
    <thetext>Comment on attachment 118521
Patch

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

r=me, but please land my revised version

&gt;&gt; Source/JavaScriptCore/wtf/OwnPtr.h:44
&gt;&gt; +        explicit OwnPtr(const std::nullptr_t&amp;) : m_ptr(0) { }
&gt; 
&gt; I see no reason for this to be explicit.
&gt; 
&gt; This might work for some compilers, but with others I fear it may break the build. The EWS seems to like it OK.
&gt; 
&gt; Since you did not include the entire error, I cannot be sure, but I suspect there may be a way to resolve this entirely in HashTraits.h. For example, it may be a simple matter of overloading some function to take a nullptr_t.
&gt; 
&gt; I am not going to say review+ yet because of the “explicit” issue and the fact that I’d like to see the rest of the error.

I changed my mind about all the rest of my comment. This is a good change.

But we should not use “explicit” here. It’s good and helpful to allow implicit conversion from nullptr_t to OwnPtr.

It should read:

    OwnPtr(std::nullptr_t) : m_ptr(0) { }

There is no reason to use const std::nullptr_t&amp; instead of just std::nullptr_t. See PassOwnPtr, which already has this constructor.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518340</commentid>
    <comment_count>5</comment_count>
    <who name="Adrienne Walker">enne</who>
    <bug_when>2011-12-09 10:44:53 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt;
&gt; It should read:
&gt; 
&gt;     OwnPtr(std::nullptr_t) : m_ptr(0) { }
&gt; 
&gt; There is no reason to use const std::nullptr_t&amp; instead of just std::nullptr_t. See PassOwnPtr, which already has this constructor.

Thanks--both of those changes make a lot of sense.  I&apos;ll land it exactly as above.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>518347</commentid>
    <comment_count>6</comment_count>
    <who name="Adrienne Walker">enne</who>
    <bug_when>2011-12-09 10:59:32 -0800</bug_when>
    <thetext>Committed r102459: &lt;http://trac.webkit.org/changeset/102459&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>118521</attachid>
            <date>2011-12-08 20:34:12 -0800</date>
            <delta_ts>2011-12-09 10:40:17 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-74159-20111208203411.patch</filename>
            <type>text/plain</type>
            <size>1392</size>
            <attacher name="Adrienne Walker">enne</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTAyNDExCmRpZmYgLS1naXQgYS9Tb3VyY2UvSmF2YVNjcmlw
dENvcmUvQ2hhbmdlTG9nIGIvU291cmNlL0phdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwppbmRleCBh
ZGE5OTQwMTNlOWYwMDIwNzY3N2Y1YWE1YWRmOGUxYWEwMjQ2MTRhLi4yYzFiNmU5MmU1YmM1MjU0
NjM0YWIyYmMwZWFkMjY5ZjQyOTljZGZhIDEwMDY0NAotLS0gYS9Tb3VyY2UvSmF2YVNjcmlwdENv
cmUvQ2hhbmdlTG9nCisrKyBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cKQEAgLTEs
MyArMSwxNiBAQAorMjAxMS0xMi0wOCAgQWRyaWVubmUgV2Fsa2VyICA8ZW5uZUBnb29nbGUuY29t
PgorCisgICAgICAgIEZpeCBIYXNoTWFwPC4uLiwgT3duUHRyPC4uLj4gPjo6YWRkIGNvbXBpbGF0
aW9uIGVycm9ycworICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/
aWQ9NzQxNTkKKworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAg
ICBBZGQgYSBjb25zdHJ1Y3RvciB0byBPd25QdHIgdGhhdCB0YWtlcyB0aGUgZW1wdHkgdmFsdWUg
KG51bGxwdHJfdCkKKyAgICAgICAgZnJvbSBIYXNoVHJhaXRzIHNvIHRoYXQgdGhpcyBmdW5jdGlv
biBjYW4gY29tcGlsZS4KKworICAgICAgICAqIHd0Zi9Pd25QdHIuaDoKKyAgICAgICAgKFdURjo6
T3duUHRyOjpPd25QdHIpOgorCiAyMDExLTEyLTA4ICBBZGFtIEtsZWluICA8YWRhbWtAY2hyb21p
dW0ub3JnPgogCiAgICAgICAgIFVzZSBIYXNoTWFwPE5vZGUqLCBPd25QdHI8Li4uPj4gaW4gQ2hp
bGRMaXN0TXV0YXRpb25TY29wZQpkaWZmIC0tZ2l0IGEvU291cmNlL0phdmFTY3JpcHRDb3JlL3d0
Zi9Pd25QdHIuaCBiL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS93dGYvT3duUHRyLmgKaW5kZXggMzEx
NDM1NWE4MGE5YjhhOGNiY2QwNTg3ZGU2NDc4MzExNzYwNzJkYS4uYzNlZjQ0ZmRjOWY4ZTczYmE3
YzRhMTg5NmNlYjQ0NDFhZWM1YTViNyAxMDA2NDQKLS0tIGEvU291cmNlL0phdmFTY3JpcHRDb3Jl
L3d0Zi9Pd25QdHIuaAorKysgYi9Tb3VyY2UvSmF2YVNjcmlwdENvcmUvd3RmL093blB0ci5oCkBA
IC00MSw2ICs0MSw3IEBAIG5hbWVzcGFjZSBXVEYgewogICAgICAgICB0eXBlZGVmIFZhbHVlVHlw
ZSogUHRyVHlwZTsKIAogICAgICAgICBPd25QdHIoKSA6IG1fcHRyKDApIHsgfQorICAgICAgICBl
eHBsaWNpdCBPd25QdHIoY29uc3Qgc3RkOjpudWxscHRyX3QmKSA6IG1fcHRyKDApIHsgfQogCiAg
ICAgICAgIC8vIFNlZSBjb21tZW50IGluIFBhc3NPd25QdHIuaCBmb3Igd2h5IHRoaXMgdGFrZXMg
YSBjb25zdCByZWZlcmVuY2UuCiAgICAgICAgIHRlbXBsYXRlPHR5cGVuYW1lIFU+IE93blB0cihj
b25zdCBQYXNzT3duUHRyPFU+JiBvKTsK
</data>
<flag name="review"
          id="118292"
          type_id="1"
          status="+"
          setter="darin"
    />
          </attachment>
      

    </bug>

</bugzilla>