2 * Copyright (C) 2014 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 WebInspector.HeapSnapshotProgressEvent = {
32 Update: "ProgressUpdate"
35 WebInspector.HeapSnapshotCommon = {
38 WebInspector.HeapSnapshotCommon.baseSystemDistance = 100000000;
41 * @param {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} nodesWithSingleCaller
42 * @param {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} branchingCallers
45 WebInspector.HeapSnapshotCommon.AllocationNodeCallers = function(nodesWithSingleCaller, branchingCallers)
47 /** @type {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} */
48 this.nodesWithSingleCaller = nodesWithSingleCaller;
49 /** @type {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} */
50 this.branchingCallers = branchingCallers;
54 * @param {number} nodeId
55 * @param {string} functionName
56 * @param {string} scriptName
57 * @param {number} scriptId
58 * @param {number} line
59 * @param {number} column
60 * @param {number} count
61 * @param {number} size
62 * @param {number} liveCount
63 * @param {number} liveSize
64 * @param {boolean} hasChildren
67 WebInspector.HeapSnapshotCommon.SerializedAllocationNode = function(nodeId, functionName, scriptName, scriptId, line, column, count, size, liveCount, liveSize, hasChildren)
72 this.name = functionName;
74 this.scriptName = scriptName;
76 this.scriptId = scriptId;
86 this.liveCount = liveCount;
88 this.liveSize = liveSize;
89 /** @type {boolean} */
90 this.hasChildren = hasChildren;
94 * @param {string} functionName
95 * @param {string} scriptName
96 * @param {number} scriptId
97 * @param {number} line
98 * @param {number} column
101 WebInspector.HeapSnapshotCommon.AllocationStackFrame = function(functionName, scriptName, scriptId, line, column)
103 /** @type {string} */
104 this.functionName = functionName;
105 /** @type {string} */
106 this.scriptName = scriptName;
107 /** @type {number} */
108 this.scriptId = scriptId;
109 /** @type {number} */
111 /** @type {number} */
112 this.column = column;
118 * @param {string} name
119 * @param {number} distance
120 * @param {number|undefined} nodeIndex
121 * @param {number} retainedSize
122 * @param {number} selfSize
123 * @param {string} type
125 WebInspector.HeapSnapshotCommon.Node = function(id, name, distance, nodeIndex, retainedSize, selfSize, type)
129 this.distance = distance;
130 this.nodeIndex = nodeIndex;
131 this.retainedSize = retainedSize;
132 this.selfSize = selfSize;
135 this.canBeQueried = false;
136 this.detachedDOMTreeNode = false;
141 * @param {string} name
142 * @param {!WebInspector.HeapSnapshotCommon.Node} node
143 * @param {string} type
144 * @param {number} edgeIndex
146 WebInspector.HeapSnapshotCommon.Edge = function(name, node, type, edgeIndex)
151 this.edgeIndex = edgeIndex;
157 WebInspector.HeapSnapshotCommon.Aggregate = function()
159 /** @type {number} */
161 /** @type {number} */
163 /** @type {number} */
165 /** @type {number} */
167 /** @type {number} */
169 /** @type {string} */
171 /** @type {!Array.<number>} */
178 WebInspector.HeapSnapshotCommon.AggregateForDiff = function() {
179 /** @type {!Array.<number>} */
181 /** @type {!Array.<string>} */
183 /** @type {!Array.<number>} */
190 WebInspector.HeapSnapshotCommon.Diff = function()
192 /** @type {number} */
194 /** @type {number} */
195 this.removedCount = 0;
196 /** @type {number} */
198 /** @type {number} */
199 this.removedSize = 0;
200 /** @type {!Array.<number>} */
201 this.deletedIndexes = [];
202 /** @type {!Array.<number>} */
203 this.addedIndexes = [];
209 WebInspector.HeapSnapshotCommon.DiffForClass = function()
211 /** @type {number} */
213 /** @type {number} */
215 /** @type {number} */
217 /** @type {number} */
219 /** @type {!Array.<number>} */
221 /** @type {!Array.<number>} */
224 /** @type {number} */
226 /** @type {number} */
233 WebInspector.HeapSnapshotCommon.ComparatorConfig = function()
235 /** @type {string} */
237 /** @type {boolean} */
239 /** @type {string} */
241 /** @type {boolean} */
248 WebInspector.HeapSnapshotCommon.WorkerCommand = function()
250 /** @type {number} */
252 /** @type {string} */
254 /** @type {number} */
256 /** @type {number} */
258 /** @type {string} */
260 /** @type {!Array.<*>} */
261 this.methodArguments;
262 /** @type {string} */
268 * @param {number} startPosition
269 * @param {number} endPosition
270 * @param {number} totalLength
271 * @param {!Array.<*>} items
273 WebInspector.HeapSnapshotCommon.ItemsRange = function(startPosition, endPosition, totalLength, items)
275 /** @type {number} */
276 this.startPosition = startPosition;
277 /** @type {number} */
278 this.endPosition = endPosition;
279 /** @type {number} */
280 this.totalLength = totalLength;
281 /** @type {!Array.<*>} */
286 * @param {number} nodeCount
287 * @param {number} rootNodeIndex
288 * @param {number} totalSize
289 * @param {number} maxJSObjectId
292 WebInspector.HeapSnapshotCommon.StaticData = function(nodeCount, rootNodeIndex, totalSize, maxJSObjectId)
294 /** @type {number} */
295 this.nodeCount = nodeCount;
296 /** @type {number} */
297 this.rootNodeIndex = rootNodeIndex;
298 /** @type {number} */
299 this.totalSize = totalSize;
300 /** @type {number} */
301 this.maxJSObjectId = maxJSObjectId;
307 WebInspector.HeapSnapshotCommon.Statistics = function()
309 /** @type {number} */
311 /** @type {number} */
313 /** @type {number} */
315 /** @type {number} */
317 /** @type {number} */
319 /** @type {number} */
325 * @param {number=} minNodeId
326 * @param {number=} maxNodeId
329 WebInspector.HeapSnapshotCommon.NodeFilter = function(minNodeId, maxNodeId)
331 /** @type {number|undefined} */
332 this.minNodeId = minNodeId;
333 /** @type {number|undefined} */
334 this.maxNodeId = maxNodeId;
335 /** @type {number|undefined} */
336 this.allocationNodeId;
339 WebInspector.HeapSnapshotCommon.NodeFilter.prototype =
342 * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} o
347 return this.minNodeId === o.minNodeId && this.maxNodeId === o.maxNodeId && this.allocationNodeId === o.allocationNodeId;