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.
Created attachment 151440 [details]
Created attachment 151441 [details]
Comment on attachment 151441 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=151441&action=review
> + this.addRevision(window.localStorage[historyItems[i].key], new Date(historyItems[i].timestamp), true);
localStorage check is missing.
> + delete window.localStorage[historyItem.key];
check for window.localStorage missing.
> + window.localStorage["revision-history"] = JSON.stringify(filteredRegistry);
> + this._addFrame(frame);
The order of calls here is extremely sensitive. Either reload scenario or navigation between renderers might go off.
Created attachment 151464 [details]
> localStorage check is missing.
> > 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.
Committed r122229: <http://trac.webkit.org/changeset/122229>