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

Side by Side Diff: tools/binary_size/template/index.html

Issue 562623002: Binary size tool: Don't escape text that won't be parsed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pqn_20140908
Patch Set: Created 6 years, 3 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved. 2 Copyright 2014 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be 3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file. 4 found in the LICENSE file.
5 --> 5 -->
6 <html> 6 <html>
7 <head> 7 <head>
8 <title>Binary Size Analysis</title> 8 <title>Binary Size Analysis</title>
9 <script src="d3/d3.js" charset="utf-8"></script> 9 <script src="d3/d3.js" charset="utf-8"></script>
10 <script src="D3SymbolTreeMap.js" charset="utf-8"></script> 10 <script src="D3SymbolTreeMap.js" charset="utf-8"></script>
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 cell.text(recordIndex++); 126 cell.text(recordIndex++);
127 } else if (index === 1) { 127 } else if (index === 1) {
128 cell.text(D3SymbolTreeMap._pretty(record.value)); 128 cell.text(D3SymbolTreeMap._pretty(record.value));
129 } else if (index === 2) { 129 } else if (index === 2) {
130 cell.text(record.t); 130 cell.text(record.t);
131 } else { 131 } else {
132 if (treemap.pathFor(record).indexOf('/out') == 0) { 132 if (treemap.pathFor(record).indexOf('/out') == 0) {
133 cell.append('span').text(treemap.pathFor(record)); 133 cell.append('span').text(treemap.pathFor(record));
134 cell.append('br'); 134 cell.append('br');
135 cell.append('span').text('Symbol: '); 135 cell.append('span').text('Symbol: ');
136 cell.append('span').text(escape(record.n)); 136 cell.append('span').text(record.n);
137 } else { 137 } else {
138 var href = 'https://code.google.com/p/chromium/codesearch#chromi um/src' 138 var href = 'https://code.google.com/p/chromium/codesearch#chromi um/src'
139 + treemap.pathFor(record) 139 + treemap.pathFor(record)
140 + '&q=' 140 + '&q='
141 + escape(record.n); 141 + record.n;
142 cell.append('a') 142 cell.append('a')
143 .attr('href', href) 143 .attr('href', href)
144 .attr('target', '_blank') 144 .attr('target', '_blank')
145 .text(escape(treemap.pathFor(record))); 145 .text(treemap.pathFor(record));
146 cell.append('br'); 146 cell.append('br');
147 cell.append('span').text('Symbol: '); 147 cell.append('span').text('Symbol: ');
148 cell.append('span').text(escape(record.n)); 148 cell.append('span').text(record.n);
149 } 149 }
150 } 150 }
151 }; 151 };
152 showReport('100 Largest Symbols', list, headers, dataFunction, styleFunction ); 152 showReport('100 Largest Symbols', list, headers, dataFunction, styleFunction );
153 } 153 }
154 154
155 function bigPathsReport() { 155 function bigPathsReport() {
156 var list = treemap.biggestPaths(100); 156 var list = treemap.biggestPaths(100);
157 var headers = ['Rank', 'Size (Bytes)', 'Location']; 157 var headers = ['Rank', 'Size (Bytes)', 'Location'];
158 var styleFunction = function(selection, index) { 158 var styleFunction = function(selection, index) {
159 if (index === 2) { 159 if (index === 2) {
160 selection.style('font-family', 'monospace'); 160 selection.style('font-family', 'monospace');
161 } 161 }
162 }; 162 };
163 var recordIndex = 1; 163 var recordIndex = 1;
164 var dataFunction = function(record, index, cell) { 164 var dataFunction = function(record, index, cell) {
165 if (index === 0) { 165 if (index === 0) {
166 cell.text(recordIndex++); 166 cell.text(recordIndex++);
167 } else if (index === 1) { 167 } else if (index === 1) {
168 cell.text(D3SymbolTreeMap._pretty(record.value)); 168 cell.text(D3SymbolTreeMap._pretty(record.value));
169 } else if (index === 2) { 169 } else if (index === 2) {
170 if (treemap.pathFor(record).indexOf('/out') == 0) { 170 if (treemap.pathFor(record).indexOf('/out') == 0) {
171 cell.text(treemap.pathFor(record)); 171 cell.text(treemap.pathFor(record));
172 } else { 172 } else {
173 var href = 'https://code.google.com/p/chromium/codesearch#chromi um/src' + treemap.pathFor(record); 173 var href = 'https://code.google.com/p/chromium/codesearch#chromi um/src' + treemap.pathFor(record);
174 cell.append('a') 174 cell.append('a')
175 .attr('href', href) 175 .attr('href', href)
176 .attr('target', '_blank') 176 .attr('target', '_blank')
177 .text(escape(treemap.pathFor(record))); 177 .text(treemap.pathFor(record));
178 } 178 }
179 179
180 } 180 }
181 }; 181 };
182 showReport('100 Largest Paths', list, headers, dataFunction, styleFunction); 182 showReport('100 Largest Paths', list, headers, dataFunction, styleFunction);
183 } 183 }
184 184
185 function symbolFilterTextChanged() { 185 function symbolFilterTextChanged() {
186 if (filterChanging) return true; 186 if (filterChanging) return true;
187 filterChanging = true; 187 filterChanging = true;
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 </td> 516 </td>
517 </tr> 517 </tr>
518 </table> 518 </table>
519 </td></tr> 519 </td></tr>
520 <tr><td style='padding-top: 10px; text-align: right; border-top: 1px solid grey' > 520 <tr><td style='padding-top: 10px; text-align: right; border-top: 1px solid grey' >
521 <input type='button' value='Apply' onclick='applySettings()'> 521 <input type='button' value='Apply' onclick='applySettings()'>
522 <input type='button' value='Cancel' onclick='cancelSettings()'> 522 <input type='button' value='Cancel' onclick='cancelSettings()'>
523 </td></tr></table> 523 </td></tr></table>
524 </body> 524 </body>
525 </html> 525 </html>
OLDNEW
« 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