Bug 144404 - Web Inspector: Split Storage from Resources tab
Summary: Web Inspector: Split Storage from Resources tab
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: DoNotImportToRadar
Depends on:
Blocks:
 
Reported: 2015-04-29 12:15 PDT by Timothy Hatcher
Modified: 2015-04-29 15:03 PDT (History)
7 users (show)

See Also:


Attachments
Patch (30.50 KB, patch)
2015-04-29 12:16 PDT, Timothy Hatcher
no flags Details | Formatted Diff | Diff
Patch (50.11 KB, patch)
2015-04-29 12:36 PDT, Timothy Hatcher
joepeck: review+
timothy: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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