Heap snapshot may be in 3 states: not loaded, loading and loaded. At the present time there is HeapProfileHeader._proxy field which may be either HeapSnapshotLoaderProxy or HeapSnapshotProxy which complicates the code a lot.
Created attachment 141976 [details] Patch
Created attachment 141977 [details] Patch
Created attachment 141978 [details] Patch
Created attachment 141979 [details] Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=141978&action=review > Source/WebCore/inspector/front-end/HeapSnapshotView.js:530 > this.baseSelectElement.removeStyleClass("hidden"); > if (!this.dataGrid.snapshotView) { > this._changeBase(); > - this.dataGrid.setDataSource(this, this.profileWrapper); > + var snapshotProxy = this.profile.snapshotProxy(); > + // If snapshot has not been loaded yet the data source will be set by the initial load > + // callback(called in HeapSnapshotView constructor) > + if (snapshotProxy) > + this.dataGrid.setDataSource(this, snapshotProxy); > } > } else { > this.baseSelectElement.addStyleClass("hidden"); > - if (!this.dataGrid.snapshotView) > - this.dataGrid.setDataSource(this, this.profileWrapper); > + if (!this.dataGrid.snapshotView) { > + var snapshotProxy = this.profile.snapshotProxy(); > + // If snapshot has not been loaded yet the data source will be set by the initial load > + // callback(called in HeapSnapshotView constructor) > + if (snapshotProxy) > + this.dataGrid.setDataSource(this, snapshotProxy); > + } > } looks weird > Source/WebCore/inspector/front-end/HeapSnapshotView.js:833 > + ProfilerAgent.getProfile(this.typeId, this.uid, function() {}); please remove empty callback.
Created attachment 142189 [details] Patch
(In reply to comment #5) > View in context: https://bugs.webkit.org/attachment.cgi?id=141978&action=review > > > Source/WebCore/inspector/front-end/HeapSnapshotView.js:530 > > this.baseSelectElement.removeStyleClass("hidden"); > > if (!this.dataGrid.snapshotView) { > > this._changeBase(); > > - this.dataGrid.setDataSource(this, this.profileWrapper); > > + var snapshotProxy = this.profile.snapshotProxy(); > > + // If snapshot has not been loaded yet the data source will be set by the initial load > > + // callback(called in HeapSnapshotView constructor) > > + if (snapshotProxy) > > + this.dataGrid.setDataSource(this, snapshotProxy); > > } > > } else { > > this.baseSelectElement.addStyleClass("hidden"); > > - if (!this.dataGrid.snapshotView) > > - this.dataGrid.setDataSource(this, this.profileWrapper); > > + if (!this.dataGrid.snapshotView) { > > + var snapshotProxy = this.profile.snapshotProxy(); > > + // If snapshot has not been loaded yet the data source will be set by the initial load > > + // callback(called in HeapSnapshotView constructor) > > + if (snapshotProxy) > > + this.dataGrid.setDataSource(this, snapshotProxy); > > + } > > } > > looks weird > Fixed. > > Source/WebCore/inspector/front-end/HeapSnapshotView.js:833 > > + ProfilerAgent.getProfile(this.typeId, this.uid, function() {}); > > please remove empty callback. Done.
Comment on attachment 142189 [details] Patch lgtm
Committed r117234: <http://trac.webkit.org/changeset/117234>