Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 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/model/container_memory_dump.html"> | 10 <link rel="import" href="/tracing/model/container_memory_dump.html"> |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 102 | 102 |
| 103 /** | 103 /** |
| 104 * Create a new memory allocator dump. | 104 * Create a new memory allocator dump. |
| 105 * | 105 * |
| 106 * @param {!tr.model.ContainerMemoryDump} containerDump The container dump | 106 * @param {!tr.model.ContainerMemoryDump} containerDump The container dump |
| 107 * associated with the new allocator dump. | 107 * associated with the new allocator dump. |
| 108 * @param {string} fullName The full name of the new allocator dump | 108 * @param {string} fullName The full name of the new allocator dump |
| 109 * (including ancestors). | 109 * (including ancestors). |
| 110 * @param {!{ | 110 * @param {!{ |
| 111 * guid: (number|undefined), | 111 * guid: (number|undefined), |
| 112 * numerics: (!Object<string, (number|!tr.b.Scalar)>|undefined) | 112 * numerics: (!Object<string, (number|!tr.b.Scalar)>|undefined) |
|
keishi
2017/09/14 09:40:46
add jsdoc for children
| |
| 113 * }=} opt_options Options for creating the new allocator dump. | 113 * }=} opt_options Options for creating the new allocator dump. |
| 114 * @return {!tr.model.MemoryAllocatorDump} The newly created memory allocator | 114 * @return {!tr.model.MemoryAllocatorDump} The newly created memory allocator |
| 115 * dump. | 115 * dump. |
| 116 */ | 116 */ |
| 117 MemoryDumpTestUtils.newAllocatorDump = function( | 117 MemoryDumpTestUtils.newAllocatorDump = function( |
| 118 containerDump, fullName, opt_options) { | 118 containerDump, fullName, opt_options) { |
| 119 const dump = new MemoryAllocatorDump(containerDump, fullName, | 119 const dump = new MemoryAllocatorDump(containerDump, fullName, |
| 120 getOption(opt_options, 'guid')); | 120 getOption(opt_options, 'guid')); |
| 121 const numerics = getOption(opt_options, 'numerics'); | 121 const numerics = getOption(opt_options, 'numerics'); |
| 122 if (numerics) { | 122 if (numerics) { |
| 123 for (const [numericName, value] of Object.entries(numerics)) { | 123 for (const [numericName, value] of Object.entries(numerics)) { |
| 124 dump.addNumeric(numericName, castToScalar(value)); | 124 dump.addNumeric(numericName, castToScalar(value)); |
| 125 } | 125 } |
| 126 } | 126 } |
| 127 dump.addChildren(getOption(opt_options, 'children')); | |
| 127 return dump; | 128 return dump; |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 /** | 131 /** |
| 131 * Create a new child memory allocator dump and add it to a parent memory | 132 * Create a new child memory allocator dump and add it to a parent memory |
| 132 * allocator dump. | 133 * allocator dump. |
| 133 * | 134 * |
| 134 * @param {!tr.model.MemoryAllocatorDump} parentDump The parent allocator | 135 * @param {!tr.model.MemoryAllocatorDump} parentDump The parent allocator |
| 135 * dump. | 136 * dump. |
| 136 * @param {string} name The name of the child allocator dump (excluding | 137 * @param {string} name The name of the child allocator dump (excluding |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 209 assert.strictEqual(actualRegion.mappedFile, expectedRegion.mappedFile); | 210 assert.strictEqual(actualRegion.mappedFile, expectedRegion.mappedFile); |
| 210 assert.deepEqual(actualRegion.byteStats, expectedRegion.byteStats); | 211 assert.deepEqual(actualRegion.byteStats, expectedRegion.byteStats); |
| 211 } | 212 } |
| 212 }; | 213 }; |
| 213 | 214 |
| 214 return { | 215 return { |
| 215 MemoryDumpTestUtils, | 216 MemoryDumpTestUtils, |
| 216 }; | 217 }; |
| 217 }); | 218 }); |
| 218 </script> | 219 </script> |
| OLD | NEW |