| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2015 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2015 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/base/scalar.html"> | 8 <link rel="import" href="/tracing/base/scalar.html"> |
| 9 <link rel="import" href="/tracing/base/unit.html"> | 9 <link rel="import" href="/tracing/base/unit.html"> |
| 10 <link rel="import" href="/tracing/base/utils.html"> | 10 <link rel="import" href="/tracing/base/utils.html"> |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 addDiagnostic(name, text) { | 105 addDiagnostic(name, text) { |
| 106 if (typeof text !== 'string') { | 106 if (typeof text !== 'string') { |
| 107 throw new Error('Diagnostic text must be a string.'); | 107 throw new Error('Diagnostic text must be a string.'); |
| 108 } | 108 } |
| 109 if (name in this.diagnostics) { | 109 if (name in this.diagnostics) { |
| 110 throw new Error('Duplicate diagnostic name: ' + name + '.'); | 110 throw new Error('Duplicate diagnostic name: ' + name + '.'); |
| 111 } | 111 } |
| 112 this.diagnostics[name] = text; | 112 this.diagnostics[name] = text; |
| 113 }, | 113 }, |
| 114 | 114 |
| 115 addChildren(array) { |
| 116 if (Array.isArray(array)) { |
| 117 this.children = array; |
| 118 } |
| 119 }, |
| 120 |
| 115 aggregateNumericsRecursively(opt_model) { | 121 aggregateNumericsRecursively(opt_model) { |
| 116 const numericNames = new Set(); | 122 const numericNames = new Set(); |
| 117 | 123 |
| 118 // Aggregate descendants's numerics recursively and gather children's | 124 // Aggregate descendants's numerics recursively and gather children's |
| 119 // numeric names. | 125 // numeric names. |
| 120 this.children.forEach(function(child) { | 126 this.children.forEach(function(child) { |
| 121 child.aggregateNumericsRecursively(opt_model); | 127 child.aggregateNumericsRecursively(opt_model); |
| 122 for (const [item, value] of Object.entries(child.numerics)) { | 128 for (const [item, value] of Object.entries(child.numerics)) { |
| 123 numericNames.add(item, value); | 129 numericNames.add(item, value); |
| 124 } | 130 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 PROVIDED_SIZE_LESS_THAN_LARGEST_OWNER: 1 | 218 PROVIDED_SIZE_LESS_THAN_LARGEST_OWNER: 1 |
| 213 }; | 219 }; |
| 214 | 220 |
| 215 return { | 221 return { |
| 216 MemoryAllocatorDump, | 222 MemoryAllocatorDump, |
| 217 MemoryAllocatorDumpLink, | 223 MemoryAllocatorDumpLink, |
| 218 MemoryAllocatorDumpInfoType, | 224 MemoryAllocatorDumpInfoType, |
| 219 }; | 225 }; |
| 220 }); | 226 }); |
| 221 </script> | 227 </script> |
| OLD | NEW |