Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> | 4 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 531 // Comparison. | 531 // Comparison. |
| 532 bool operator==(const ListHashSetIterator& other) const { | 532 bool operator==(const ListHashSetIterator& other) const { |
| 533 return m_iterator == other.m_iterator; | 533 return m_iterator == other.m_iterator; |
| 534 } | 534 } |
| 535 bool operator!=(const ListHashSetIterator& other) const { | 535 bool operator!=(const ListHashSetIterator& other) const { |
| 536 return m_iterator != other.m_iterator; | 536 return m_iterator != other.m_iterator; |
| 537 } | 537 } |
| 538 | 538 |
| 539 operator const_iterator() const { return m_iterator; } | 539 operator const_iterator() const { return m_iterator; } |
| 540 | 540 |
| 541 template <typename VisitorDispatcher> | |
| 542 void trace(VisitorDispatcher visitor) { | |
| 543 m_iterator.trace(visitor); | |
| 544 } | |
| 545 | |
| 541 private: | 546 private: |
| 542 Node* getNode() { return m_iterator.getNode(); } | 547 Node* getNode() { return m_iterator.getNode(); } |
| 543 | 548 |
| 544 const_iterator m_iterator; | 549 const_iterator m_iterator; |
| 545 | 550 |
| 546 template <typename T, size_t inlineCapacity, typename U, typename V> | 551 template <typename T, size_t inlineCapacity, typename U, typename V> |
| 547 friend class ListHashSet; | 552 friend class ListHashSet; |
| 548 }; | 553 }; |
| 549 | 554 |
| 550 template <typename Set> | 555 template <typename Set> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 588 // Postfix ++ and -- intentionally omitted. | 593 // Postfix ++ and -- intentionally omitted. |
| 589 | 594 |
| 590 // Comparison. | 595 // Comparison. |
| 591 bool operator==(const ListHashSetConstIterator& other) const { | 596 bool operator==(const ListHashSetConstIterator& other) const { |
| 592 return m_position == other.m_position; | 597 return m_position == other.m_position; |
| 593 } | 598 } |
| 594 bool operator!=(const ListHashSetConstIterator& other) const { | 599 bool operator!=(const ListHashSetConstIterator& other) const { |
| 595 return m_position != other.m_position; | 600 return m_position != other.m_position; |
| 596 } | 601 } |
| 597 | 602 |
| 603 template <typename VisitorDispatcher> | |
| 604 void trace(VisitorDispatcher visitor) { | |
| 605 visitor->trace(*m_set); | |
| 606 visitor->trace(m_position); | |
| 607 } | |
| 608 | |
| 598 private: | 609 private: |
| 599 Node* getNode() { return m_position; } | 610 Node* getNode() { return m_position; } |
| 600 | 611 |
| 601 const Set* m_set; | 612 const Set* m_set; |
| 602 Node* m_position; | 613 Node* m_position; |
| 603 | 614 |
| 604 template <typename T, size_t inlineCapacity, typename U, typename V> | 615 template <typename T, size_t inlineCapacity, typename U, typename V> |
| 605 friend class ListHashSet; | 616 friend class ListHashSet; |
| 606 }; | 617 }; |
| 607 | 618 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 642 // Comparison. | 653 // Comparison. |
| 643 bool operator==(const ListHashSetReverseIterator& other) const { | 654 bool operator==(const ListHashSetReverseIterator& other) const { |
| 644 return m_iterator == other.m_iterator; | 655 return m_iterator == other.m_iterator; |
| 645 } | 656 } |
| 646 bool operator!=(const ListHashSetReverseIterator& other) const { | 657 bool operator!=(const ListHashSetReverseIterator& other) const { |
| 647 return m_iterator != other.m_iterator; | 658 return m_iterator != other.m_iterator; |
| 648 } | 659 } |
| 649 | 660 |
| 650 operator const_reverse_iterator() const { return m_iterator; } | 661 operator const_reverse_iterator() const { return m_iterator; } |
| 651 | 662 |
| 663 template <typename VisitorDispatcher> | |
| 664 void trace(VisitorDispatcher visitor) { | |
| 665 m_iterator.trace(visitor); | |
|
haraken
2016/12/20 02:53:05
Just to confirm: This iterator is just pointing to
sof
2016/12/20 06:37:08
Yes, the nodes in this list are separately allocat
| |
| 666 } | |
| 667 | |
| 652 private: | 668 private: |
| 653 Node* getNode() { return m_iterator.node(); } | 669 Node* getNode() { return m_iterator.node(); } |
| 654 | 670 |
| 655 const_reverse_iterator m_iterator; | 671 const_reverse_iterator m_iterator; |
| 656 | 672 |
| 657 template <typename T, size_t inlineCapacity, typename U, typename V> | 673 template <typename T, size_t inlineCapacity, typename U, typename V> |
| 658 friend class ListHashSet; | 674 friend class ListHashSet; |
| 659 }; | 675 }; |
| 660 | 676 |
| 661 template <typename Set> | 677 template <typename Set> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 699 // Postfix ++ and -- intentionally omitted. | 715 // Postfix ++ and -- intentionally omitted. |
| 700 | 716 |
| 701 // Comparison. | 717 // Comparison. |
| 702 bool operator==(const ListHashSetConstReverseIterator& other) const { | 718 bool operator==(const ListHashSetConstReverseIterator& other) const { |
| 703 return m_position == other.m_position; | 719 return m_position == other.m_position; |
| 704 } | 720 } |
| 705 bool operator!=(const ListHashSetConstReverseIterator& other) const { | 721 bool operator!=(const ListHashSetConstReverseIterator& other) const { |
| 706 return m_position != other.m_position; | 722 return m_position != other.m_position; |
| 707 } | 723 } |
| 708 | 724 |
| 725 template <typename VisitorDispatcher> | |
| 726 void trace(VisitorDispatcher visitor) { | |
| 727 visitor->trace(*m_set); | |
| 728 visitor->trace(m_position); | |
| 729 } | |
| 730 | |
| 709 private: | 731 private: |
| 710 Node* getNode() { return m_position; } | 732 Node* getNode() { return m_position; } |
| 711 | 733 |
| 712 const Set* m_set; | 734 const Set* m_set; |
| 713 Node* m_position; | 735 Node* m_position; |
| 714 | 736 |
| 715 template <typename T, size_t inlineCapacity, typename U, typename V> | 737 template <typename T, size_t inlineCapacity, typename U, typename V> |
| 716 friend class ListHashSet; | 738 friend class ListHashSet; |
| 717 }; | 739 }; |
| 718 | 740 |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1107 // through the HashTable. That includes m_head and m_tail so we do not have | 1129 // through the HashTable. That includes m_head and m_tail so we do not have |
| 1108 // to explicitly trace them here. | 1130 // to explicitly trace them here. |
| 1109 m_impl.trace(visitor); | 1131 m_impl.trace(visitor); |
| 1110 } | 1132 } |
| 1111 | 1133 |
| 1112 } // namespace WTF | 1134 } // namespace WTF |
| 1113 | 1135 |
| 1114 using WTF::ListHashSet; | 1136 using WTF::ListHashSet; |
| 1115 | 1137 |
| 1116 #endif // WTF_ListHashSet_h | 1138 #endif // WTF_ListHashSet_h |
| OLD | NEW |