summaryrefslogtreecommitdiffstats
path: root/WebCore/inspector/front-end/ProfilesPanel.js
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/inspector/front-end/ProfilesPanel.js')
-rw-r--r--WebCore/inspector/front-end/ProfilesPanel.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/WebCore/inspector/front-end/ProfilesPanel.js b/WebCore/inspector/front-end/ProfilesPanel.js
index ca02f9e..0aa4174 100644
--- a/WebCore/inspector/front-end/ProfilesPanel.js
+++ b/WebCore/inspector/front-end/ProfilesPanel.js
@@ -386,6 +386,20 @@ WebInspector.ProfilesPanel.prototype = {
return result;
},
+ hasTemporaryProfile: function(typeId)
+ {
+ var profilesCount = this._profiles.length;
+ for (var i = 0; i < profilesCount; ++i)
+ if (this._profiles[i].typeId === typeId && this._profiles[i].isTemporary)
+ return true;
+ return false;
+ },
+
+ hasProfile: function(profile)
+ {
+ return !!this._profilesIdMap[this._makeKey(profile.uid, profile.typeId)];
+ },
+
updateProfile: function(profile)
{
var profilesCount = this._profiles.length;
@@ -443,12 +457,12 @@ WebInspector.ProfilesPanel.prototype = {
if (!(titleKey in this._profileGroupsForLinks))
this._profileGroupsForLinks[titleKey] = 0;
- groupNumber = ++this._profileGroupsForLinks[titleKey];
+ var groupNumber = ++this._profileGroupsForLinks[titleKey];
if (groupNumber > 2)
// The title is used in the console message announcing that a profile has started so it gets
// incremented twice as often as it's displayed
- title += " " + WebInspector.UIString("Run %d", groupNumber / 2);
+ title += " " + WebInspector.UIString("Run %d", (groupNumber + 1) / 2);
}
return title;
@@ -538,10 +552,11 @@ WebInspector.ProfilesPanel.prototype = {
profileHeaders.sort(function(a, b) { return a.uid - b.uid; });
var profileHeadersLength = profileHeaders.length;
for (var i = 0; i < profileHeadersLength; ++i)
- WebInspector.addProfileHeader(profileHeaders[i]);
+ if (!this.hasProfile(profileHeaders[i]))
+ WebInspector.addProfileHeader(profileHeaders[i]);
}
- InspectorBackend.getProfileHeaders(populateCallback);
+ InspectorBackend.getProfileHeaders(populateCallback.bind(this));
this._profilesWereRequested = true;
},