<?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>59151</bug_id>
          
          <creation_ts>2011-04-21 16:07:27 -0700</creation_ts>
          <short_desc>Provide default constructors for HashMap iterators</short_desc>
          <delta_ts>2011-04-22 15:01:46 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Vitaly Repeshko">vitalyr</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>mjs</cc>
    
    <cc>sam</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>390422</commentid>
    <comment_count>0</comment_count>
    <who name="Vitaly Repeshko">vitalyr</who>
    <bug_when>2011-04-21 16:07:27 -0700</bug_when>
    <thetext>[WTF] Provide default constructors for HashMap iterators</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>390430</commentid>
    <comment_count>1</comment_count>
      <attachid>90625</attachid>
    <who name="Vitaly Repeshko">vitalyr</who>
    <bug_when>2011-04-21 16:14:44 -0700</bug_when>
    <thetext>Created attachment 90625
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>390444</commentid>
    <comment_count>2</comment_count>
      <attachid>90625</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-04-21 16:30:05 -0700</bug_when>
    <thetext>Comment on attachment 90625
patch

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

&gt; Source/JavaScriptCore/wtf/HashTable.h:1123
&gt; +        HashTableConstIteratorAdapter() {}

Do we need to initialize m_impl to anything (like null) or does it do that itself?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>390445</commentid>
    <comment_count>3</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-04-21 16:30:18 -0700</bug_when>
    <thetext>+mjs for WTF foo.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>390447</commentid>
    <comment_count>4</comment_count>
    <who name="Vitaly Repeshko">vitalyr</who>
    <bug_when>2011-04-21 16:32:12 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 90625 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=90625&amp;action=review
&gt; 
&gt; &gt; Source/JavaScriptCore/wtf/HashTable.h:1123
&gt; &gt; +        HashTableConstIteratorAdapter() {}
&gt; 
&gt; Do we need to initialize m_impl to anything (like null) or does it do that itself?

Unlike the adapter it has a default constructor. So I don&apos;t think it should be initialized.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>390561</commentid>
    <comment_count>5</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2011-04-21 19:56:48 -0700</bug_when>
    <thetext>Why are these needed? What will they be used for?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>390568</commentid>
    <comment_count>6</comment_count>
    <who name="Vitaly Repeshko">vitalyr</who>
    <bug_when>2011-04-21 20:16:46 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; Why are these needed? What will they be used for?

Right now you can&apos;t declare a variable or class field of type HashMap::iterator without immediately initializing it. This is inconsistent with wtf::Vector and STL iterators.

My specific intended usage for them is to implement a lightweight iterator over EventTarget&apos;s listeners. EventTarget has a map of vectors. So the listener iterator simply combines a map iterator and an index. The problem is that the listener map is optional and the map iterator can&apos;t be initialized when it&apos;s NULL without using some dummy map.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>390609</commentid>
    <comment_count>7</comment_count>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-04-21 22:11:37 -0700</bug_when>
    <thetext>I asked Vitaly to post this as a separate patch because the folks who would review this patch might not be the same folks who would be interested in reviewing the rest of his change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>390804</commentid>
    <comment_count>8</comment_count>
      <attachid>90625</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2011-04-22 09:02:41 -0700</bug_when>
    <thetext>Comment on attachment 90625
patch

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

&gt; Source/JavaScriptCore/ChangeLog:7
&gt; +

I would add some more explanation here about why you&apos;re making this change (i.e., that you plan to use it in another patch shortly).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>391117</commentid>
    <comment_count>9</comment_count>
    <who name="Vitaly Repeshko">vitalyr</who>
    <bug_when>2011-04-22 15:01:40 -0700</bug_when>
    <thetext>	M	Source/JavaScriptCore/ChangeLog
	M	Source/JavaScriptCore/wtf/HashTable.h
Committed r84687</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>90625</attachid>
            <date>2011-04-21 16:14:44 -0700</date>
            <delta_ts>2011-04-22 09:02:41 -0700</delta_ts>
            <desc>patch</desc>
            <filename>wtf_iter.patch</filename>
            <type>text/plain</type>
            <size>1644</size>
            <attacher name="Vitaly Repeshko">vitalyr</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9KYXZhU2NyaXB0Q29yZS9DaGFuZ2VMb2cgYi9Tb3VyY2UvSmF2
YVNjcmlwdENvcmUvQ2hhbmdlTG9nCmluZGV4IGRmYWY2MDcuLjY5MjZiOTIgMTAwNjQ0Ci0tLSBh
L1Nvd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G5hbWVzcGFjZSBXVEYgewogICAgIC8vIGl0ZXJhdG9yIGFkYXB0ZXJzCiAKICAgICB0
ZW1wbGF0ZTx0eXBlbmFtZSBIYXNoVGFibGVUeXBlLCB0eXBlbmFtZSBWYWx1ZVR5cGU+IHN0cnVj
dCBIYXNoVGFibGVDb25zdEl0ZXJhdG9yQWRhcHRlciB7CisgICAgICAgIEhhc2hUYWJsZUNvbnN0
SXRlcmF0b3JBZGFwdGVyKCkge30KICAgICAgICAgSGFzaFRhYmxlQ29uc3RJdGVyYXRvckFkYXB0
ZXIoY29uc3QgdHlwZW5hbWUgSGFzaFRhYmxlVHlwZTo6Y29uc3RfaXRlcmF0b3ImIGltcGwpIDog
bV9pbXBsKGltcGwpIHt9CiAKICAgICAgICAgY29uc3QgVmFsdWVUeXBlKiBnZXQoKSBjb25zdCB7
IHJldHVybiAoY29uc3QgVmFsdWVUeXBlKiltX2ltcGwuZ2V0KCk7IH0KQEAgLTExMzMsNiArMTEz
NCw3IEBAIG5hbWVzcGFjZSBXVEYgewogICAgIH07CiAKICAgICB0ZW1wbGF0ZTx0eXBlbmFtZSBI
YXNoVGFibGVUeXBlLCB0eXBlbmFtZSBWYWx1ZVR5cGU+IHN0cnVjdCBIYXNoVGFibGVJdGVyYXRv
ckFkYXB0ZXIgeworICAgICAgICBIYXNoVGFibGVJdGVyYXRvckFkYXB0ZXIoKSB7fQogICAgICAg
ICBIYXNoVGFibGVJdGVyYXRvckFkYXB0ZXIoY29uc3QgdHlwZW5hbWUgSGFzaFRhYmxlVHlwZTo6
aXRlcmF0b3ImIGltcGwpIDogbV9pbXBsKGltcGwpIHt9CiAKICAgICAgICAgVmFsdWVUeXBlKiBn
ZXQoKSBjb25zdCB7IHJldHVybiAoVmFsdWVUeXBlKiltX2ltcGwuZ2V0KCk7IH0K
</data>
<flag name="review"
          id="83380"
          type_id="1"
          status="+"
          setter="abarth"
    />
          </attachment>
      

    </bug>

</bugzilla>