Skip to content

Commit

Permalink
Can now click on diagnostics
Browse files Browse the repository at this point in the history
  • Loading branch information
bgirard committed Sep 17, 2012
1 parent fef736d commit 6725c18
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
17 changes: 15 additions & 2 deletions js/parserWorker.js
Expand Up @@ -1113,6 +1113,7 @@ var diagnosticList = [
{
image: "js.png",
title: "Bug 772916 - Gradients are slow on mobile",
bugNumber: "772916",
check: function(frames, symbols, meta) {

return stepContains('PaintGradient', frames, symbols)
Expand All @@ -1123,6 +1124,7 @@ var diagnosticList = [
{
image: "js.png",
title: "Bug 789193 - AMI_startup() takes 200ms on startup",
bugNumber: "789193",
check: function(frames, symbols, meta) {

return stepContains('AMI_startup()', frames, symbols)
Expand All @@ -1132,6 +1134,7 @@ var diagnosticList = [
{
image: "js.png",
title: "Bug 789185 - LoginManagerStorage_mozStorage.init() takes 300ms on startup ",
bugNumber: "789185",
check: function(frames, symbols, meta) {

return stepContains('LoginManagerStorage_mozStorage.prototype.init()', frames, symbols)
Expand All @@ -1142,6 +1145,7 @@ var diagnosticList = [
{
image: "js.png",
title: "JS - Bug 767070 - Text selection performance is bad on android",
bugNumber: "767070",
check: function(frames, symbols, meta) {

if (!stepContains('FlushPendingNotifications', frames, symbols))
Expand All @@ -1156,6 +1160,7 @@ var diagnosticList = [
{
image: "js.png",
title: "JS - Bug 765930 - Reader Mode: Optimize readability check",
bugNumber: "765930",
check: function(frames, symbols, meta) {

return stepContains('Readability.js', frames, symbols)
Expand Down Expand Up @@ -1407,14 +1412,22 @@ function calculateDiagnosticItems(requestID, profileID, meta) {
if (!pendingDiagnosticInfo)
return;

diagnosticItems.push({
var diagnostic = pendingDiagnosticInfo.diagnostic;
var currDiagnostic = {
x: pendingDiagnosticInfo.x / widthSum,
width: (endX - pendingDiagnosticInfo.x) / widthSum,
imageFile: pendingDiagnosticInfo.diagnostic.image,
title: pendingDiagnosticInfo.diagnostic.title,
details: pendingDiagnosticInfo.details,
onclickDetails: pendingDiagnosticInfo.onclickDetails
});
};

if (!currDiagnostic.onclickDetails && diagnostic.bugNumber) {
currDiagnostic.onclickDetails = "bug " + diagnostic.bugNumber;
}

diagnosticItems.push(currDiagnostic);

pendingDiagnosticInfo = null;
}

Expand Down
11 changes: 8 additions & 3 deletions js/ui.js
Expand Up @@ -1485,9 +1485,14 @@ function enterFinishedProfileUI() {

gDiagnosticBar = new DiagnosticBar();
gDiagnosticBar.setDetailsListener(function(details) {
var sourceView = new SourceView();
sourceView.setText("Diagnostic", js_beautify(details));
gMainArea.appendChild(sourceView.getContainer());
if (details.indexOf("bug ") == 0) {
dump("here\n");
window.open('https://bugzilla.mozilla.org/show_bug.cgi?id=' + details.substring(4));
} else {
var sourceView = new SourceView();
sourceView.setText("Diagnostic", js_beautify(details));
gMainArea.appendChild(sourceView.getContainer());
}
});
currRow = finishedProfilePane.insertRow(rowIndex++);
currRow.insertCell(0).appendChild(gDiagnosticBar.getContainer());
Expand Down

0 comments on commit 6725c18

Please sign in to comment.