<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[191612] trunk/Source/WebInspectorUI</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/191612">191612</a></dd>
<dt>Author</dt> <dd>mattbaker@apple.com</dd>
<dt>Date</dt> <dd>2015-10-26 16:53:54 -0700 (Mon, 26 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Web Inspector: Cleanup sidebar panels, reduce `delete` and use Maps instead of objects
https://bugs.webkit.org/show_bug.cgi?id=150548
Reviewed by Timothy Hatcher.
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WebInspector.LayerTreeDetailsSidebarPanel):
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._updateDataGrid):
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._dataGridNodeForLayer):
* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.restoreStateFromCookie.finalAttemptToRestoreViewStateFromCookie):
(WebInspector.NavigationSidebarPanel.restoreStateFromCookie):
(WebInspector.NavigationSidebarPanel.prototype.applyFiltersToTreeElement):
(WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
(WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
Switched to using Symbol() to set external properties on tree elements.
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
* UserInterface/Views/StorageSidebarPanel.js:
(WebInspector.StorageSidebarPanel):
(WebInspector.StorageSidebarPanel.prototype._addDatabase):
(WebInspector.StorageSidebarPanel.prototype._addIndexedDatabase):
(WebInspector.StorageSidebarPanel.prototype._addFrameManifest):
(WebInspector.StorageSidebarPanel.prototype._storageCleared):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayerTreeDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNavigationSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsStorageSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (191611 => 191612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-10-26 23:51:36 UTC (rev 191611)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-10-26 23:53:54 UTC (rev 191612)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2015-10-26 Matt Baker <mattbaker@apple.com>
+
+ Web Inspector: Cleanup sidebar panels, reduce `delete` and use Maps instead of objects
+ https://bugs.webkit.org/show_bug.cgi?id=150548
+
+ Reviewed by Timothy Hatcher.
+
+ * UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
+ (WebInspector.LayerTreeDetailsSidebarPanel):
+ (WebInspector.LayerTreeDetailsSidebarPanel.prototype._updateDataGrid):
+ (WebInspector.LayerTreeDetailsSidebarPanel.prototype._dataGridNodeForLayer):
+
+ * UserInterface/Views/NavigationSidebarPanel.js:
+ (WebInspector.NavigationSidebarPanel):
+ (WebInspector.NavigationSidebarPanel.restoreStateFromCookie.finalAttemptToRestoreViewStateFromCookie):
+ (WebInspector.NavigationSidebarPanel.restoreStateFromCookie):
+ (WebInspector.NavigationSidebarPanel.prototype.applyFiltersToTreeElement):
+ (WebInspector.NavigationSidebarPanel.prototype._updateContentOverflowShadowVisibility):
+ (WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
+ Switched to using Symbol() to set external properties on tree elements.
+
+ * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
+ (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
+
+ * UserInterface/Views/StorageSidebarPanel.js:
+ (WebInspector.StorageSidebarPanel):
+ (WebInspector.StorageSidebarPanel.prototype._addDatabase):
+ (WebInspector.StorageSidebarPanel.prototype._addIndexedDatabase):
+ (WebInspector.StorageSidebarPanel.prototype._addFrameManifest):
+ (WebInspector.StorageSidebarPanel.prototype._storageCleared):
+
</ins><span class="cx"> 2015-10-24 Nikita Vasilyev <nvasilyev@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r191419.
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayerTreeDetailsSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDetailsSidebarPanel.js (191611 => 191612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDetailsSidebarPanel.js        2015-10-26 23:51:36 UTC (rev 191611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayerTreeDetailsSidebarPanel.js        2015-10-26 23:53:54 UTC (rev 191612)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> {
</span><span class="cx"> super("layer-tree", WebInspector.UIString("Layers"), WebInspector.UIString("Layer"));
</span><span class="cx">
</span><del>- this._dataGridNodesByLayerId = {};
</del><ins>+ this._dataGridNodesByLayerId = new Map;
</ins><span class="cx">
</span><span class="cx"> this.element.classList.add("layer-tree");
</span><span class="cx">
</span><span class="lines">@@ -258,26 +258,25 @@
</span><span class="cx">
</span><span class="cx"> _updateDataGrid(layerForNode, childLayers)
</span><span class="cx"> {
</span><del>- var dataGrid = this._dataGrid;
</del><ins>+ let dataGrid = this._dataGrid;
+ let mutations = WebInspector.layerTreeManager.layerTreeMutations(this._childLayers, childLayers);
</ins><span class="cx">
</span><del>- var mutations = WebInspector.layerTreeManager.layerTreeMutations(this._childLayers, childLayers);
-
</del><span class="cx"> mutations.removals.forEach(function(layer) {
</span><del>- var node = this._dataGridNodesByLayerId[layer.layerId];
</del><ins>+ let node = this._dataGridNodesByLayerId.get(layer.layerId);
</ins><span class="cx"> if (node) {
</span><span class="cx"> dataGrid.removeChild(node);
</span><del>- delete this._dataGridNodesByLayerId[layer.layerId];
</del><ins>+ this._dataGridNodesByLayerId.delete(layer.layerId);
</ins><span class="cx"> }
</span><span class="cx"> }, this);
</span><span class="cx">
</span><span class="cx"> mutations.additions.forEach(function(layer) {
</span><del>- var node = this._dataGridNodeForLayer(layer);
</del><ins>+ let node = this._dataGridNodeForLayer(layer);
</ins><span class="cx"> if (node)
</span><span class="cx"> dataGrid.appendChild(node);
</span><span class="cx"> }, this);
</span><span class="cx">
</span><span class="cx"> mutations.preserved.forEach(function(layer) {
</span><del>- var node = this._dataGridNodesByLayerId[layer.layerId];
</del><ins>+ let node = this._dataGridNodesByLayerId.get(layer.layerId);
</ins><span class="cx"> if (node)
</span><span class="cx"> node.layer = layer;
</span><span class="cx"> }, this);
</span><span class="lines">@@ -289,10 +288,9 @@
</span><span class="cx">
</span><span class="cx"> _dataGridNodeForLayer(layer)
</span><span class="cx"> {
</span><del>- var node = new WebInspector.LayerTreeDataGridNode(layer);
</del><ins>+ let node = new WebInspector.LayerTreeDataGridNode(layer);
+ this._dataGridNodesByLayerId.set(layer.layerId, node);
</ins><span class="cx">
</span><del>- this._dataGridNodesByLayerId[layer.layerId] = node;
-
</del><span class="cx"> return node;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNavigationSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (191611 => 191612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js        2015-10-26 23:51:36 UTC (rev 191611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js        2015-10-26 23:53:54 UTC (rev 191612)
</span><span class="lines">@@ -74,6 +74,9 @@
</span><span class="cx"> WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ChildFrameWasRemoved, this._checkForStaleResources, this);
</span><span class="cx"> WebInspector.Frame.addEventListener(WebInspector.Frame.Event.ResourceWasRemoved, this._checkForStaleResources, this);
</span><span class="cx"> }
</span><ins>+
+ this._pendingViewStateCookie = null;
+ this._restoringState = false;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Public
</span><span class="lines">@@ -239,12 +242,12 @@
</span><span class="cx">
</span><span class="cx"> function finalAttemptToRestoreViewStateFromCookie()
</span><span class="cx"> {
</span><del>- delete this._finalAttemptToRestoreViewStateTimeout;
</del><ins>+ this._finalAttemptToRestoreViewStateTimeout = undefined;
</ins><span class="cx">
</span><span class="cx"> this._checkOutlinesForPendingViewStateCookie(true);
</span><span class="cx">
</span><del>- delete this._pendingViewStateCookie;
- delete this._restoringState;
</del><ins>+ this._pendingViewStateCookie = null;
+ this._restoringState = false;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // If the specific tree element wasn't found, we may need to wait for the resources
</span><span class="lines">@@ -329,8 +332,8 @@
</span><span class="cx"> treeElement.hidden = false;
</span><span class="cx">
</span><span class="cx"> // If this tree element was expanded during filtering, collapse it again.
</span><del>- if (treeElement.expanded && treeElement.__wasExpandedDuringFiltering) {
- delete treeElement.__wasExpandedDuringFiltering;
</del><ins>+ if (treeElement.expanded && treeElement[WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol]) {
+ treeElement[WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol] = false;
</ins><span class="cx"> treeElement.collapse();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -388,8 +391,8 @@
</span><span class="cx"> makeVisible();
</span><span class="cx">
</span><span class="cx"> // If this tree element didn't match a built-in filter and was expanded earlier during filtering, collapse it again.
</span><del>- if (!flags.expandTreeElement && treeElement.expanded && treeElement.__wasExpandedDuringFiltering) {
- delete treeElement.__wasExpandedDuringFiltering;
</del><ins>+ if (!flags.expandTreeElement && treeElement.expanded && treeElement[WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol]) {
+ treeElement[WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol] = false;
</ins><span class="cx"> treeElement.collapse();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -464,7 +467,7 @@
</span><span class="cx">
</span><span class="cx"> _updateContentOverflowShadowVisibility()
</span><span class="cx"> {
</span><del>- delete this._updateContentOverflowShadowVisibilityIdentifier;
</del><ins>+ this._updateContentOverflowShadowVisibilityIdentifier = undefined;
</ins><span class="cx">
</span><span class="cx"> var scrollHeight = this.contentElement.scrollHeight;
</span><span class="cx"> var offsetHeight = this.contentElement.offsetHeight;
</span><span class="lines">@@ -698,22 +701,24 @@
</span><span class="cx"> if (matchedElement) {
</span><span class="cx"> this.showDefaultContentViewForTreeElement(matchedElement);
</span><span class="cx">
</span><del>- delete this._pendingViewStateCookie;
</del><ins>+ this._pendingViewStateCookie = null;
</ins><span class="cx">
</span><span class="cx"> // Delay clearing the restoringState flag until the next runloop so listeners
</span><span class="cx"> // checking for it in this runloop still know state was being restored.
</span><span class="cx"> setTimeout(function() {
</span><del>- delete this._restoringState;
</del><ins>+ this._restoringState = false;
</ins><span class="cx"> }.bind(this));
</span><span class="cx">
</span><span class="cx"> if (this._finalAttemptToRestoreViewStateTimeout) {
</span><span class="cx"> clearTimeout(this._finalAttemptToRestoreViewStateTimeout);
</span><del>- delete this._finalAttemptToRestoreViewStateTimeout;
</del><ins>+ this._finalAttemptToRestoreViewStateTimeout = undefined;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+WebInspector.NavigationSidebarPanel.WasExpandedDuringFilteringSymbol = Symbol("was-expanded-during-filtering");
+
</ins><span class="cx"> WebInspector.NavigationSidebarPanel.OverflowShadowElementStyleClassName = "overflow-shadow";
</span><span class="cx"> WebInspector.NavigationSidebarPanel.TopOverflowShadowElementStyleClassName = "top";
</span><span class="cx"> WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementHiddenStyleClassName = "hidden";
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js (191611 => 191612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js        2015-10-26 23:51:36 UTC (rev 191611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js        2015-10-26 23:53:54 UTC (rev 191612)
</span><span class="lines">@@ -160,9 +160,9 @@
</span><span class="cx"> let detailsSections = [];
</span><span class="cx"> let foundLocalScope = false;
</span><span class="cx">
</span><del>- let sectionCountByType = {};
- for (var type in WebInspector.ScopeChainNode.Type)
- sectionCountByType[WebInspector.ScopeChainNode.Type[type]] = 0;
</del><ins>+ let sectionCountByType = new Map;
+ for (let type in WebInspector.ScopeChainNode.Type)
+ sectionCountByType.set(WebInspector.ScopeChainNode.Type[type], 0);
</ins><span class="cx">
</span><span class="cx"> let scopeChain = callFrame.scopeChain;
</span><span class="cx"> for (let scope of scopeChain) {
</span><span class="lines">@@ -170,7 +170,8 @@
</span><span class="cx"> let extraPropertyDescriptor = null;
</span><span class="cx"> let collapsedByDefault = false;
</span><span class="cx">
</span><del>- ++sectionCountByType[scope.type];
</del><ins>+ let count = sectionCountByType.get(scope.type);
+ sectionCountByType.set(scope.type, ++count);
</ins><span class="cx">
</span><span class="cx"> switch (scope.type) {
</span><span class="cx"> case WebInspector.ScopeChainNode.Type.Local:
</span><span class="lines">@@ -209,7 +210,7 @@
</span><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- let detailsSectionIdentifier = scope.type + "-" + sectionCountByType[scope.type];
</del><ins>+ let detailsSectionIdentifier = scope.type + "-" + sectionCountByType.get(scope.type);
</ins><span class="cx">
</span><span class="cx"> let scopePropertyPath = WebInspector.PropertyPath.emptyPropertyPathForScope(scope.object);
</span><span class="cx"> let objectTree = new WebInspector.ObjectTreeView(scope.object, WebInspector.ObjectTreeView.Mode.Properties, scopePropertyPath);
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsStorageSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js (191611 => 191612)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js        2015-10-26 23:51:36 UTC (rev 191611)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js        2015-10-26 23:53:54 UTC (rev 191612)
</span><span class="lines">@@ -65,15 +65,15 @@
</span><span class="cx"> this._sessionStorageRootTreeElement = null;
</span><span class="cx">
</span><span class="cx"> this._databaseRootTreeElement = null;
</span><del>- this._databaseHostTreeElementMap = {};
</del><ins>+ this._databaseHostTreeElementMap = new Map;
</ins><span class="cx">
</span><span class="cx"> this._indexedDatabaseRootTreeElement = null;
</span><del>- this._indexedDatabaseHostTreeElementMap = {};
</del><ins>+ this._indexedDatabaseHostTreeElementMap = new Map;
</ins><span class="cx">
</span><span class="cx"> this._cookieStorageRootTreeElement = null;
</span><span class="cx">
</span><span class="cx"> this._applicationCacheRootTreeElement = null;
</span><del>- this._applicationCacheURLTreeElementMap = {};
</del><ins>+ this._applicationCacheURLTreeElementMap = new Map;
</ins><span class="cx">
</span><span class="cx"> WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.CookieStorageObjectWasAdded, this._cookieStorageObjectWasAdded, this);
</span><span class="cx"> WebInspector.storageManager.addEventListener(WebInspector.StorageManager.Event.DOMStorageObjectWasAdded, this._domStorageObjectWasAdded, this);
</span><span class="lines">@@ -211,13 +211,15 @@
</span><span class="cx"> {
</span><span class="cx"> console.assert(database instanceof WebInspector.DatabaseObject);
</span><span class="cx">
</span><del>- if (!this._databaseHostTreeElementMap[database.host]) {
- this._databaseHostTreeElementMap[database.host] = new WebInspector.DatabaseHostTreeElement(database.host);
- this._databaseRootTreeElement = this._addStorageChild(this._databaseHostTreeElementMap[database.host], this._databaseRootTreeElement, WebInspector.UIString("Databases"));
</del><ins>+ let databaseHostElement = this._databaseHostTreeElementMap.get(database.host);
+ if (!databaseHostElement) {
+ databaseHostElement = new WebInspector.DatabaseHostTreeElement(database.host);
+ this._databaseHostTreeElementMap.set(database.host, databaseHostElement);
+ this._databaseRootTreeElement = this._addStorageChild(treeElement, this._databaseRootTreeElement, WebInspector.UIString("Databases"));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- var databaseElement = new WebInspector.DatabaseTreeElement(database);
- this._databaseHostTreeElementMap[database.host].appendChild(databaseElement);
</del><ins>+ let databaseElement = new WebInspector.DatabaseTreeElement(database);
+ databaseHostElement.append(databaseElement);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _databaseWasInspected(event)
</span><span class="lines">@@ -236,13 +238,15 @@
</span><span class="cx"> {
</span><span class="cx"> console.assert(indexedDatabase instanceof WebInspector.IndexedDatabase);
</span><span class="cx">
</span><del>- if (!this._indexedDatabaseHostTreeElementMap[indexedDatabase.host]) {
- this._indexedDatabaseHostTreeElementMap[indexedDatabase.host] = new WebInspector.IndexedDatabaseHostTreeElement(indexedDatabase.host);
- this._indexedDatabaseRootTreeElement = this._addStorageChild(this._indexedDatabaseHostTreeElementMap[indexedDatabase.host], this._indexedDatabaseRootTreeElement, WebInspector.UIString("Indexed Databases"));
</del><ins>+ let indexedDatabaseHostElement = this._indexedDatabaseHostTreeElementMap.get(indexedDatabase.host);
+ if (!indexedDatabaseHostElement) {
+ indexedDatabaseHostElement = new WebInspector.IndexedDatabaseHostTreeElement(indexedDatabase.host);
+ this._indexedDatabaseHostTreeElementMap.set(indexedDatabase.host, indexedDatabaseHostElement);
+ this._indexedDatabaseRootTreeElement = this._addStorageChild(indexedDatabaseHostElement, this._indexedDatabaseRootTreeElement, WebInspector.UIString("Indexed Databases"));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- var indexedDatabaseElement = new WebInspector.IndexedDatabaseTreeElement(indexedDatabase);
- this._indexedDatabaseHostTreeElementMap[indexedDatabase.host].appendChild(indexedDatabaseElement);
</del><ins>+ let indexedDatabaseElement = new WebInspector.IndexedDatabaseTreeElement(indexedDatabase);
+ indexedDatabaseHostElement.append(indexedDatabaseElement);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _cookieStorageObjectWasAdded(event)
</span><span class="lines">@@ -267,15 +271,17 @@
</span><span class="cx"> {
</span><span class="cx"> console.assert(frameManifest instanceof WebInspector.ApplicationCacheFrame);
</span><span class="cx">
</span><del>- var manifest = frameManifest.manifest;
- var manifestURL = manifest.manifestURL;
- if (!this._applicationCacheURLTreeElementMap[manifestURL]) {
- this._applicationCacheURLTreeElementMap[manifestURL] = new WebInspector.ApplicationCacheManifestTreeElement(manifest);
- this._applicationCacheRootTreeElement = this._addStorageChild(this._applicationCacheURLTreeElementMap[manifestURL], this._applicationCacheRootTreeElement, WebInspector.UIString("Application Cache"));
</del><ins>+ let manifest = frameManifest.manifest;
+ let manifestURL = manifest.manifestURL;
+ let applicationCacheManifestElement = this._applicationCacheURLTreeElementMap.get(manifestURL);
+ if (!applicationCacheManifestElement) {
+ applicationCacheManifestElement = new WebInspector.ApplicationCacheManifestTreeElement(manifest);
+ this._applicationCacheURLTreeElementMap.set(manifestURL, applicationCacheManifestElement);
+ this._applicationCacheRootTreeElement = this._addStorageChild(applicationCacheManifestElement, this._applicationCacheRootTreeElement, WebInspector.UIString("Application Cache"));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- var frameCacheElement = new WebInspector.ApplicationCacheFrameTreeElement(frameManifest);
- this._applicationCacheURLTreeElementMap[manifestURL].appendChild(frameCacheElement);
</del><ins>+ let frameCacheElement = new WebInspector.ApplicationCacheFrameTreeElement(frameManifest);
+ applicationCacheManifestElement.append(frameCacheElement);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _frameManifestRemoved(event)
</span><span class="lines">@@ -353,12 +359,12 @@
</span><span class="cx"> this._localStorageRootTreeElement = null;
</span><span class="cx"> this._sessionStorageRootTreeElement = null;
</span><span class="cx"> this._databaseRootTreeElement = null;
</span><del>- this._databaseHostTreeElementMap = {};
</del><ins>+ this._databaseHostTreeElementMap.clear();
</ins><span class="cx"> this._indexedDatabaseRootTreeElement = null;
</span><del>- this._indexedDatabaseHostTreeElementMap = {};
</del><ins>+ this._indexedDatabaseHostTreeElementMap.clear();
</ins><span class="cx"> this._cookieStorageRootTreeElement = null;
</span><span class="cx"> this._applicationCacheRootTreeElement = null;
</span><del>- this._applicationCacheURLTreeElementMap = {};
</del><ins>+ this._applicationCacheURLTreeElementMap.clear();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> _scopeBarSelectionDidChange(event)
</span></span></pre>
</div>
</div>
</body>
</html>