<?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>199208</bug_id>
          
          <creation_ts>2019-06-25 15:48:02 -0700</creation_ts>
          <short_desc>Add HashMap.contains check in SessionStorageNamespace::removeAllowedConnection</short_desc>
          <delta_ts>2019-06-25 16:28:10 -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>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>198966</dup_id>
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=198966</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alex Christensen">achristensen</reporter>
          <assigned_to name="Alex Christensen">achristensen</assigned_to>
          <cc>cdumez</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1547843</commentid>
    <comment_count>0</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2019-06-25 15:48:02 -0700</bug_when>
    <thetext>Add HashMap.contains check in SessionStorageNamespace::removeAllowedConnection</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1547844</commentid>
    <comment_count>1</comment_count>
      <attachid>372870</attachid>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2019-06-25 15:49:56 -0700</bug_when>
    <thetext>Created attachment 372870
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1547845</commentid>
    <comment_count>2</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2019-06-25 15:49:58 -0700</bug_when>
    <thetext>&lt;rdar://problem/32106147&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1547848</commentid>
    <comment_count>3</comment_count>
      <attachid>372870</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2019-06-25 15:55:22 -0700</bug_when>
    <thetext>Comment on attachment 372870
Patch

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

&gt; Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp:485
&gt; +    if (m_allowedConnections.contains(allowedConnection))

This change is very obscure. Based on the radar, it seems that it is trying to solve some kind of threading issue. However, looking at this code, somebody would be very tempted to refactor it to drop your contains check given that remove() is already a no-op when the key is not present.
Also, it goes against our usual coding practices to do double look-up in the case where the key is actually in the map.

I think we should find a good way to address the crash in the radar, I do not believe this is it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1547851</commentid>
    <comment_count>4</comment_count>
      <attachid>372870</attachid>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2019-06-25 15:58:41 -0700</bug_when>
    <thetext>Comment on attachment 372870
Patch

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

&gt;&gt; Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp:485
&gt;&gt; +    if (m_allowedConnections.contains(allowedConnection))
&gt; 
&gt; This change is very obscure. Based on the radar, it seems that it is trying to solve some kind of threading issue. However, looking at this code, somebody would be very tempted to refactor it to drop your contains check given that remove() is already a no-op when the key is not present.
&gt; Also, it goes against our usual coding practices to do double look-up in the case where the key is actually in the map.
&gt; 
&gt; I think we should find a good way to address the crash in the radar, I do not believe this is it.

This seems potentially related to https://bugs.webkit.org/show_bug.cgi?id=198966 BTW.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1547869</commentid>
    <comment_count>5</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2019-06-25 16:27:31 -0700</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of bug 198966 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1547872</commentid>
    <comment_count>6</comment_count>
    <who name="Alex Christensen">achristensen</who>
    <bug_when>2019-06-25 16:28:10 -0700</bug_when>
    <thetext>That&apos;s why I couldn&apos;t see a missing null check.  All use is on the same serial queue, so adding a mutex wouldn&apos;t help here.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>372870</attachid>
            <date>2019-06-25 15:49:56 -0700</date>
            <delta_ts>2019-06-25 15:57:19 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-199208-20190625154955.patch</filename>
            <type>text/plain</type>
            <size>1929</size>
            <attacher name="Alex Christensen">achristensen</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjQ2ODA3CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0L0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCmluZGV4IDM2MDY1NDBiM2RmY2Q0MWRj
YTk4NjJkNzdlNjRkZTkyMmUzMWYyYWQuLmY2MTFhNmIwOGUzNjE4Y2I2MmI2OTYwOTg4ZWI2ZjY1
NWIyZmQ1YWUgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCisrKyBiL1NvdXJj
ZS9XZWJLaXQvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTktMDYtMjUgIEFsZXggQ2hy
aXN0ZW5zZW4gIDxhY2hyaXN0ZW5zZW5Ad2Via2l0Lm9yZz4KKworICAgICAgICBBZGQgSGFzaE1h
cC5jb250YWlucyBjaGVjayBpbiBTZXNzaW9uU3RvcmFnZU5hbW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