OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyrightdd | 8 * * Redistributions of source code must retain the above copyrightdd |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 /** | 327 /** |
328 * @unrestricted | 328 * @unrestricted |
329 */ | 329 */ |
330 Profiler.HeapSnapshotProxy = class extends Profiler.HeapSnapshotProxyObject { | 330 Profiler.HeapSnapshotProxy = class extends Profiler.HeapSnapshotProxyObject { |
331 /** | 331 /** |
332 * @param {!Profiler.HeapSnapshotWorkerProxy} worker | 332 * @param {!Profiler.HeapSnapshotWorkerProxy} worker |
333 * @param {number} objectId | 333 * @param {number} objectId |
334 */ | 334 */ |
335 constructor(worker, objectId) { | 335 constructor(worker, objectId) { |
336 super(worker, objectId); | 336 super(worker, objectId); |
337 /** @type {?Profiler.HeapSnapshotCommon.StaticData} */ | 337 /** @type {?HeapSnapshotModel.StaticData} */ |
338 this._staticData = null; | 338 this._staticData = null; |
339 } | 339 } |
340 | 340 |
341 /** | 341 /** |
342 * @param {!Profiler.HeapSnapshotCommon.SearchConfig} searchConfig | 342 * @param {!HeapSnapshotModel.SearchConfig} searchConfig |
343 * @param {!Profiler.HeapSnapshotCommon.NodeFilter} filter | 343 * @param {!HeapSnapshotModel.NodeFilter} filter |
344 * @return {!Promise<!Array<number>>} | 344 * @return {!Promise<!Array<number>>} |
345 */ | 345 */ |
346 search(searchConfig, filter) { | 346 search(searchConfig, filter) { |
347 return this._callMethodPromise('search', searchConfig, filter); | 347 return this._callMethodPromise('search', searchConfig, filter); |
348 } | 348 } |
349 | 349 |
350 /** | 350 /** |
351 * @param {!Profiler.HeapSnapshotCommon.NodeFilter} filter | 351 * @param {!HeapSnapshotModel.NodeFilter} filter |
352 * @param {function(!Object.<string, !Profiler.HeapSnapshotCommon.Aggregate>)}
callback | 352 * @param {function(!Object.<string, !HeapSnapshotModel.Aggregate>)} callback |
353 */ | 353 */ |
354 aggregatesWithFilter(filter, callback) { | 354 aggregatesWithFilter(filter, callback) { |
355 this.callMethod(callback, 'aggregatesWithFilter', filter); | 355 this.callMethod(callback, 'aggregatesWithFilter', filter); |
356 } | 356 } |
357 | 357 |
358 aggregatesForDiff(callback) { | 358 aggregatesForDiff(callback) { |
359 this.callMethod(callback, 'aggregatesForDiff'); | 359 this.callMethod(callback, 'aggregatesForDiff'); |
360 } | 360 } |
361 | 361 |
362 calculateSnapshotDiff(baseSnapshotId, baseSnapshotAggregates, callback) { | 362 calculateSnapshotDiff(baseSnapshotId, baseSnapshotAggregates, callback) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 /** | 408 /** |
409 * @param {function(*):boolean} filter | 409 * @param {function(*):boolean} filter |
410 * @return {?Profiler.HeapSnapshotProviderProxy} | 410 * @return {?Profiler.HeapSnapshotProviderProxy} |
411 */ | 411 */ |
412 createNodesProvider(filter) { | 412 createNodesProvider(filter) { |
413 return this.callFactoryMethod(null, 'createNodesProvider', Profiler.HeapSnap
shotProviderProxy, filter); | 413 return this.callFactoryMethod(null, 'createNodesProvider', Profiler.HeapSnap
shotProviderProxy, filter); |
414 } | 414 } |
415 | 415 |
416 /** | 416 /** |
417 * @param {string} className | 417 * @param {string} className |
418 * @param {!Profiler.HeapSnapshotCommon.NodeFilter} nodeFilter | 418 * @param {!HeapSnapshotModel.NodeFilter} nodeFilter |
419 * @return {?Profiler.HeapSnapshotProviderProxy} | 419 * @return {?Profiler.HeapSnapshotProviderProxy} |
420 */ | 420 */ |
421 createNodesProviderForClass(className, nodeFilter) { | 421 createNodesProviderForClass(className, nodeFilter) { |
422 return this.callFactoryMethod( | 422 return this.callFactoryMethod( |
423 null, 'createNodesProviderForClass', Profiler.HeapSnapshotProviderProxy,
className, nodeFilter); | 423 null, 'createNodesProviderForClass', Profiler.HeapSnapshotProviderProxy,
className, nodeFilter); |
424 } | 424 } |
425 | 425 |
426 allocationTracesTops(callback) { | 426 allocationTracesTops(callback) { |
427 this.callMethod(callback, 'allocationTracesTops'); | 427 this.callMethod(callback, 'allocationTracesTops'); |
428 } | 428 } |
429 | 429 |
430 /** | 430 /** |
431 * @param {number} nodeId | 431 * @param {number} nodeId |
432 * @param {function(!Profiler.HeapSnapshotCommon.AllocationNodeCallers)} callb
ack | 432 * @param {function(!HeapSnapshotModel.AllocationNodeCallers)} callback |
433 */ | 433 */ |
434 allocationNodeCallers(nodeId, callback) { | 434 allocationNodeCallers(nodeId, callback) { |
435 this.callMethod(callback, 'allocationNodeCallers', nodeId); | 435 this.callMethod(callback, 'allocationNodeCallers', nodeId); |
436 } | 436 } |
437 | 437 |
438 /** | 438 /** |
439 * @param {number} nodeIndex | 439 * @param {number} nodeIndex |
440 * @param {function(?Array.<!Profiler.HeapSnapshotCommon.AllocationStackFrame>
)} callback | 440 * @param {function(?Array.<!HeapSnapshotModel.AllocationStackFrame>)} callbac
k |
441 */ | 441 */ |
442 allocationStack(nodeIndex, callback) { | 442 allocationStack(nodeIndex, callback) { |
443 this.callMethod(callback, 'allocationStack', nodeIndex); | 443 this.callMethod(callback, 'allocationStack', nodeIndex); |
444 } | 444 } |
445 | 445 |
446 /** | 446 /** |
447 * @override | 447 * @override |
448 */ | 448 */ |
449 dispose() { | 449 dispose() { |
450 throw new Error('Should never be called'); | 450 throw new Error('Should never be called'); |
451 } | 451 } |
452 | 452 |
453 get nodeCount() { | 453 get nodeCount() { |
454 return this._staticData.nodeCount; | 454 return this._staticData.nodeCount; |
455 } | 455 } |
456 | 456 |
457 get rootNodeIndex() { | 457 get rootNodeIndex() { |
458 return this._staticData.rootNodeIndex; | 458 return this._staticData.rootNodeIndex; |
459 } | 459 } |
460 | 460 |
461 updateStaticData(callback) { | 461 updateStaticData(callback) { |
462 /** | 462 /** |
463 * @param {!Profiler.HeapSnapshotCommon.StaticData} staticData | 463 * @param {!HeapSnapshotModel.StaticData} staticData |
464 * @this {Profiler.HeapSnapshotProxy} | 464 * @this {Profiler.HeapSnapshotProxy} |
465 */ | 465 */ |
466 function dataReceived(staticData) { | 466 function dataReceived(staticData) { |
467 this._staticData = staticData; | 467 this._staticData = staticData; |
468 callback(this); | 468 callback(this); |
469 } | 469 } |
470 this.callMethod(dataReceived.bind(this), 'updateStaticData'); | 470 this.callMethod(dataReceived.bind(this), 'updateStaticData'); |
471 } | 471 } |
472 | 472 |
473 /** | 473 /** |
474 * @return {!Promise.<!Profiler.HeapSnapshotCommon.Statistics>} | 474 * @return {!Promise.<!HeapSnapshotModel.Statistics>} |
475 */ | 475 */ |
476 getStatistics() { | 476 getStatistics() { |
477 return this._callMethodPromise('getStatistics'); | 477 return this._callMethodPromise('getStatistics'); |
478 } | 478 } |
479 | 479 |
480 /** | 480 /** |
481 * @return {!Promise.<?Profiler.HeapSnapshotCommon.Samples>} | 481 * @return {!Promise.<?HeapSnapshotModel.Samples>} |
482 */ | 482 */ |
483 getSamples() { | 483 getSamples() { |
484 return this._callMethodPromise('getSamples'); | 484 return this._callMethodPromise('getSamples'); |
485 } | 485 } |
486 | 486 |
487 get totalSize() { | 487 get totalSize() { |
488 return this._staticData.totalSize; | 488 return this._staticData.totalSize; |
489 } | 489 } |
490 | 490 |
491 get uid() { | 491 get uid() { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 * @param {function(boolean)} callback | 531 * @param {function(boolean)} callback |
532 */ | 532 */ |
533 isEmpty(callback) { | 533 isEmpty(callback) { |
534 this.callMethod(callback, 'isEmpty'); | 534 this.callMethod(callback, 'isEmpty'); |
535 } | 535 } |
536 | 536 |
537 /** | 537 /** |
538 * @override | 538 * @override |
539 * @param {number} startPosition | 539 * @param {number} startPosition |
540 * @param {number} endPosition | 540 * @param {number} endPosition |
541 * @param {function(!Profiler.HeapSnapshotCommon.ItemsRange)} callback | 541 * @param {function(!HeapSnapshotModel.ItemsRange)} callback |
542 */ | 542 */ |
543 serializeItemsRange(startPosition, endPosition, callback) { | 543 serializeItemsRange(startPosition, endPosition, callback) { |
544 this.callMethod(callback, 'serializeItemsRange', startPosition, endPosition)
; | 544 this.callMethod(callback, 'serializeItemsRange', startPosition, endPosition)
; |
545 } | 545 } |
546 | 546 |
547 /** | 547 /** |
548 * @override | 548 * @override |
549 * @param {!Profiler.HeapSnapshotCommon.ComparatorConfig} comparator | 549 * @param {!HeapSnapshotModel.ComparatorConfig} comparator |
550 * @return {!Promise<?>} | 550 * @return {!Promise<?>} |
551 */ | 551 */ |
552 sortAndRewind(comparator) { | 552 sortAndRewind(comparator) { |
553 return this._callMethodPromise('sortAndRewind', comparator); | 553 return this._callMethodPromise('sortAndRewind', comparator); |
554 } | 554 } |
555 }; | 555 }; |
OLD | NEW |