Commit 6b73dbb5 authored by eroman@chromium.org's avatar eroman@chromium.org

Add the ability to click on source locations in about:profiler, and have it...

Add the ability to click on source locations in about:profiler, and have it jump to the corresponding source file + line number.

BUG=100992
Review URL: http://codereview.chromium.org/8565037

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110011 0039d316-1c4b-4281-b951-d872f2087c98
parent d17e1b33
...@@ -1000,6 +1000,26 @@ var MainView = (function() { ...@@ -1000,6 +1000,26 @@ var MainView = (function() {
if (cellAlignment) if (cellAlignment)
td.align = 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 // 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 // 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 // really big. We solve this using a hack: insert a <wbr> element after
...@@ -1007,10 +1027,10 @@ var MainView = (function() { ...@@ -1007,10 +1027,10 @@ var MainView = (function() {
// value, and hence avoid it overflowing! // value, and hence avoid it overflowing!
var kMinLengthBeforeWrap = 20; var kMinLengthBeforeWrap = 20;
addText(td, text.substr(0, kMinLengthBeforeWrap)); addText(parent, text.substr(0, kMinLengthBeforeWrap));
for (var i = kMinLengthBeforeWrap; i < text.length; ++i) { for (var i = kMinLengthBeforeWrap; i < text.length; ++i) {
addNode(td, 'wbr'); addNode(parent, 'wbr');
addText(td, text.substr(i, 1)); addText(parent, text.substr(i, 1));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment