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

Unified Diff: tracing/tracing/value/diagnostics/diagnostic_map.html

Issue 3009553002: Refactor Histogram relationship diagnostics. (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
Index: tracing/tracing/value/diagnostics/diagnostic_map.html
diff --git a/tracing/tracing/value/diagnostics/diagnostic_map.html b/tracing/tracing/value/diagnostics/diagnostic_map.html
index 950d0e31dff9df5bceb5da0a25af83057e856248..4c69a2e858299762dd295ccd32f057b4853d5343 100644
--- a/tracing/tracing/value/diagnostics/diagnostic_map.html
+++ b/tracing/tracing/value/diagnostics/diagnostic_map.html
@@ -113,7 +113,8 @@ tr.exportTo('tr.v.d', function() {
static fromObject(obj) {
const diagnostics = new DiagnosticMap();
- for (const [name, diagnostic] of Object.entries(obj)) {
+ if (!(obj instanceof Map)) obj = Object.entries(obj);
+ for (const [name, diagnostic] of obj) {
diagnostics.set(name, diagnostic);
}
return diagnostics;
@@ -121,9 +122,7 @@ tr.exportTo('tr.v.d', function() {
addDiagnostics(other) {
for (const [name, otherDiagnostic] of other) {
- if (name === tr.v.d.RESERVED_NAMES.MERGED_FROM ||
- name === tr.v.d.RESERVED_NAMES.MERGED_TO ||
- name === tr.v.d.RESERVED_NAMES.GROUPING_PATH) {
+ if (name === tr.v.d.RESERVED_NAMES.GROUPING_PATH) {
continue;
}
@@ -164,35 +163,6 @@ tr.exportTo('tr.v.d', function() {
[myDiagnostic, clone]));
}
}
-
- /**
- * RelatedHistogram diagnostics cannot be merged when Histograms are merged
- * because the related Histograms might not exist yet.
- * This method assumes that all related Histograms exist and that duplicate
- * Diagnostics have been deduplicated.
- *
- * @param {!tr.v.Histogram} parentHist
- */
- mergeRelationships(parentHist) {
- for (const [name, diagnostic] of this) {
- if (!(diagnostic instanceof tr.v.d.RelatedHistogramMap) &&
- !(diagnostic instanceof tr.v.d.RelatedHistogramBreakdown) &&
- !(diagnostic instanceof tr.v.d.UnmergeableDiagnosticSet)) {
- continue;
- }
-
- for (const [unusedName, otherHist] of
- this.get(tr.v.d.RESERVED_NAMES.MERGED_FROM)) {
- const otherDiagnostic = otherHist.diagnostics.get(name);
- if (!(otherDiagnostic instanceof tr.v.d.RelatedHistogramMap) &&
- !(otherDiagnostic instanceof tr.v.d.RelatedHistogramBreakdown) &&
- !(otherDiagnostic instanceof tr.v.d.UnmergeableDiagnosticSet)) {
- continue;
- }
- diagnostic.mergeRelationships(otherDiagnostic, parentHist, otherHist);
- }
- }
- }
}
return {
« no previous file with comments | « tracing/tracing/value/diagnostics/breakdown.html ('k') | tracing/tracing/value/diagnostics/diagnostic_map_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698