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

Side by Side Diff: tracing/tracing/model/memory_allocator_dump.html

Issue 3012153002: Add leakDetectionMetric for tracing (Closed)
Patch Set: Bug fix 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 unified diff | Download patch
OLDNEW
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
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) {
keishi 2017/09/14 09:40:46 I don't know about naming conventions in tracing b
yuzuchan 2017/09/15 08:32:25 I mimicked the other functions in this file, so I'
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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698