| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | |
| 3 * | |
| 4 * Redistribution and use in source and binary forms, with or without | |
| 5 * modification, are permitted provided that the following conditions are | |
| 6 * met: | |
| 7 * | |
| 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 | |
| 13 * distribution. | |
| 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. | |
| 17 * | |
| 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. | |
| 29 */ | |
| 30 | |
| 31 self['Profiler'] = self['Profiler'] || {}; | |
| 32 | |
| 33 Profiler.HeapSnapshotProgressEvent = { | |
| 34 Update: 'ProgressUpdate', | |
| 35 BrokenSnapshot: 'BrokenSnapshot' | |
| 36 }; | |
| 37 | |
| 38 Profiler.HeapSnapshotCommon = {}; | |
| 39 | |
| 40 Profiler.HeapSnapshotCommon.baseSystemDistance = 100000000; | |
| 41 | |
| 42 /** | |
| 43 * @unrestricted | |
| 44 */ | |
| 45 Profiler.HeapSnapshotCommon.AllocationNodeCallers = class { | |
| 46 /** | |
| 47 * @param {!Array.<!Profiler.HeapSnapshotCommon.SerializedAllocationNode>} nod
esWithSingleCaller | |
| 48 * @param {!Array.<!Profiler.HeapSnapshotCommon.SerializedAllocationNode>} bra
nchingCallers | |
| 49 */ | |
| 50 constructor(nodesWithSingleCaller, branchingCallers) { | |
| 51 /** @type {!Array.<!Profiler.HeapSnapshotCommon.SerializedAllocationNode>} *
/ | |
| 52 this.nodesWithSingleCaller = nodesWithSingleCaller; | |
| 53 /** @type {!Array.<!Profiler.HeapSnapshotCommon.SerializedAllocationNode>} *
/ | |
| 54 this.branchingCallers = branchingCallers; | |
| 55 } | |
| 56 }; | |
| 57 | |
| 58 /** | |
| 59 * @unrestricted | |
| 60 */ | |
| 61 Profiler.HeapSnapshotCommon.SerializedAllocationNode = class { | |
| 62 /** | |
| 63 * @param {number} nodeId | |
| 64 * @param {string} functionName | |
| 65 * @param {string} scriptName | |
| 66 * @param {number} scriptId | |
| 67 * @param {number} line | |
| 68 * @param {number} column | |
| 69 * @param {number} count | |
| 70 * @param {number} size | |
| 71 * @param {number} liveCount | |
| 72 * @param {number} liveSize | |
| 73 * @param {boolean} hasChildren | |
| 74 */ | |
| 75 constructor(nodeId, functionName, scriptName, scriptId, line, column, count, s
ize, liveCount, liveSize, hasChildren) { | |
| 76 /** @type {number} */ | |
| 77 this.id = nodeId; | |
| 78 /** @type {string} */ | |
| 79 this.name = functionName; | |
| 80 /** @type {string} */ | |
| 81 this.scriptName = scriptName; | |
| 82 /** @type {number} */ | |
| 83 this.scriptId = scriptId; | |
| 84 /** @type {number} */ | |
| 85 this.line = line; | |
| 86 /** @type {number} */ | |
| 87 this.column = column; | |
| 88 /** @type {number} */ | |
| 89 this.count = count; | |
| 90 /** @type {number} */ | |
| 91 this.size = size; | |
| 92 /** @type {number} */ | |
| 93 this.liveCount = liveCount; | |
| 94 /** @type {number} */ | |
| 95 this.liveSize = liveSize; | |
| 96 /** @type {boolean} */ | |
| 97 this.hasChildren = hasChildren; | |
| 98 } | |
| 99 }; | |
| 100 | |
| 101 /** | |
| 102 * @unrestricted | |
| 103 */ | |
| 104 Profiler.HeapSnapshotCommon.AllocationStackFrame = class { | |
| 105 /** | |
| 106 * @param {string} functionName | |
| 107 * @param {string} scriptName | |
| 108 * @param {number} scriptId | |
| 109 * @param {number} line | |
| 110 * @param {number} column | |
| 111 */ | |
| 112 constructor(functionName, scriptName, scriptId, line, column) { | |
| 113 /** @type {string} */ | |
| 114 this.functionName = functionName; | |
| 115 /** @type {string} */ | |
| 116 this.scriptName = scriptName; | |
| 117 /** @type {number} */ | |
| 118 this.scriptId = scriptId; | |
| 119 /** @type {number} */ | |
| 120 this.line = line; | |
| 121 /** @type {number} */ | |
| 122 this.column = column; | |
| 123 } | |
| 124 }; | |
| 125 | |
| 126 /** | |
| 127 * @unrestricted | |
| 128 */ | |
| 129 Profiler.HeapSnapshotCommon.Node = class { | |
| 130 /** | |
| 131 * @param {number} id | |
| 132 * @param {string} name | |
| 133 * @param {number} distance | |
| 134 * @param {number} nodeIndex | |
| 135 * @param {number} retainedSize | |
| 136 * @param {number} selfSize | |
| 137 * @param {string} type | |
| 138 */ | |
| 139 constructor(id, name, distance, nodeIndex, retainedSize, selfSize, type) { | |
| 140 this.id = id; | |
| 141 this.name = name; | |
| 142 this.distance = distance; | |
| 143 this.nodeIndex = nodeIndex; | |
| 144 this.retainedSize = retainedSize; | |
| 145 this.selfSize = selfSize; | |
| 146 this.type = type; | |
| 147 | |
| 148 this.canBeQueried = false; | |
| 149 this.detachedDOMTreeNode = false; | |
| 150 } | |
| 151 }; | |
| 152 | |
| 153 /** | |
| 154 * @unrestricted | |
| 155 */ | |
| 156 Profiler.HeapSnapshotCommon.Edge = class { | |
| 157 /** | |
| 158 * @param {string} name | |
| 159 * @param {!Profiler.HeapSnapshotCommon.Node} node | |
| 160 * @param {string} type | |
| 161 * @param {number} edgeIndex | |
| 162 */ | |
| 163 constructor(name, node, type, edgeIndex) { | |
| 164 this.name = name; | |
| 165 this.node = node; | |
| 166 this.type = type; | |
| 167 this.edgeIndex = edgeIndex; | |
| 168 } | |
| 169 }; | |
| 170 | |
| 171 /** | |
| 172 * @unrestricted | |
| 173 */ | |
| 174 Profiler.HeapSnapshotCommon.Aggregate = class { | |
| 175 constructor() { | |
| 176 /** @type {number} */ | |
| 177 this.count; | |
| 178 /** @type {number} */ | |
| 179 this.distance; | |
| 180 /** @type {number} */ | |
| 181 this.self; | |
| 182 /** @type {number} */ | |
| 183 this.maxRet; | |
| 184 /** @type {number} */ | |
| 185 this.type; | |
| 186 /** @type {string} */ | |
| 187 this.name; | |
| 188 /** @type {!Array.<number>} */ | |
| 189 this.idxs; | |
| 190 } | |
| 191 }; | |
| 192 | |
| 193 /** | |
| 194 * @unrestricted | |
| 195 */ | |
| 196 Profiler.HeapSnapshotCommon.AggregateForDiff = class { | |
| 197 constructor() { | |
| 198 /** @type {!Array.<number>} */ | |
| 199 this.indexes = []; | |
| 200 /** @type {!Array.<string>} */ | |
| 201 this.ids = []; | |
| 202 /** @type {!Array.<number>} */ | |
| 203 this.selfSizes = []; | |
| 204 } | |
| 205 }; | |
| 206 | |
| 207 /** | |
| 208 * @unrestricted | |
| 209 */ | |
| 210 Profiler.HeapSnapshotCommon.Diff = class { | |
| 211 constructor() { | |
| 212 /** @type {number} */ | |
| 213 this.addedCount = 0; | |
| 214 /** @type {number} */ | |
| 215 this.removedCount = 0; | |
| 216 /** @type {number} */ | |
| 217 this.addedSize = 0; | |
| 218 /** @type {number} */ | |
| 219 this.removedSize = 0; | |
| 220 /** @type {!Array.<number>} */ | |
| 221 this.deletedIndexes = []; | |
| 222 /** @type {!Array.<number>} */ | |
| 223 this.addedIndexes = []; | |
| 224 } | |
| 225 }; | |
| 226 | |
| 227 /** | |
| 228 * @unrestricted | |
| 229 */ | |
| 230 Profiler.HeapSnapshotCommon.DiffForClass = class { | |
| 231 constructor() { | |
| 232 /** @type {number} */ | |
| 233 this.addedCount; | |
| 234 /** @type {number} */ | |
| 235 this.removedCount; | |
| 236 /** @type {number} */ | |
| 237 this.addedSize; | |
| 238 /** @type {number} */ | |
| 239 this.removedSize; | |
| 240 /** @type {!Array.<number>} */ | |
| 241 this.deletedIndexes; | |
| 242 /** @type {!Array.<number>} */ | |
| 243 this.addedIndexes; | |
| 244 | |
| 245 /** @type {number} */ | |
| 246 this.countDelta; | |
| 247 /** @type {number} */ | |
| 248 this.sizeDelta; | |
| 249 } | |
| 250 }; | |
| 251 | |
| 252 /** | |
| 253 * @unrestricted | |
| 254 */ | |
| 255 Profiler.HeapSnapshotCommon.ComparatorConfig = class { | |
| 256 constructor() { | |
| 257 /** @type {string} */ | |
| 258 this.fieldName1; | |
| 259 /** @type {boolean} */ | |
| 260 this.ascending1; | |
| 261 /** @type {string} */ | |
| 262 this.fieldName2; | |
| 263 /** @type {boolean} */ | |
| 264 this.ascending2; | |
| 265 } | |
| 266 }; | |
| 267 | |
| 268 /** | |
| 269 * @unrestricted | |
| 270 */ | |
| 271 Profiler.HeapSnapshotCommon.WorkerCommand = class { | |
| 272 constructor() { | |
| 273 /** @type {number} */ | |
| 274 this.callId; | |
| 275 /** @type {string} */ | |
| 276 this.disposition; | |
| 277 /** @type {number} */ | |
| 278 this.objectId; | |
| 279 /** @type {number} */ | |
| 280 this.newObjectId; | |
| 281 /** @type {string} */ | |
| 282 this.methodName; | |
| 283 /** @type {!Array.<*>} */ | |
| 284 this.methodArguments; | |
| 285 /** @type {string} */ | |
| 286 this.source; | |
| 287 } | |
| 288 }; | |
| 289 | |
| 290 /** | |
| 291 * @unrestricted | |
| 292 */ | |
| 293 Profiler.HeapSnapshotCommon.ItemsRange = class { | |
| 294 /** | |
| 295 * @param {number} startPosition | |
| 296 * @param {number} endPosition | |
| 297 * @param {number} totalLength | |
| 298 * @param {!Array.<*>} items | |
| 299 */ | |
| 300 constructor(startPosition, endPosition, totalLength, items) { | |
| 301 /** @type {number} */ | |
| 302 this.startPosition = startPosition; | |
| 303 /** @type {number} */ | |
| 304 this.endPosition = endPosition; | |
| 305 /** @type {number} */ | |
| 306 this.totalLength = totalLength; | |
| 307 /** @type {!Array.<*>} */ | |
| 308 this.items = items; | |
| 309 } | |
| 310 }; | |
| 311 | |
| 312 /** | |
| 313 * @unrestricted | |
| 314 */ | |
| 315 Profiler.HeapSnapshotCommon.StaticData = class { | |
| 316 /** | |
| 317 * @param {number} nodeCount | |
| 318 * @param {number} rootNodeIndex | |
| 319 * @param {number} totalSize | |
| 320 * @param {number} maxJSObjectId | |
| 321 */ | |
| 322 constructor(nodeCount, rootNodeIndex, totalSize, maxJSObjectId) { | |
| 323 /** @type {number} */ | |
| 324 this.nodeCount = nodeCount; | |
| 325 /** @type {number} */ | |
| 326 this.rootNodeIndex = rootNodeIndex; | |
| 327 /** @type {number} */ | |
| 328 this.totalSize = totalSize; | |
| 329 /** @type {number} */ | |
| 330 this.maxJSObjectId = maxJSObjectId; | |
| 331 } | |
| 332 }; | |
| 333 | |
| 334 /** | |
| 335 * @unrestricted | |
| 336 */ | |
| 337 Profiler.HeapSnapshotCommon.Statistics = class { | |
| 338 constructor() { | |
| 339 /** @type {number} */ | |
| 340 this.total; | |
| 341 /** @type {number} */ | |
| 342 this.v8heap; | |
| 343 /** @type {number} */ | |
| 344 this.native; | |
| 345 /** @type {number} */ | |
| 346 this.code; | |
| 347 /** @type {number} */ | |
| 348 this.jsArrays; | |
| 349 /** @type {number} */ | |
| 350 this.strings; | |
| 351 /** @type {number} */ | |
| 352 this.system; | |
| 353 } | |
| 354 }; | |
| 355 | |
| 356 /** | |
| 357 * @unrestricted | |
| 358 */ | |
| 359 Profiler.HeapSnapshotCommon.NodeFilter = class { | |
| 360 /** | |
| 361 * @param {number=} minNodeId | |
| 362 * @param {number=} maxNodeId | |
| 363 */ | |
| 364 constructor(minNodeId, maxNodeId) { | |
| 365 /** @type {number|undefined} */ | |
| 366 this.minNodeId = minNodeId; | |
| 367 /** @type {number|undefined} */ | |
| 368 this.maxNodeId = maxNodeId; | |
| 369 /** @type {number|undefined} */ | |
| 370 this.allocationNodeId; | |
| 371 } | |
| 372 | |
| 373 /** | |
| 374 * @param {!Profiler.HeapSnapshotCommon.NodeFilter} o | |
| 375 * @return {boolean} | |
| 376 */ | |
| 377 equals(o) { | |
| 378 return this.minNodeId === o.minNodeId && this.maxNodeId === o.maxNodeId && | |
| 379 this.allocationNodeId === o.allocationNodeId; | |
| 380 } | |
| 381 }; | |
| 382 | |
| 383 /** | |
| 384 * @unrestricted | |
| 385 */ | |
| 386 Profiler.HeapSnapshotCommon.SearchConfig = class { | |
| 387 /** | |
| 388 * @param {string} query | |
| 389 * @param {boolean} caseSensitive | |
| 390 * @param {boolean} isRegex | |
| 391 * @param {boolean} shouldJump | |
| 392 * @param {boolean} jumpBackward | |
| 393 */ | |
| 394 constructor(query, caseSensitive, isRegex, shouldJump, jumpBackward) { | |
| 395 this.query = query; | |
| 396 this.caseSensitive = caseSensitive; | |
| 397 this.isRegex = isRegex; | |
| 398 this.shouldJump = shouldJump; | |
| 399 this.jumpBackward = jumpBackward; | |
| 400 } | |
| 401 }; | |
| 402 | |
| 403 /** | |
| 404 * @unrestricted | |
| 405 */ | |
| 406 Profiler.HeapSnapshotCommon.Samples = class { | |
| 407 /** | |
| 408 * @param {!Array.<number>} timestamps | |
| 409 * @param {!Array.<number>} lastAssignedIds | |
| 410 * @param {!Array.<number>} sizes | |
| 411 */ | |
| 412 constructor(timestamps, lastAssignedIds, sizes) { | |
| 413 this.timestamps = timestamps; | |
| 414 this.lastAssignedIds = lastAssignedIds; | |
| 415 this.sizes = sizes; | |
| 416 } | |
| 417 }; | |
| OLD | NEW |