OSDN Git Service

Merge WebKit at r73109: Initial merge by git.
[android-x86/external-webkit.git] / WebCore / inspector / front-end / ProfilesPanel.js
index 0aa4174..50795e8 100644 (file)
@@ -123,6 +123,7 @@ WebInspector.ProfilesPanel = function()
 
     this._profiles = [];
     this._profilerEnabled = Preferences.profilerAlwaysEnabled;
+    this._tempHeapSnapshots = [];
     this._reset();
 }
 
@@ -411,6 +412,25 @@ WebInspector.ProfilesPanel.prototype = {
             }
     },
 
+    addHeapSnapshotChunk: function(uid, chunk)
+    {
+        if (this._tempHeapSnapshots[uid])
+            this._tempHeapSnapshots[uid] += chunk;
+        else
+            this._tempHeapSnapshots[uid] = chunk;
+    },
+
+    finishHeapSnapshot: function(uid)
+    {
+        var profile =
+            this._profilesIdMap[this._makeKey(uid, WebInspector.HeapSnapshotProfileType.TypeId)];
+        if (profile) {
+            var view = profile.__profilesPanelProfileType.viewForProfile(profile);
+            view.snapshotLoaded(uid, JSON.parse(this._tempHeapSnapshots[uid]));
+        }
+        delete this._tempHeapSnapshots[uid];
+    },
+
     showView: function(view)
     {
         this.showProfile(view.profile);