Bug 144404

Summary: Web Inspector: Split Storage from Resources tab
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: Web InspectorAssignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: DoNotImportToRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch joepeck: review+, timothy: commit-queue-

Description Timothy Hatcher 2015-04-29 12:15:55 PDT
Add a Storage tab.
Comment 1 Timothy Hatcher 2015-04-29 12:16:52 PDT
Created attachment 251976 [details]
Patch
Comment 2 Joseph Pecoraro 2015-04-29 12:25:31 PDT
Comment on attachment 251976 [details]
Patch

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

I think this patch is actually missing WebInspector.StorageTabContentView, so StorageTabContentView.js.

> Source/WebInspectorUI/UserInterface/Controllers/ApplicationCacheManager.js:59
> +    get applicationCacheObjects()
> +    {
> +        var applicationCacheObjects = [];
> +        for (var id in this._applicationCacheObjects)
> +            applicationCacheObjects.push(this._applicationCacheObjects[id]);
> +        return applicationCacheObjects;
> +    }

This code looks weird because this._applicationCacheObjects is initialized to an array up above. Should it be an object? Or better yet a Map (no `delete`, and this would be [...map.values()]).

> Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js:93
> +            this._dataGrid = undefined;

What is this for? (Unfortunately the patch review tool is not giving me context).
Comment 3 Timothy Hatcher 2015-04-29 12:32:11 PDT
Comment on attachment 251976 [details]
Patch

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

>> Source/WebInspectorUI/UserInterface/Controllers/ApplicationCacheManager.js:59
>> +    }
> 
> This code looks weird because this._applicationCacheObjects is initialized to an array up above. Should it be an object? Or better yet a Map (no `delete`, and this would be [...map.values()]).

_applicationCacheObjects is treated as a map object below! I'll fix the _applicationCacheObjects = [] to be _applicationCacheObjects = {}. I save converting it to Map until later.

>> Source/WebInspectorUI/UserInterface/Views/DatabaseTableContentView.js:93
>> +            this._dataGrid = undefined;
> 
> What is this for? (Unfortunately the patch review tool is not giving me context).

Sorry. It fixes an exception. Seems this._dataGrid can be allocated but this._dataGrid.element is null/undefined.
Comment 4 Timothy Hatcher 2015-04-29 12:36:00 PDT
Created attachment 251977 [details]
Patch
Comment 5 Joseph Pecoraro 2015-04-29 14:37:19 PDT
Comment on attachment 251977 [details]
Patch

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

r=me, commit-queue won't work at the moment, patch is not applying.

> Source/WebInspectorUI/UserInterface/Views/StorageSidebarPanel.js:290
> +        this._localStorageRootTreeElement = null;
> +        this._sessionStorageRootTreeElement = null;
> +        this._databaseRootTreeElement = null;
> +        this._databaseHostTreeElementMap = {};
> +        this._indexedDatabaseRootTreeElement = null;
> +        this._indexedDatabaseHostTreeElementMap = {};
> +        this._cookieStorageRootTreeElement = null;
> +        this._applicationCacheRootTreeElement = null;
> +        this._applicationCacheURLTreeElementMap = {};

This is repeated in the constructor. I wonder if it should be a helper, like _reset.

> Source/WebInspectorUI/UserInterface/Views/StorageTabContentView.js:50
> +        return representedObject instanceof WebInspector.DOMStorageObject || representedObject instanceof WebInspector.CookieStorageObject ||
> +            representedObject instanceof WebInspector.DatabaseTableObject || representedObject instanceof WebInspector.DatabaseObject ||
> +            representedObject instanceof WebInspector.ApplicationCacheFrame || representedObject instanceof WebInspector.IndexedDatabaseObjectStore ||
> +            representedObject instanceof WebInspector.IndexedDatabaseObjectStoreIndex;

Style: I think we normally put the "||" on the start of the next line instead of at the end of the previous.
Comment 6 Timothy Hatcher 2015-04-29 15:03:18 PDT
Comment on attachment 251977 [details]
Patch

https://trac.webkit.org/r183580