Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: Source/core/layout/OrderIterator.h

Issue 1318713003: Make classes and structures in core/layout fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 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. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef OrderIterator_h 31 #ifndef OrderIterator_h
32 #define OrderIterator_h 32 #define OrderIterator_h
33 33
34 #include "wtf/Allocator.h"
34 #include "wtf/Noncopyable.h" 35 #include "wtf/Noncopyable.h"
35 36
36 #include <set> 37 #include <set>
37 38
38 namespace blink { 39 namespace blink {
39 40
40 class LayoutBox; 41 class LayoutBox;
41 42
42 class OrderIterator { 43 class OrderIterator {
44 DISALLOW_ALLOCATION();
43 WTF_MAKE_NONCOPYABLE(OrderIterator); 45 WTF_MAKE_NONCOPYABLE(OrderIterator);
44 public: 46 public:
45 friend class OrderIteratorPopulator; 47 friend class OrderIteratorPopulator;
46 48
47 OrderIterator(const LayoutBox*); 49 OrderIterator(const LayoutBox*);
48 50
49 LayoutBox* currentChild() const { return m_currentChild; } 51 LayoutBox* currentChild() const { return m_currentChild; }
50 LayoutBox* first(); 52 LayoutBox* first();
51 LayoutBox* next(); 53 LayoutBox* next();
52 void reset(); 54 void reset();
53 55
54 private: 56 private:
55 const LayoutBox* m_containerBox; 57 const LayoutBox* m_containerBox;
56 58
57 LayoutBox* m_currentChild; 59 LayoutBox* m_currentChild;
58 60
59 typedef std::set<int> OrderValues; 61 typedef std::set<int> OrderValues;
60 OrderValues m_orderValues; 62 OrderValues m_orderValues;
61 OrderValues::const_iterator m_orderValuesIterator; 63 OrderValues::const_iterator m_orderValuesIterator;
62 bool m_isReset; 64 bool m_isReset;
63 }; 65 };
64 66
65 class OrderIteratorPopulator { 67 class OrderIteratorPopulator {
68 STACK_ALLOCATED();
66 public: 69 public:
67 explicit OrderIteratorPopulator(OrderIterator& iterator) 70 explicit OrderIteratorPopulator(OrderIterator& iterator)
68 : m_iterator(iterator) 71 : m_iterator(iterator)
69 { 72 {
70 m_iterator.m_orderValues.clear(); 73 m_iterator.m_orderValues.clear();
71 } 74 }
72 75
73 ~OrderIteratorPopulator(); 76 ~OrderIteratorPopulator();
74 77
75 void collectChild(const LayoutBox*); 78 void collectChild(const LayoutBox*);
76 79
77 private: 80 private:
78 OrderIterator& m_iterator; 81 OrderIterator& m_iterator;
79 }; 82 };
80 83
81 } // namespace blink 84 } // namespace blink
82 85
83 #endif // OrderIterator_h 86 #endif // OrderIterator_h
OLDNEW
« no previous file with comments | « Source/core/layout/MultiColumnFragmentainerGroup.h ('k') | Source/core/layout/PaintInvalidationState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698