Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2331)

Unified Diff: chrome/browser/resources/tracking.js

Issue 8565037: Add the ability to click on source locations in about:profiler, and have it jump to the correspon... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: make sure long lines wrap Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/tracking.js
===================================================================
--- chrome/browser/resources/tracking.js (revision 109948)
+++ chrome/browser/resources/tracking.js (working copy)
@@ -1000,6 +1000,26 @@
if (cellAlignment)
td.align = cellAlignment;
+ var parent = td;
+
+ if (key == KEY_SOURCE_LOCATION) {
+ // Linkify the source column so it jumps to the source code. This doesn't
+ // take into account the particular code this build was compiled from, or
+ // local edits to source. It should however work correctly for top of tree
+ // builds.
+ var m = /^(.*) \[(\d+)\]$/.exec(text);
+ if (m) {
+ var link = addNode(td, 'a');
+ // http://chromesrc.appspot.com is a server I wrote specifically for
+ // this task. It redirects to the appropriate source file; the file
+ // paths given by the compiler can be pretty crazy and different
+ // between platforms.
+ link.href = 'http://chromesrc.appspot.com/?path=' +
+ encodeURIComponent(m[1]) + '&line=' + m[2];
+ parent = link;
+ }
+ }
+
// String values can get pretty long. If the string contains no spaces, then
// CSS fails to wrap it, and it overflows the cell causing the table to get
// really big. We solve this using a hack: insert a <wbr> element after
@@ -1007,10 +1027,10 @@
// value, and hence avoid it overflowing!
var kMinLengthBeforeWrap = 20;
- addText(td, text.substr(0, kMinLengthBeforeWrap));
+ addText(parent, text.substr(0, kMinLengthBeforeWrap));
for (var i = kMinLengthBeforeWrap; i < text.length; ++i) {
- addNode(td, 'wbr');
- addText(td, text.substr(i, 1));
+ addNode(parent, 'wbr');
+ addText(parent, text.substr(i, 1));
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698