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",
33 BrokenSnapshot: "BrokenSnapshot"
36 WebInspector.HeapSnapshotCommon = {
39 WebInspector.HeapSnapshotCommon.baseSystemDistance = 100000000;
42 * @param {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} nodesWithSingleCaller
43 * @param {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} branchingCallers
46 WebInspector.HeapSnapshotCommon.AllocationNodeCallers = function(nodesWithSingleCaller, branchingCallers)
48 /** @type {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} */
49 this.nodesWithSingleCaller = nodesWithSingleCaller;
50 /** @type {!Array.<!WebInspector.HeapSnapshotCommon.SerializedAllocationNode>} */
51 this.branchingCallers = branchingCallers;
55 * @param {number} nodeId
56 * @param {string} functionName
57 * @param {string} scriptName
58 * @param {number} scriptId
59 * @param {number} line
60 * @param {number} column
61 * @param {number} count
62 * @param {number} size
63 * @param {number} liveCount
64 * @param {number} liveSize
65 * @param {boolean} hasChildren
68 WebInspector.HeapSnapshotCommon.SerializedAllocationNode = function(nodeId, functionName, scriptName, scriptId, line, column, count, size, liveCount, liveSize, hasChildren)
73 this.name = functionName;
75 this.scriptName = scriptName;
77 this.scriptId = scriptId;
87 this.liveCount = liveCount;
89 this.liveSize = liveSize;
90 /** @type {boolean} */
91 this.hasChildren = hasChildren;
95 * @param {string} functionName
96 * @param {string} scriptName
97 * @param {number} scriptId
98 * @param {number} line
99 * @param {number} column
102 WebInspector.HeapSnapshotCommon.AllocationStackFrame = function(functionName, scriptName, scriptId, line, column)
104 /** @type {string} */
105 this.functionName = functionName;
106 /** @type {string} */
107 this.scriptName = scriptName;
108 /** @type {number} */
109 this.scriptId = scriptId;
110 /** @type {number} */
112 /** @type {number} */
113 this.column = column;
119 * @param {string} name
120 * @param {number} distance
121 * @param {number} nodeIndex
122 * @param {number} retainedSize
123 * @param {number} selfSize
124 * @param {string} type
126 WebInspector.HeapSnapshotCommon.Node = function(id, name, distance, nodeIndex, retainedSize, selfSize, type)
130 this.distance = distance;
131 this.nodeIndex = nodeIndex;
132 this.retainedSize = retainedSize;
133 this.selfSize = selfSize;
136 this.canBeQueried = false;
137 this.detachedDOMTreeNode = false;
142 * @param {string} name
143 * @param {!WebInspector.HeapSnapshotCommon.Node} node
144 * @param {string} type
145 * @param {number} edgeIndex
147 WebInspector.HeapSnapshotCommon.Edge = function(name, node, type, edgeIndex)
152 this.edgeIndex = edgeIndex;
158 WebInspector.HeapSnapshotCommon.Aggregate = function()
160 /** @type {number} */
162 /** @type {number} */
164 /** @type {number} */
166 /** @type {number} */
168 /** @type {number} */
170 /** @type {string} */
172 /** @type {!Array.<number>} */
179 WebInspector.HeapSnapshotCommon.AggregateForDiff = function() {
180 /** @type {!Array.<number>} */
182 /** @type {!Array.<string>} */
184 /** @type {!Array.<number>} */
191 WebInspector.HeapSnapshotCommon.Diff = function()
193 /** @type {number} */
195 /** @type {number} */
196 this.removedCount = 0;
197 /** @type {number} */
199 /** @type {number} */
200 this.removedSize = 0;
201 /** @type {!Array.<number>} */
202 this.deletedIndexes = [];
203 /** @type {!Array.<number>} */
204 this.addedIndexes = [];
210 WebInspector.HeapSnapshotCommon.DiffForClass = function()
212 /** @type {number} */
214 /** @type {number} */
216 /** @type {number} */
218 /** @type {number} */
220 /** @type {!Array.<number>} */
222 /** @type {!Array.<number>} */
225 /** @type {number} */
227 /** @type {number} */
234 WebInspector.HeapSnapshotCommon.ComparatorConfig = function()
236 /** @type {string} */
238 /** @type {boolean} */
240 /** @type {string} */
242 /** @type {boolean} */
249 WebInspector.HeapSnapshotCommon.WorkerCommand = function()
251 /** @type {number} */
253 /** @type {string} */
255 /** @type {number} */
257 /** @type {number} */
259 /** @type {string} */
261 /** @type {!Array.<*>} */
262 this.methodArguments;
263 /** @type {string} */
269 * @param {number} startPosition
270 * @param {number} endPosition
271 * @param {number} totalLength
272 * @param {!Array.<*>} items
274 WebInspector.HeapSnapshotCommon.ItemsRange = function(startPosition, endPosition, totalLength, items)
276 /** @type {number} */
277 this.startPosition = startPosition;
278 /** @type {number} */
279 this.endPosition = endPosition;
280 /** @type {number} */
281 this.totalLength = totalLength;
282 /** @type {!Array.<*>} */
287 * @param {number} nodeCount
288 * @param {number} rootNodeIndex
289 * @param {number} totalSize
290 * @param {number} maxJSObjectId
293 WebInspector.HeapSnapshotCommon.StaticData = function(nodeCount, rootNodeIndex, totalSize, maxJSObjectId)
295 /** @type {number} */
296 this.nodeCount = nodeCount;
297 /** @type {number} */
298 this.rootNodeIndex = rootNodeIndex;
299 /** @type {number} */
300 this.totalSize = totalSize;
301 /** @type {number} */
302 this.maxJSObjectId = maxJSObjectId;
308 WebInspector.HeapSnapshotCommon.Statistics = function()
310 /** @type {number} */
312 /** @type {number} */
314 /** @type {number} */
316 /** @type {number} */
318 /** @type {number} */
320 /** @type {number} */
326 * @param {number=} minNodeId
327 * @param {number=} maxNodeId
330 WebInspector.HeapSnapshotCommon.NodeFilter = function(minNodeId, maxNodeId)
332 /** @type {number|undefined} */
333 this.minNodeId = minNodeId;
334 /** @type {number|undefined} */
335 this.maxNodeId = maxNodeId;
336 /** @type {number|undefined} */
337 this.allocationNodeId;
340 WebInspector.HeapSnapshotCommon.NodeFilter.prototype =
343 * @param {!WebInspector.HeapSnapshotCommon.NodeFilter} o
348 return this.minNodeId === o.minNodeId && this.maxNodeId === o.maxNodeId && this.allocationNodeId === o.allocationNodeId;