OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <!-- | |
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 | |
5 found in the LICENSE file. | |
6 --> | |
7 | |
8 <link rel="import" href="/tracing/value/diagnostics/reserved_names.html"> | |
9 | |
10 <script> | |
11 'use strict'; | |
12 | |
13 tr.exportTo('tr.v.d', function() { | |
14 /** | |
15 * Add related names GenericSet diagnostic. | |
16 * | |
17 * @param {!tr.v.HistogramSet} histograms | |
18 */ | |
19 function addRelatedNames(histograms) { | |
20 for (const hist of histograms) { | |
21 const relatedNames = new Set(); | |
22 for (const [name, diagnostic] of hist.diagnostics) { | |
23 if (diagnostic instanceof tr.v.d.RelatedHistogramMap) { | |
24 for (const [relationshipName, relatedHist] of diagnostic) { | |
25 relatedNames.add(relatedHist.name); | |
26 } | |
27 } | |
28 } | |
29 if (relatedNames.size) { | |
30 hist.diagnostics.set( | |
31 tr.v.d.RESERVED_NAMES.RELATED_NAMES, | |
32 new tr.v.d.GenericSet(relatedNames)); | |
33 } | |
34 } | |
35 } | |
36 | |
37 return { | |
38 addRelatedNames, | |
39 }; | |
40 }); | |
41 </script> | |
OLD | NEW |