Skip to content

Commit

Permalink
display profile name when available
Browse files Browse the repository at this point in the history
  • Loading branch information
dannycoates committed Dec 2, 2010
1 parent e51ec8d commit e57f583
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
4 changes: 2 additions & 2 deletions front-end/ProfileView.js
Expand Up @@ -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()
Expand All @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions front-end/inspector.css
Expand Up @@ -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);
Expand Down
23 changes: 18 additions & 5 deletions lib/session.js
Expand Up @@ -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
}});
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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");
}
});
}
Expand All @@ -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");
}
});
}
Expand Down Expand Up @@ -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");
}
});
}
Expand Down

0 comments on commit e57f583

Please sign in to comment.