Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: Source/WebCore/inspector/front-end/DetailedHeapshotGridNodes.js

Issue 7218041: Merge 89666 - 2011-06-23 Mikhail Naganov <mnaganov@chromium.org> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/782/
Patch Set: Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/WebCore/inspector/front-end/DetailedHeapshotView.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/inspector/front-end/DetailedHeapshotGridNodes.js
===================================================================
--- Source/WebCore/inspector/front-end/DetailedHeapshotGridNodes.js (revision 89996)
+++ Source/WebCore/inspector/front-end/DetailedHeapshotGridNodes.js (working copy)
@@ -54,6 +54,13 @@
node.dispose();
},
+ hasHoverMessage: false,
+
+ hoverMessage: function(callback)
+ {
+ callback("");
+ },
+
_populate: function(event)
{
this.removeEventListener("populate", this._populate, this);
@@ -172,6 +179,14 @@
this._retainedSize = node.retainedSize;
this.snapshotNodeId = node.id;
this.snapshotNodeIndex = node.nodeIndex;
+ if (this._type === "string")
+ this.hasHoverMessage = true;
+ else if (this._type === "object" && this.isDOMWindow(this._name)) {
+ var url = [];
+ this._name = this.shortenWindowURL(this._name, false, url);
+ this._url = url[0];
+ this.hasHoverMessage = true;
+ }
};
WebInspector.HeapSnapshotGenericObjectNode.prototype = {
@@ -247,6 +262,14 @@
return this._enhanceData ? this._enhanceData(data) : data;
},
+ hoverMessage: function(callback)
+ {
+ if (this._type === "string")
+ callback("\"" + this._name + "\"", "console-formatted-string");
+ else if (this._url)
+ callback(this._url, "console-formatted-object");
+ },
+
get _retainedSizePercent()
{
return this._retainedSize / this.dataGrid.snapshot.totalSize * 100.0;
@@ -264,6 +287,27 @@
this.hasChildren = !isEmpty;
}
this._provider.isEmpty(isEmptyCallback.bind(this));
+ },
+
+ isDOMWindow: function(fullName)
+ {
+ return fullName.substr(0, 9) === "DOMWindow";
+ },
+
+ shortenWindowURL: function(fullName, hasObjectId, fullURLPtr)
+ {
+ var startPos = fullName.indexOf("/");
+ var endPos = hasObjectId ? fullName.indexOf("@") : fullName.length;
+ if (startPos !== -1 && endPos !== -1) {
+ var fullURL = fullName.substring(startPos + 1, endPos).trimLeft();
+ if (fullURLPtr)
+ fullURLPtr[0] = fullURL;
+ var url = fullURL.trimURL();
+ if (url.length > 40)
+ url = url.trimMiddle(40);
+ return fullName.substr(0, startPos + 2) + url + fullName.substr(endPos);
+ } else
+ return fullName;
}
}
« no previous file with comments | « no previous file | Source/WebCore/inspector/front-end/DetailedHeapshotView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698