This commit is contained in:
Danny Coates 2010-12-01 00:48:07 -07:00
Родитель 2957655562
Коммит e51ec8d997
3 изменённых файлов: 48 добавлений и 3 удалений

Просмотреть файл

@ -3944,6 +3944,10 @@ 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);
}

Просмотреть файл

@ -107,7 +107,7 @@ WebInspector.InspectorFrontendHostStub.prototype = {
hiddenPanels: function()
{
return "elements,resources,timeline,profiles,network,audits";
return "elements,resources,timeline,network,audits";
},
inspectedURLChanged: function(url)

Просмотреть файл

@ -471,8 +471,25 @@ exports.create = function (conn, debuggerPort, config) {
},
enableProfiler: {
value: function(always) {
// TODO: evaluate if profiling is enabled
sendEvent('profilerWasEnabled');
evaluate('process.profiler !== undefined', null, function(msg) {
if (msg.body.value) {
sendEvent('profilerWasEnabled');
}
else {
sendEvent('showPanel', { name: 'console' });
sendEvent('addConsoleMessage', {
messageObj: {
source: 3,
type: 0,
level: 2,
line: 0,
url: '',
repeatCount: 1,
message: 'you must require("v8-profiler") before using the profiler'
}
});
}
});
}
},
disableProfiler: {
@ -757,6 +774,30 @@ exports.create = function (conn, debuggerPort, config) {
}
}
});
evaluate('process.profiler.snapshotCount()', null, function(msg1) {
var i, count;
if (msg1.success) {
for (i = 0, count = msg1.body.value; i < count; i++) {
evaluate('process.profiler.getSnapshot(' + i + ')', null, function(msg){
if (msg.success) {
var refs = {};
profile = {};
if (msg.refs && Array.isArray(msg.refs)) {
var obj = msg.body;
var objProps = obj.properties;
msg.refs.forEach(function(r) {
refs[r.handle] = r;
});
objProps.forEach(function(p) {
profile[String(p.name)] = refToObject(refs[p.ref]).description;
});
}
sendProfileHeader(parseInt(profile.uid, 10), "HEAP");
}
});
}
}
});
}
},
getProfile: {