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

Unified Diff: WebCore/inspector/front-end/ProfilesPanel.js

Issue 5657001: Merge 73229 - 2010-12-02 Mikhail Naganov <mnaganov@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years 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 | « WebCore/inspector/front-end/HeapSnapshotView.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/inspector/front-end/ProfilesPanel.js
===================================================================
--- WebCore/inspector/front-end/ProfilesPanel.js (revision 73362)
+++ WebCore/inspector/front-end/ProfilesPanel.js (working copy)
@@ -411,6 +411,50 @@
}
},
+ loadHeapSnapshot: function(uid, callback)
+ {
+ var profile = this._profilesIdMap[this._makeKey(uid, WebInspector.HeapSnapshotProfileType.TypeId)];
+ if (!profile)
+ return;
+
+ if (profile._loaded)
+ callback(profile);
+ else if (profile._is_loading)
+ profile._callbacks.push(callback);
+ else {
+ profile._is_loading = true;
+ profile._callbacks = [callback];
+ profile._json = "";
+ InspectorBackend.getProfile(profile.typeId, profile.uid);
+ }
+ },
+
+ addHeapSnapshotChunk: function(uid, chunk)
+ {
+ var profile = this._profilesIdMap[this._makeKey(uid, WebInspector.HeapSnapshotProfileType.TypeId)];
+ if (!profile || profile._loaded || !profile._is_loading)
+ return;
+
+ profile._json += chunk;
+ },
+
+ finishHeapSnapshot: function(uid)
+ {
+ var profile = this._profilesIdMap[this._makeKey(uid, WebInspector.HeapSnapshotProfileType.TypeId)];
+ if (!profile || profile._loaded || !profile._is_loading)
+ return;
+
+ var callbacks = profile._callbacks;
+ delete profile._callbacks;
+ var loadedSnapshot = JSON.parse(profile._json);
+ delete profile._json;
+ delete profile._is_loading;
+ profile._loaded = true;
+ WebInspector.HeapSnapshotView.prototype.processLoadedSnapshot(profile, loadedSnapshot);
+ for (var i = 0; i < callbacks.length; ++i)
+ callbacks[i](profile);
+ },
+
showView: function(view)
{
this.showProfile(view.profile);
« no previous file with comments | « WebCore/inspector/front-end/HeapSnapshotView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698