[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
mnaganov at chromium.org
mnaganov at chromium.org
Wed Dec 22 17:56:51 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 51cdb6db52554e46c110d7e55951ed52b669c8da
Author: mnaganov at chromium.org <mnaganov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 3 02:30:41 2010 +0000
2010-12-02 Mikhail Naganov <mnaganov at chromium.org>
Reviewed by Pavel Feldman.
Web Inspector: Fix heap snapshots loading. Loading is now
conducted by the Profiles panel which prevents accidental
simultaneous attempts to load the same profile several times in
parallel.
https://bugs.webkit.org/show_bug.cgi?id=50427
* inspector/front-end/HeapSnapshotView.js:
(WebInspector.HeapSnapshotView.prototype._loadProfile):
(WebInspector.HeapSnapshotView.prototype.processLoadedSnapshot):
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype.loadHeapSnapshot):
(WebInspector.ProfilesPanel.prototype.addHeapSnapshotChunk):
(WebInspector.ProfilesPanel.prototype.finishHeapSnapshot):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73229 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 28d5eb8..68f9ce0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-12-02 Mikhail Naganov <mnaganov at chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Fix heap snapshots loading. Loading is now
+ conducted by the Profiles panel which prevents accidental
+ simultaneous attempts to load the same profile several times in
+ parallel.
+
+ https://bugs.webkit.org/show_bug.cgi?id=50427
+
+ * inspector/front-end/HeapSnapshotView.js:
+ (WebInspector.HeapSnapshotView.prototype._loadProfile):
+ (WebInspector.HeapSnapshotView.prototype.processLoadedSnapshot):
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfilesPanel.prototype.loadHeapSnapshot):
+ (WebInspector.ProfilesPanel.prototype.addHeapSnapshotChunk):
+ (WebInspector.ProfilesPanel.prototype.finishHeapSnapshot):
+
2010-12-02 Chris Marrin <cmarrin at apple.com>
Reviewed by Simon Fraser.
@@ -1435,7 +1454,6 @@
(WebCore::TextFieldInputType::shouldSubmitImplicitly):
* html/TextFieldInputType.h:
->>>>>>> .r73054
2010-11-30 Patrick Gansterer <paroga at webkit.org>
Reviewed by Andreas Kling.
diff --git a/WebCore/inspector/front-end/HeapSnapshotView.js b/WebCore/inspector/front-end/HeapSnapshotView.js
index d09f91d..f349361 100644
--- a/WebCore/inspector/front-end/HeapSnapshotView.js
+++ b/WebCore/inspector/front-end/HeapSnapshotView.js
@@ -242,7 +242,6 @@ WebInspector.HeapSnapshotView = function(parent, profile)
this.percentButton = new WebInspector.StatusBarButton("", "percent-time-status-bar-item status-bar-item");
this.percentButton.addEventListener("click", this._percentClicked.bind(this), false);
- this._loadedCallbacks = [];
this._loadProfile(this.profile, profileCallback.bind(this));
function profileCallback(profile)
@@ -439,14 +438,6 @@ WebInspector.HeapSnapshotView.prototype = {
this._updateSummaryGraph();
},
- snapshotLoaded: function(uid, loadedSnapshot)
- {
- if (!this._loadedCallbacks[uid])
- return;
- this._loadedCallbacks[uid](loadedSnapshot);
- delete this._loadedCallbacks[uid];
- },
-
_changeBase: function()
{
if (this.baseSnapshot.uid === this._getProfiles()[this.baseSelectElement.selectedIndex].uid)
@@ -484,24 +475,16 @@ WebInspector.HeapSnapshotView.prototype = {
_loadProfile: function(profile, callback)
{
- if (profile._loaded) {
- callback(profile);
- return;
- }
-
- this._loadedCallbacks[profile.uid] = processLoadedSnapshot.bind(this);
- InspectorBackend.getProfile(profile.typeId, profile.uid);
+ WebInspector.panels.profiles.loadHeapSnapshot(profile.uid, callback);
+ },
- function processLoadedSnapshot(loadedSnapshot)
- {
- var snapshot = this._convertSnapshot(loadedSnapshot);
- profile.children = snapshot.children;
- profile.entries = snapshot.entries;
- profile.lowlevels = snapshot.lowlevels;
- this._prepareProfile(profile);
- profile._loaded = true;
- callback(profile);
- }
+ processLoadedSnapshot: function(profile, loadedSnapshot)
+ {
+ var snapshot = WebInspector.HeapSnapshotView.prototype._convertSnapshot(loadedSnapshot);
+ profile.children = snapshot.children;
+ profile.entries = snapshot.entries;
+ profile.lowlevels = snapshot.lowlevels;
+ WebInspector.HeapSnapshotView.prototype._prepareProfile(profile);
},
_mouseDownInDataGrid: function(event)
diff --git a/WebCore/inspector/front-end/ProfilesPanel.js b/WebCore/inspector/front-end/ProfilesPanel.js
index 50795e8..86d8d90 100644
--- a/WebCore/inspector/front-end/ProfilesPanel.js
+++ b/WebCore/inspector/front-end/ProfilesPanel.js
@@ -123,7 +123,6 @@ WebInspector.ProfilesPanel = function()
this._profiles = [];
this._profilerEnabled = Preferences.profilerAlwaysEnabled;
- this._tempHeapSnapshots = [];
this._reset();
}
@@ -412,23 +411,48 @@ WebInspector.ProfilesPanel.prototype = {
}
},
+ 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)
{
- if (this._tempHeapSnapshots[uid])
- this._tempHeapSnapshots[uid] += chunk;
- else
- this._tempHeapSnapshots[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) {
- var view = profile.__profilesPanelProfileType.viewForProfile(profile);
- view.snapshotLoaded(uid, JSON.parse(this._tempHeapSnapshots[uid]));
- }
- delete this._tempHeapSnapshots[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)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list