RESOLVED FIXED 86488
Web Inspector: use separate fields for storing HeapSnapshotLoaderProxy and HeapSnapshotProxy
https://bugs.webkit.org/show_bug.cgi?id=86488
Summary Web Inspector: use separate fields for storing HeapSnapshotLoaderProxy and He...
Yury Semikhatsky
Reported 2012-05-15 08:27:12 PDT
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.
Attachments
Patch (17.47 KB, patch)
2012-05-15 08:33 PDT, Yury Semikhatsky
no flags
Patch (16.92 KB, patch)
2012-05-15 08:34 PDT, Yury Semikhatsky
no flags
Patch (16.92 KB, patch)
2012-05-15 08:36 PDT, Yury Semikhatsky
no flags
Patch (17.00 KB, patch)
2012-05-15 08:38 PDT, Yury Semikhatsky
no flags
Patch (20.81 KB, patch)
2012-05-16 01:32 PDT, Yury Semikhatsky
pfeldman: review+
Yury Semikhatsky
Comment 1 2012-05-15 08:33:24 PDT
Yury Semikhatsky
Comment 2 2012-05-15 08:34:26 PDT
Yury Semikhatsky
Comment 3 2012-05-15 08:36:42 PDT
Yury Semikhatsky
Comment 4 2012-05-15 08:38:35 PDT
Ilya Tikhonovsky
Comment 5 2012-05-15 09:07:42 PDT
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.
Yury Semikhatsky
Comment 6 2012-05-16 01:32:09 PDT
Yury Semikhatsky
Comment 7 2012-05-16 01:32:38 PDT
(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.
Ilya Tikhonovsky
Comment 8 2012-05-16 01:39:27 PDT
Comment on attachment 142189 [details] Patch lgtm
Yury Semikhatsky
Comment 9 2012-05-16 01:47:19 PDT
Note You need to log in before you can comment on or make changes to this bug.