Permalink
Browse files

display profile name when available

  • Loading branch information...
1 parent e51ec8d commit e57f583b98769b90a629b7a9007a604cb3e54722 @dannycoates dannycoates committed Dec 2, 2010
Showing with 25 additions and 12 deletions.
  1. +2 −2 front-end/ProfileView.js
  2. +5 −5 front-end/inspector.css
  3. +18 −5 lib/session.js
@@ -580,7 +580,7 @@ WebInspector.CPUProfileType.TypeId = "CPU";
WebInspector.CPUProfileType.prototype = {
get buttonTooltip()
{
- return this._recording ? WebInspector.UIString("Stop profiling.") : WebInspector.UIString("Start profiling.");
+ return WebInspector.UIString("Refresh panel.");
},
get buttonStyle()
@@ -600,7 +600,7 @@ WebInspector.CPUProfileType.prototype = {
get welcomeMessage()
{
- return WebInspector.UIString("Control CPU profiling by pressing the %s button on the status bar.");
+ return WebInspector.UIString("");
},
setRecordingProfile: function(isProfiling)
@@ -3943,20 +3943,20 @@ body.inactive li.selected .bubble.search-matches {
button.enable-toggle-status-bar-item .glyph {
}
-
+/*
.record-profile-status-bar-item {
display: none;
}
-
+*/
.record-profile-status-bar-item .glyph {
- -webkit-mask-image: url(Images/recordButtonGlyph.png);
+ -webkit-mask-image: url(Images/reloadButtonGlyph.png);
}
-
+/*
.record-profile-status-bar-item.toggled-on .glyph {
-webkit-mask-image: url(Images/recordToggledButtonGlyph.png);
background-color: rgb(216, 0, 0) !important;
}
-
+*/
/* FIXME: should have its own glyph. */
.heap-snapshot-status-bar-item .glyph {
-webkit-mask-image: url(Images/focusButtonGlyph.png);
View
@@ -192,10 +192,10 @@ exports.create = function (conn, debuggerPort, config) {
});
}
- function sendProfileHeader(uid, type) {
+ function sendProfileHeader(title, uid, type) {
sendEvent('addProfileHeader', {
header: {
- title: "org.webkit.profiles.user-initiated." + uid,
+ title: title,
uid: uid,
typeId: type
}});
@@ -721,9 +721,18 @@ exports.create = function (conn, debuggerPort, config) {
//Profiler
startProfiling: {
value: function() {
+ /* HACK
+ * changed the behavior here since using eval doesn't profile the correct
+ * context. Using as a 'refresh' in the mean time
+ * Remove this hack once we can trigger a profile in the proper context
+ */
+ /*
evaluate('process.profiler.startProfiling("org.webkit.profiles.user-initiated.' + (++cpuProfileCount) + '")', null, function(msg) {
sendEvent('setRecordingProfile', { isProfiling: true });
});
+ */
+ sendEvent('setRecordingProfile', { isProfiling: false });
+ this.getProfileHeaders();
}
},
stopProfiling: {
@@ -768,7 +777,7 @@ exports.create = function (conn, debuggerPort, config) {
profile[String(p.name)] = refToObject(refs[p.ref]).description;
});
}
- sendProfileHeader(parseInt(profile.uid, 10), "CPU");
+ sendProfileHeader(profile.title, parseInt(profile.uid, 10), "CPU");
}
});
}
@@ -792,7 +801,11 @@ exports.create = function (conn, debuggerPort, config) {
profile[String(p.name)] = refToObject(refs[p.ref]).description;
});
}
- sendProfileHeader(parseInt(profile.uid, 10), "HEAP");
+ var title = profile.title === 'undefined' ? "org.webkit.profiles.user-initiated." + profile.uid : profile.title;
+ sendProfileHeader(
+ title,
+ parseInt(profile.uid, 10),
+ "HEAP");
}
});
}
@@ -851,7 +864,7 @@ exports.create = function (conn, debuggerPort, config) {
profile[String(p.name)] = refToObject(refs[p.ref]).description;
});
}
- sendProfileHeader(parseInt(profile.uid, 10), "HEAP");
+ sendProfileHeader("org.webkit.profiles.user-initiated." + profile.uid, parseInt(profile.uid, 10), "HEAP");
}
});
}

0 comments on commit e57f583

Please sign in to comment.