зеркало из https://github.com/mozilla/gecko-dev.git
Bug 347888 - Profiler doesn't guess at function names without some user help.
r=silver (James Ross) Venkman/SeaMonkey only.
This commit is contained in:
Родитель
63552c0f0c
Коммит
6d28bfe523
|
@ -153,6 +153,7 @@ function initCommands()
|
|||
["profile-tb", "profile toggle", 0],
|
||||
["this", "props this", CMD_CONSOLE],
|
||||
["toggle-chrome", "chrome-filter toggle", 0],
|
||||
["toggle-forcescriptload", "toggle-pref profile.forceScriptLoad", 0],
|
||||
["toggle-ias", "startup-init toggle", 0],
|
||||
["toggle-pprint", "pprint toggle", 0],
|
||||
["toggle-profile", "profile toggle", 0],
|
||||
|
|
|
@ -183,6 +183,10 @@ function initMenus()
|
|||
["toggle-profile",
|
||||
{type: "checkbox",
|
||||
checkedif: "console.jsds.flags & COLLECT_PROFILE_DATA"}],
|
||||
["toggle-forcescriptload",
|
||||
{type: "checkbox",
|
||||
checkedif: "console.prefs['profile.forceScriptLoad']"}],
|
||||
["-"],
|
||||
["clear-profile"],
|
||||
["save-profile"],
|
||||
["show-profile"]
|
||||
|
|
|
@ -41,6 +41,7 @@ function initProfiler ()
|
|||
{
|
||||
var prefs =
|
||||
[
|
||||
["profile.forceScriptLoad", false],
|
||||
["profile.template.xml", "chrome://venkman/locale/profile.xml.tpl"],
|
||||
["profile.template.html", "chrome://venkman/locale/profile.html.tpl"],
|
||||
["profile.template.csv", "chrome://venkman/locale/profile.csv.tpl"],
|
||||
|
@ -359,7 +360,7 @@ function pro_rptall (profileReport)
|
|||
{
|
||||
++sectionCount;
|
||||
console.status = getMsg(MSN_PROFILE_SAVING, [i, last]);
|
||||
setTimeout (generateReportChunk, 10, i);
|
||||
setTimeout (generateReportChunk, 10, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -385,7 +386,29 @@ function pro_rptall (profileReport)
|
|||
var length = profileReport.scriptInstanceList.length;
|
||||
var last = length - 1;
|
||||
|
||||
generateReportChunk (0);
|
||||
// If the user asks for it, load all scripts so we can guess function names
|
||||
if (console.prefs["profile.forceScriptLoad"])
|
||||
{
|
||||
function loadedScript(status)
|
||||
{
|
||||
if (++scriptsLoaded == length)
|
||||
generateReportChunk(0);
|
||||
};
|
||||
|
||||
var scriptsLoaded = 0;
|
||||
for (var j = 0; j < length; j++)
|
||||
{
|
||||
var src = profileReport.scriptInstanceList[j].sourceText;
|
||||
if (!src.isLoaded)
|
||||
src.loadSource(loadedScript);
|
||||
else
|
||||
++scriptsLoaded;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
generateReportChunk(0);
|
||||
}
|
||||
}
|
||||
|
||||
console.profiler.loadTemplate =
|
||||
|
|
|
@ -839,6 +839,8 @@ cmd.scan-source.help = Scans the entire source file for comments in the form /
|
|||
|
||||
cmd.scope.help = Lists the properties of the topmost object in the scope chain for the current frame.
|
||||
|
||||
cmd.toggle-forcescriptload.label = &Force function name guessing
|
||||
|
||||
cmd.toggle-functions.label = Include &Functions
|
||||
|
||||
cmd.show-functions.params = [<toggle>]
|
||||
|
|
Загрузка…
Ссылка в новой задаче