http://trac.webkit.org/changeset/112994
https://bugs.webkit.org/show_bug.cgi?id=83008
This patch has to wait until v8 roll. (Requested by loislo on
#webkit).
Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-04-03
* bindings/js/ScriptHeapSnapshot.h:
* bindings/v8/ScriptHeapSnapshot.cpp:
(WebCore):
* bindings/v8/ScriptHeapSnapshot.h:
(WebCore):
(ScriptHeapSnapshot):
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::createSnapshotHeader):
* inspector/front-end/DetailedHeapshotView.js:
(WebInspector.HeapSnapshotConstructorsDataGrid):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype.setDataSource):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype.populateChildren):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged.firstSnapshotLoaded):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged.secondSnapshotLoaded):
(WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged):
(WebInspector.DetailedHeapshotView.prototype._changeFilter):
* inspector/front-end/HeapSnapshot.js:
(WebInspector.HeapSnapshot.prototype.get maxNodeId):
(WebInspector.HeapSnapshot.prototype.updateStaticData):
* inspector/front-end/HeapSnapshotProxy.js:
(WebInspector.HeapSnapshotProxy.prototype.get maxNodeId):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112996
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-04-03 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r112994.
+ http://trac.webkit.org/changeset/112994
+ https://bugs.webkit.org/show_bug.cgi?id=83008
+
+ This patch has to wait until v8 roll. (Requested by loislo on
+ #webkit).
+
+ * bindings/js/ScriptHeapSnapshot.h:
+ * bindings/v8/ScriptHeapSnapshot.cpp:
+ (WebCore):
+ * bindings/v8/ScriptHeapSnapshot.h:
+ (WebCore):
+ (ScriptHeapSnapshot):
+ * inspector/InspectorProfilerAgent.cpp:
+ (WebCore::InspectorProfilerAgent::createSnapshotHeader):
+ * inspector/front-end/DetailedHeapshotView.js:
+ (WebInspector.HeapSnapshotConstructorsDataGrid):
+ (WebInspector.HeapSnapshotConstructorsDataGrid.prototype.setDataSource):
+ (WebInspector.HeapSnapshotConstructorsDataGrid.prototype.populateChildren):
+ (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged.firstSnapshotLoaded):
+ (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged.secondSnapshotLoaded):
+ (WebInspector.HeapSnapshotConstructorsDataGrid.prototype._filterSelectIndexChanged):
+ (WebInspector.DetailedHeapshotView.prototype._changeFilter):
+ * inspector/front-end/HeapSnapshot.js:
+ (WebInspector.HeapSnapshot.prototype.get maxNodeId):
+ (WebInspector.HeapSnapshot.prototype.updateStaticData):
+ * inspector/front-end/HeapSnapshotProxy.js:
+ (WebInspector.HeapSnapshotProxy.prototype.get maxNodeId):
+
2012-03-28 Ilya Tikhonovsky <loislo@chromium.org>
Web Inspector: use maxJSObjectId that is provided by back-end.
namespace WebCore {
-typedef uint32_t SnapshotObjectId;
-
class ScriptHeapSnapshot : public RefCounted<ScriptHeapSnapshot> {
public:
class OutputStream {
unsigned int uid() const { return 0; }
void writeJSON(OutputStream*) { }
- SnapshotObjectId maxSnapshotJSObjectId() const { return 0; }
private:
ScriptHeapSnapshot() { }
return m_snapshot->GetUid();
}
-SnapshotObjectId ScriptHeapSnapshot::maxSnapshotJSObjectId() const
-{
- return m_snapshot->GetMaxSnapshotJSObjectId();
-}
-
namespace {
class OutputStreamAdapter : public v8::OutputStream {
namespace WebCore {
class InspectorObject;
-typedef uint32_t SnapshotObjectId;
class ScriptHeapSnapshot : public RefCounted<ScriptHeapSnapshot> {
public:
String title() const;
unsigned int uid() const;
void writeJSON(OutputStream* stream);
- SnapshotObjectId maxSnapshotJSObjectId() const;
private:
ScriptHeapSnapshot(const v8::HeapSnapshot* snapshot)
header->setString("title", snapshot.title());
header->setNumber("uid", snapshot.uid());
header->setString("typeId", String(HeapProfileType));
- header->setNumber("maxJSObjectId", snapshot.maxSnapshotJSObjectId());
return header;
}
retainedSize: { title: WebInspector.UIString("Retained Size"), width: "120px", sort: "descending", sortable: true }
};
WebInspector.HeapSnapshotSortableDataGrid.call(this, columns);
- this._profileIndex = -1;
+ this._filterProfileIndex = -1;
}
WebInspector.HeapSnapshotConstructorsDataGrid.prototype = {
{
this.snapshotView = snapshotView;
this.snapshot = snapshot;
- if (this._profileIndex === -1)
+ if (this._filterProfileIndex === -1)
this.populateChildren();
},
this.removeChildren();
this.resetSortingCache();
- var key = this._profileIndex === -1 ? "allObjects" : this._minNodeId + ".." + this._maxNodeId;
- var filter = this._profileIndex === -1 ? null : "function(node) { var id = node.id; return id > " + this._minNodeId + " && id <= " + this._maxNodeId + "; }";
+ var key = this._filterProfileIndex === -1 ? "allObjects" : this._minNodeId + ".." + this._maxNodeId;
+ var filter = this._filterProfileIndex === -1 ? null : "function(node) { var id = node.id; return id > " + this._minNodeId + " && id <= " + this._maxNodeId + "; }";
this.snapshot.aggregates(false, key, filter, aggregatesReceived.bind(this, key));
},
- _filterSelectIndexChanged: function(profiles, profileIndex)
+ _filterSelectIndexChanged: function(loader, profileIndex)
{
- this._profileIndex = profileIndex;
+ this._filterProfileIndex = profileIndex;
delete this._maxNodeId;
delete this._minNodeId;
- if (this._profileIndex !== -1) {
- this._minNodeId = profileIndex > 0 ? profiles[profileIndex - 1].maxJSObjectId : 0;
- this._maxNodeId = profiles[profileIndex].maxJSObjectId;
+ if (this._filterProfileIndex === -1) {
+ this.populateChildren();
+ return;
}
- this.populateChildren();
+ function firstSnapshotLoaded(snapshot)
+ {
+ this._maxNodeId = snapshot.maxNodeId;
+ if (profileIndex > 0)
+ loader(profileIndex - 1, secondSnapshotLoaded.bind(this));
+ else {
+ this._minNodeId = 0;
+ this.populateChildren();
+ }
+ }
+
+ function secondSnapshotLoaded(snapshot)
+ {
+ this._minNodeId = snapshot.maxNodeId;
+ this.populateChildren();
+ }
+
+ loader(profileIndex, firstSnapshotLoaded.bind(this));
},
};
_changeFilter: function()
{
var profileIndex = this.filterSelectElement.selectedIndex - 1;
- this.dataGrid._filterSelectIndexChanged(this._profiles(), profileIndex);
+ this.dataGrid._filterSelectIndexChanged(this._loadProfileByIndex.bind(this), profileIndex);
if (!this.currentQuery || !this._searchFinishedCallback || !this._searchResults)
return;
return new WebInspector.HeapSnapshotNode(this, this._rootNodeIndex);
},
+ get maxNodeId()
+ {
+ if (typeof this._maxNodeId === "number")
+ return this._maxNodeId;
+ this._maxNodeId = 0;
+ for (var nodeIdIndex = this._nodeIdOffset; nodeIdIndex < this._onlyNodes.length; nodeIdIndex += this._nodeFieldCount) {
+ var id = this._onlyNodes[nodeIdIndex];
+ if ((id % 2) && id > this._maxNodeId)
+ this._maxNodeId = id;
+ }
+ return this._maxNodeId;
+ },
+
get rootNodeIndex()
{
return this._rootNodeIndex;
updateStaticData: function()
{
- return {nodeCount: this.nodeCount, rootNodeIndex: this._rootNodeIndex, totalSize: this.totalSize, uid: this.uid, nodeFlags: this._nodeFlags};
+ return {nodeCount: this.nodeCount, rootNodeIndex: this._rootNodeIndex, totalSize: this.totalSize, uid: this.uid, nodeFlags: this._nodeFlags, maxNodeId: this.maxNodeId};
}
};
return !!this._objectId;
},
+ get maxNodeId()
+ {
+ return this._staticData.maxNodeId;
+ },
+
get nodeCount()
{
return this._staticData.nodeCount;