OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2017 The Chromium Authors. All rights reserved. | 3 Copyright 2017 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/tracing/value/histogram_set.html"> | 8 <link rel="import" href="/tracing/value/histogram_set.html"> |
9 | 9 |
10 <script> | 10 <script> |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } | 155 } |
156 | 156 |
157 if (!existing.canAddHistogram(histogram)) { | 157 if (!existing.canAddHistogram(histogram)) { |
158 // Remember all of the original unmergeable Histograms so that | 158 // Remember all of the original unmergeable Histograms so that |
159 // filter() can keep the rows that match the given HistogramSet even | 159 // filter() can keep the rows that match the given HistogramSet even |
160 // if the rows will only be able to display (unmergeable). | 160 // if the rows will only be able to display (unmergeable). |
161 const unmergeableHistograms = new tr.v.HistogramSet([histogram]); | 161 const unmergeableHistograms = new tr.v.HistogramSet([histogram]); |
162 const mergedFrom = existing.diagnostics.get( | 162 const mergedFrom = existing.diagnostics.get( |
163 tr.v.d.RESERVED_NAMES.MERGED_FROM); | 163 tr.v.d.RESERVED_NAMES.MERGED_FROM); |
164 if (mergedFrom !== undefined) { | 164 if (mergedFrom !== undefined) { |
165 for (const origHist of mergedFrom) { | 165 for (const [unusedName, origHist] of mergedFrom) { |
166 unmergeableHistograms.addHistogram(origHist); | 166 unmergeableHistograms.addHistogram(origHist); |
167 } | 167 } |
168 } | 168 } |
169 row.columns.set(columnName, unmergeableHistograms); | 169 row.columns.set(columnName, unmergeableHistograms); |
170 continue; | 170 continue; |
171 } | 171 } |
172 | 172 |
173 if (existing.name !== histogram.name) { | 173 if (existing.name !== histogram.name) { |
174 // It won't make sense to merge relationships for this merged | 174 // It won't make sense to merge relationships for this merged |
175 // Histogram. | 175 // Histogram. |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 } | 251 } |
252 | 252 |
253 if (histograms.lookupHistogram(testHist.guid) !== undefined) { | 253 if (histograms.lookupHistogram(testHist.guid) !== undefined) { |
254 found = true; | 254 found = true; |
255 break; | 255 break; |
256 } | 256 } |
257 | 257 |
258 const mergedFrom = testHist.diagnostics.get( | 258 const mergedFrom = testHist.diagnostics.get( |
259 tr.v.d.RESERVED_NAMES.MERGED_FROM); | 259 tr.v.d.RESERVED_NAMES.MERGED_FROM); |
260 if (mergedFrom !== undefined) { | 260 if (mergedFrom !== undefined) { |
261 for (const origHist of mergedFrom) { | 261 for (const [unusedName, origHist] of mergedFrom) { |
262 if (histograms.lookupHistogram(origHist.guid) !== undefined) { | 262 if (histograms.lookupHistogram(origHist.guid) !== undefined) { |
263 found = true; | 263 found = true; |
264 break; | 264 break; |
265 } | 265 } |
266 } | 266 } |
267 } | 267 } |
268 if (found) break; | 268 if (found) break; |
269 } | 269 } |
270 // If none of the Histograms in |row| were merged from any of | 270 // If none of the Histograms in |row| were merged from any of |
271 // |histograms|, then drop this row. | 271 // |histograms|, then drop this row. |
(...skipping 10 matching lines...) Expand all Loading... |
282 } | 282 } |
283 return results; | 283 return results; |
284 } | 284 } |
285 } | 285 } |
286 | 286 |
287 return { | 287 return { |
288 HistogramSetHierarchy, | 288 HistogramSetHierarchy, |
289 }; | 289 }; |
290 }); | 290 }); |
291 </script> | 291 </script> |
OLD | NEW |