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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_layout_opportunity_iterator.h

Issue 2438313003: [LayoutNG] Remove derived constraint spaces from opportunity iterator. (Closed)
Patch Set: .. Created 4 years, 2 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NGLayoutOpportunityIterator_h 5 #ifndef NGLayoutOpportunityIterator_h
6 #define NGLayoutOpportunityIterator_h 6 #define NGLayoutOpportunityIterator_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/layout/ng/ng_constraint_space.h" 9 #include "core/layout/ng/ng_constraint_space.h"
10 #include "core/layout/ng/ng_layout_opportunity_tree_node.h" 10 #include "core/layout/ng/ng_layout_opportunity_tree_node.h"
11 #include "core/layout/ng/ng_units.h" 11 #include "core/layout/ng/ng_units.h"
12 #include "platform/heap/Handle.h" 12 #include "platform/heap/Handle.h"
13 #include "wtf/text/WTFString.h" 13 #include "wtf/text/WTFString.h"
14 #include "wtf/Vector.h" 14 #include "wtf/Vector.h"
15 15
16 namespace blink { 16 namespace blink {
17 17
18 typedef const NGConstraintSpace NGLayoutOpportunity; 18 typedef const NGConstraintSpace NGLayoutOpportunity;
Gleb Lanbin 2016/10/21 21:06:58 change typedef const NGConstraintSpace NGLayoutOpp
ikilpatrick 2016/10/21 21:45:27 Done.
19 typedef HeapVector<Member<const NGLayoutOpportunity>> NGLayoutOpportunities; 19 typedef Vector<NGLogicalRect> NGLayoutOpportunities;
Gleb Lanbin 2016/10/21 21:06:58 typedef Vector<const NGLayoutOpportunity> NGLayout
ikilpatrick 2016/10/21 21:45:27 Done.
20 20
21 class CORE_EXPORT NGLayoutOpportunityIterator final 21 class CORE_EXPORT NGLayoutOpportunityIterator final
22 : public GarbageCollected<NGLayoutOpportunityIterator> { 22 : public GarbageCollectedFinalized<NGLayoutOpportunityIterator> {
23 public: 23 public:
24 NGLayoutOpportunityIterator(NGConstraintSpace* space, 24 NGLayoutOpportunityIterator(NGConstraintSpace* space,
25 unsigned clear, 25 unsigned clear,
26 bool for_inline_or_bfc); 26 bool for_inline_or_bfc);
27 27
28 // Gets the next Layout Opportunity or nullptr if the search is exhausted. 28 // Gets the next Layout Opportunity or nullptr if the search is exhausted.
29 // TODO(chrome-layout-team): Refactor with using C++ <iterator> library. 29 // TODO(chrome-layout-team): Refactor with using C++ <iterator> library.
30 NGLayoutOpportunity* Next(); 30 const NGLogicalRect* Next();
31 31
32 DEFINE_INLINE_VIRTUAL_TRACE() { 32 DEFINE_INLINE_VIRTUAL_TRACE() {
33 visitor->trace(constraint_space_); 33 visitor->trace(constraint_space_);
34 visitor->trace(opportunities_);
35 visitor->trace(opportunity_tree_root_); 34 visitor->trace(opportunity_tree_root_);
36 } 35 }
37 36
38 private: 37 private:
39 Member<NGConstraintSpace> constraint_space_; 38 Member<NGConstraintSpace> constraint_space_;
40 39
41 NGLayoutOpportunities opportunities_; 40 NGLayoutOpportunities opportunities_;
42 Vector<Member<NGLayoutOpportunity>>::const_iterator opportunity_iter_; 41 NGLayoutOpportunities::const_iterator opportunity_iter_;
43 Member<NGLayoutOpportunityTreeNode> opportunity_tree_root_; 42 Member<NGLayoutOpportunityTreeNode> opportunity_tree_root_;
44 }; 43 };
45 44
46 } // namespace blink 45 } // namespace blink
47 46
48 #endif // NGLayoutOpportunityIterator_h 47 #endif // NGLayoutOpportunityIterator_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698