<?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>212253</bug_id>
          
          <creation_ts>2020-05-21 22:12:37 -0700</creation_ts>
          <short_desc>Web Inspector: Storage: don&apos;t request the list of IndexedDB database names multiple times for the same security origin</short_desc>
          <delta_ts>2020-05-22 14:54:38 -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>Web Inspector</component>
          <version>WebKit 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>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Devin Rousso">hi</reporter>
          <assigned_to name="Devin Rousso">hi</assigned_to>
          <cc>hi</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>joepeck</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1655248</commentid>
    <comment_count>0</comment_count>
    <who name="Devin Rousso">hi</who>
    <bug_when>2020-05-21 22:12:37 -0700</bug_when>
    <thetext># STEPS TO REPRODUCE:
1. inspect &lt;https://www.businessinsider.com&gt;
2. reload the page a few times
 =&gt; multiple `ONE_SIGNAL_SDK_DB` IndexedDB databases are shown</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655249</commentid>
    <comment_count>1</comment_count>
    <who name="Devin Rousso">hi</who>
    <bug_when>2020-05-21 22:12:54 -0700</bug_when>
    <thetext>&lt;rdar://problem/62945903&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655250</commentid>
    <comment_count>2</comment_count>
      <attachid>400026</attachid>
    <who name="Devin Rousso">hi</who>
    <bug_when>2020-05-21 22:19:58 -0700</bug_when>
    <thetext>Created attachment 400026
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655251</commentid>
    <comment_count>3</comment_count>
      <attachid>400026</attachid>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2020-05-21 22:49:59 -0700</bug_when>
    <thetext>Comment on attachment 400026
Patch

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

r=me

&gt; Source/WebInspectorUI/ChangeLog:11
&gt; +        This can happen if additional frames are added that share the same security origin as the
&gt; +        main frame. Simply maintain a `Set` of security origins that&apos;ve already been requested for
&gt; +        and ignore any repeat requests.

In general Storage probably doesn&apos;t respect the double key&apos;d nature of storages of (top frame, inner frame). But I think this is probably fine since the same origin within two subframes is probably the same.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655254</commentid>
    <comment_count>4</comment_count>
      <attachid>400026</attachid>
    <who name="Devin Rousso">hi</who>
    <bug_when>2020-05-21 23:00:57 -0700</bug_when>
    <thetext>Comment on attachment 400026
Patch

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

&gt;&gt; Source/WebInspectorUI/ChangeLog:11
&gt;&gt; +        and ignore any repeat requests.
&gt; 
&gt; In general Storage probably doesn&apos;t respect the double key&apos;d nature of storages of (top frame, inner frame). But I think this is probably fine since the same origin within two subframes is probably the same.

We kinda do? 😅  The logic in `InspectorIndexedDBAgent::requestDatabaseNames` does use the `Document::securityOrigin` and Document::topOrigin` when getting the database names, so maybe we should also walk the `WI.Frame` ancestors and create a paired key for `_requestSecurityOrigins` instead.

I was thinking that we didn&apos;t do this based on the fact that `IndexedDB.requestDatabaseNames` only took a single `securityOrigin`.  Interesting that both security origins come from the same `Document` 🤔</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655260</commentid>
    <comment_count>5</comment_count>
      <attachid>400026</attachid>
    <who name="Devin Rousso">hi</who>
    <bug_when>2020-05-21 23:22:22 -0700</bug_when>
    <thetext>Comment on attachment 400026
Patch

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

&gt;&gt;&gt; Source/WebInspectorUI/ChangeLog:11
&gt;&gt;&gt; +        and ignore any repeat requests.
&gt;&gt; 
&gt;&gt; In general Storage probably doesn&apos;t respect the double key&apos;d nature of storages of (top frame, inner frame). But I think this is probably fine since the same origin within two subframes is probably the same.
&gt; 
&gt; We kinda do? 😅  The logic in `InspectorIndexedDBAgent::requestDatabaseNames` does use the `Document::securityOrigin` and Document::topOrigin` when getting the database names, so maybe we should also walk the `WI.Frame` ancestors and create a paired key for `_requestSecurityOrigins` instead.
&gt; 
&gt; I was thinking that we didn&apos;t do this based on the fact that `IndexedDB.requestDatabaseNames` only took a single `securityOrigin`.  Interesting that both security origins come from the same `Document` 🤔

Actually, i think what&apos;s here now is fine as the `Document::topOrigin` should always be the same for any given page so really the only thing that&apos;s changing is the `Document::securityOrigin`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1655452</commentid>
    <comment_count>6</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2020-05-22 14:54:38 -0700</bug_when>
    <thetext>Committed r262077: &lt;https://trac.webkit.org/changeset/262077&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 400026.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>400026</attachid>
            <date>2020-05-21 22:19:58 -0700</date>
            <delta_ts>2020-05-22 14:54:38 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-212253-20200521231957.patch</filename>
            <type>text/plain</type>
            <size>2450</size>
            <attacher name="Devin Rousso">hi</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1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iAgICAgICAgICAgICBpZiAoZXJyb3IgfHwgIW5hbWVzKQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>