Bug 90855 - Web Inspector: Refactor resource revisions before moving to UISourceCode.
Summary: Web Inspector: Refactor resource revisions before moving to UISourceCode.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Vsevolod Vlasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-10 00:43 PDT by Vsevolod Vlasov
Modified: 2012-07-10 09:23 PDT (History)
10 users (show)

See Also:


Attachments
Patch (15.23 KB, patch)
2012-07-10 05:08 PDT, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff
Patch (15.05 KB, patch)
2012-07-10 05:13 PDT, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff
Patch (15.12 KB, patch)
2012-07-10 08:46 PDT, Vsevolod Vlasov
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Vlasov 2012-07-10 00:43:43 PDT
Resource revisions should be moved to UISourceCode as UISourceCode is now the only object that could be edited.
This patch makes all necessary changes to revisions implementation before moving it to UISourceCode.

 - Revisions are now persisted based on mainFrame.loaderId, not resource.loaderId which makes filtering out stale persisted revisions easier.
 - Restoring revisions from local storage is separated from filtering out stale persisted revisions.
 - Resource._clearRevisionHistory and Resource._restoreRevisions are not static anymore.
Comment 1 Vsevolod Vlasov 2012-07-10 05:08:07 PDT
Created attachment 151440 [details]
Patch
Comment 2 Vsevolod Vlasov 2012-07-10 05:13:05 PDT
Created attachment 151441 [details]
Patch
Comment 3 Pavel Feldman 2012-07-10 08:27:18 PDT
Comment on attachment 151441 [details]
Patch

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

> Source/WebCore/inspector/front-end/Resource.js:257
> +            this.addRevision(window.localStorage[historyItems[i].key], new Date(historyItems[i].timestamp), true);

localStorage check is missing.

> Source/WebCore/inspector/front-end/Resource.js:491
> +                delete window.localStorage[historyItem.key];

check for window.localStorage missing.

> Source/WebCore/inspector/front-end/Resource.js:498
> +        window.localStorage["revision-history"] = JSON.stringify(filteredRegistry);

ditto

> Source/WebCore/inspector/front-end/ResourceTreeModel.js:335
> +        this._addFrame(frame);

The order of calls here is extremely sensitive. Either reload scenario or navigation between renderers might go off.
Comment 4 Vsevolod Vlasov 2012-07-10 08:46:27 PDT
Created attachment 151464 [details]
Patch
Comment 5 Vsevolod Vlasov 2012-07-10 08:47:46 PDT
> localStorage check is missing.
Done.

> > Source/WebCore/inspector/front-end/ResourceTreeModel.js:335
> > +        this._addFrame(frame);
> 
> The order of calls here is extremely sensitive. Either reload scenario or navigation between renderers might go off.
I am only removing obsolete code here and move this._addFrame(frame) call which could be moved safely. I checked all the FrameAdded event listeners.
Comment 6 Vsevolod Vlasov 2012-07-10 09:23:24 PDT
Committed r122229: <http://trac.webkit.org/changeset/122229>