Title: [262077] trunk/Source/WebInspectorUI
Revision
262077
Author
[email protected]
Date
2020-05-22 14:54:32 -0700 (Fri, 22 May 2020)

Log Message

Web Inspector: Storage: don't request the list of IndexedDB database names multiple times for the same security origin
https://bugs.webkit.org/show_bug.cgi?id=212253
<rdar://problem/62945903>

Reviewed by Joseph Pecoraro.

This can happen if additional frames are added that share the same security origin as the
main frame. Simply maintain a `Set` of security origins that've already been requested for
and ignore any repeat requests.

* UserInterface/Controllers/IndexedDBManager.js:
(WI.IndexedDBManager):
(WI.IndexedDBManager.prototype._reset):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (262076 => 262077)


--- trunk/Source/WebInspectorUI/ChangeLog	2020-05-22 21:52:37 UTC (rev 262076)
+++ trunk/Source/WebInspectorUI/ChangeLog	2020-05-22 21:54:32 UTC (rev 262077)
@@ -1,3 +1,19 @@
+2020-05-22  Devin Rousso  <[email protected]>
+
+        Web Inspector: Storage: don't request the list of IndexedDB database names multiple times for the same security origin
+        https://bugs.webkit.org/show_bug.cgi?id=212253
+        <rdar://problem/62945903>
+
+        Reviewed by Joseph Pecoraro.
+
+        This can happen if additional frames are added that share the same security origin as the
+        main frame. Simply maintain a `Set` of security origins that've already been requested for
+        and ignore any repeat requests.
+
+        * UserInterface/Controllers/IndexedDBManager.js:
+        (WI.IndexedDBManager):
+        (WI.IndexedDBManager.prototype._reset):
+
 2020-05-20  Nikita Vasilyev  <[email protected]>
 
         Web Inspector: Left/Right arrow keys should collapse/expand details sections

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/IndexedDBManager.js (262076 => 262077)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/IndexedDBManager.js	2020-05-22 21:52:37 UTC (rev 262076)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/IndexedDBManager.js	2020-05-22 21:54:32 UTC (rev 262077)
@@ -33,6 +33,8 @@
         super();
 
         this._enabled = false;
+        this._requestedSecurityOrigins = new Set;
+
         this._reset();
     }
 
@@ -151,6 +153,7 @@
     _reset()
     {
         this._indexedDatabases = [];
+        this._requestedSecurityOrigins.clear();
         this.dispatchEventToListeners(WI.IndexedDBManager.Event.Cleared);
 
         let mainFrame = WI.networkManager.mainFrame;
@@ -173,6 +176,11 @@
         if (!securityOrigin || securityOrigin === "://")
             return;
 
+        if (this._requestedSecurityOrigins.has(securityOrigin))
+            return;
+
+        this._requestedSecurityOrigins.add(securityOrigin);
+
         function processDatabaseNames(error, names)
         {
             if (error || !names)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to