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 copyright | 8 * * Redistributions of source code must retain the above copyright |
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 }; | 130 }; |
131 | 131 |
132 | 132 |
133 | 133 |
134 /** | 134 /** |
135 * @interface | 135 * @interface |
136 */ | 136 */ |
137 WebInspector.HeapSnapshotItemIterator = function() { } | 137 WebInspector.HeapSnapshotItemIterator = function() { } |
138 | 138 |
139 WebInspector.HeapSnapshotItemIterator.prototype = { | 139 WebInspector.HeapSnapshotItemIterator.prototype = { |
140 rewind: function() { }, | |
141 | |
142 /** | 140 /** |
143 * @return {boolean} | 141 * @return {boolean} |
144 */ | 142 */ |
145 hasNext: function() { }, | 143 hasNext: function() { }, |
146 | 144 |
147 /** | 145 /** |
148 * @return {number} | 146 * @return {number} |
149 */ | 147 */ |
150 index: function() { }, | 148 index: function() { }, |
151 | 149 |
(...skipping 16 matching lines...) Expand all Loading... |
168 * @constructor | 166 * @constructor |
169 * @implements {WebInspector.HeapSnapshotItemIterator} | 167 * @implements {WebInspector.HeapSnapshotItemIterator} |
170 * @param {!WebInspector.HeapSnapshotEdge} edge | 168 * @param {!WebInspector.HeapSnapshotEdge} edge |
171 */ | 169 */ |
172 WebInspector.HeapSnapshotEdgeIterator = function(edge) | 170 WebInspector.HeapSnapshotEdgeIterator = function(edge) |
173 { | 171 { |
174 this.edge = edge; | 172 this.edge = edge; |
175 } | 173 } |
176 | 174 |
177 WebInspector.HeapSnapshotEdgeIterator.prototype = { | 175 WebInspector.HeapSnapshotEdgeIterator.prototype = { |
178 rewind: function() | |
179 { | |
180 this.edge.edgeIndex = 0; | |
181 }, | |
182 | |
183 /** | 176 /** |
184 * @return {boolean} | 177 * @return {boolean} |
185 */ | 178 */ |
186 hasNext: function() | 179 hasNext: function() |
187 { | 180 { |
188 return this.edge.edgeIndex < this.edge._edges.length; | 181 return this.edge.edgeIndex < this.edge._edges.length; |
189 }, | 182 }, |
190 | 183 |
191 /** | 184 /** |
192 * @return {number} | 185 * @return {number} |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 * @constructor | 360 * @constructor |
368 * @implements {WebInspector.HeapSnapshotItemIterator} | 361 * @implements {WebInspector.HeapSnapshotItemIterator} |
369 * @param {!WebInspector.HeapSnapshotRetainerEdge} retainer | 362 * @param {!WebInspector.HeapSnapshotRetainerEdge} retainer |
370 */ | 363 */ |
371 WebInspector.HeapSnapshotRetainerEdgeIterator = function(retainer) | 364 WebInspector.HeapSnapshotRetainerEdgeIterator = function(retainer) |
372 { | 365 { |
373 this.retainer = retainer; | 366 this.retainer = retainer; |
374 } | 367 } |
375 | 368 |
376 WebInspector.HeapSnapshotRetainerEdgeIterator.prototype = { | 369 WebInspector.HeapSnapshotRetainerEdgeIterator.prototype = { |
377 rewind: function() | |
378 { | |
379 this.retainer.setRetainerIndex(0); | |
380 }, | |
381 | |
382 /** | 370 /** |
383 * @return {boolean} | 371 * @return {boolean} |
384 */ | 372 */ |
385 hasNext: function() | 373 hasNext: function() |
386 { | 374 { |
387 return this.retainer.retainerIndex() < this.retainer._retainersCount; | 375 return this.retainer.retainerIndex() < this.retainer._retainersCount; |
388 }, | 376 }, |
389 | 377 |
390 /** | 378 /** |
391 * @return {number} | 379 * @return {number} |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 * @implements {WebInspector.HeapSnapshotItemIterator} | 631 * @implements {WebInspector.HeapSnapshotItemIterator} |
644 * @param {!WebInspector.HeapSnapshotNode} node | 632 * @param {!WebInspector.HeapSnapshotNode} node |
645 */ | 633 */ |
646 WebInspector.HeapSnapshotNodeIterator = function(node) | 634 WebInspector.HeapSnapshotNodeIterator = function(node) |
647 { | 635 { |
648 this.node = node; | 636 this.node = node; |
649 this._nodesLength = node._snapshot._nodes.length; | 637 this._nodesLength = node._snapshot._nodes.length; |
650 } | 638 } |
651 | 639 |
652 WebInspector.HeapSnapshotNodeIterator.prototype = { | 640 WebInspector.HeapSnapshotNodeIterator.prototype = { |
653 rewind: function() | |
654 { | |
655 this.node.nodeIndex = this.node._firstNodeIndex; | |
656 }, | |
657 | |
658 /** | 641 /** |
659 * @return {boolean} | 642 * @return {boolean} |
660 */ | 643 */ |
661 hasNext: function() | 644 hasNext: function() |
662 { | 645 { |
663 return this.node.nodeIndex < this._nodesLength; | 646 return this.node.nodeIndex < this._nodesLength; |
664 }, | 647 }, |
665 | 648 |
666 /** | 649 /** |
667 * @return {number} | 650 * @return {number} |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 */ | 685 */ |
703 WebInspector.HeapSnapshotIndexRangeIterator = function(iterator, indexes) | 686 WebInspector.HeapSnapshotIndexRangeIterator = function(iterator, indexes) |
704 { | 687 { |
705 this._iterator = iterator; | 688 this._iterator = iterator; |
706 this._indexes = indexes; | 689 this._indexes = indexes; |
707 this._position = 0; | 690 this._position = 0; |
708 this._forcedIndex = -1; | 691 this._forcedIndex = -1; |
709 } | 692 } |
710 | 693 |
711 WebInspector.HeapSnapshotIndexRangeIterator.prototype = { | 694 WebInspector.HeapSnapshotIndexRangeIterator.prototype = { |
712 rewind: function() { }, | |
713 | |
714 /** | 695 /** |
715 * @return {boolean} | 696 * @return {boolean} |
716 */ | 697 */ |
717 hasNext: function() | 698 hasNext: function() |
718 { | 699 { |
719 return this._position < this._indexes.length | 700 return this._position < this._indexes.length |
720 }, | 701 }, |
721 | 702 |
722 /** | 703 /** |
723 * @return {number} | 704 * @return {number} |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 * @param {!WebInspector.HeapSnapshotItemIterator} iterator | 740 * @param {!WebInspector.HeapSnapshotItemIterator} iterator |
760 */ | 741 */ |
761 WebInspector.HeapSnapshotFilteredIterator = function(iterator, filter) | 742 WebInspector.HeapSnapshotFilteredIterator = function(iterator, filter) |
762 { | 743 { |
763 this._iterator = iterator; | 744 this._iterator = iterator; |
764 this._filter = filter; | 745 this._filter = filter; |
765 this._skipFilteredItems(); | 746 this._skipFilteredItems(); |
766 } | 747 } |
767 | 748 |
768 WebInspector.HeapSnapshotFilteredIterator.prototype = { | 749 WebInspector.HeapSnapshotFilteredIterator.prototype = { |
769 rewind: function() { }, | |
770 | |
771 /** | 750 /** |
772 * @return {boolean} | 751 * @return {boolean} |
773 */ | 752 */ |
774 hasNext: function() | 753 hasNext: function() |
775 { | 754 { |
776 return this._iterator.hasNext(); | 755 return this._iterator.hasNext(); |
777 }, | 756 }, |
778 | 757 |
779 /** | 758 /** |
780 * @return {number} | 759 * @return {number} |
(...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2311 * @param {number} windowRight | 2290 * @param {number} windowRight |
2312 */ | 2291 */ |
2313 sort: function(comparator, leftBound, rightBound, windowLeft, windowRight) | 2292 sort: function(comparator, leftBound, rightBound, windowLeft, windowRight) |
2314 { | 2293 { |
2315 this._iterationOrder.sortRange(this._buildCompareFunction(comparator), l
eftBound, rightBound, windowLeft, windowRight); | 2294 this._iterationOrder.sortRange(this._buildCompareFunction(comparator), l
eftBound, rightBound, windowLeft, windowRight); |
2316 }, | 2295 }, |
2317 | 2296 |
2318 __proto__: WebInspector.HeapSnapshotItemProvider.prototype | 2297 __proto__: WebInspector.HeapSnapshotItemProvider.prototype |
2319 } | 2298 } |
2320 | 2299 |
OLD | NEW |