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] Patch
Created attachment 151441 [details] Patch
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.
Created attachment 151464 [details] Patch
> 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.
Committed r122229: <http://trac.webkit.org/changeset/122229>