OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 static Node& lastWithinOrSelf(const Node&); | 118 static Node& lastWithinOrSelf(const Node&); |
119 | 119 |
120 private: | 120 private: |
121 enum TraversalDirection { | 121 enum TraversalDirection { |
122 TraversalDirectionForward, | 122 TraversalDirectionForward, |
123 TraversalDirectionBackward | 123 TraversalDirectionBackward |
124 }; | 124 }; |
125 | 125 |
126 static void assertPrecondition(const Node& node) | 126 static void assertPrecondition(const Node& node) |
127 { | 127 { |
128 #if DCHECK_IS_ON() | |
129 DCHECK(!node.needsDistributionRecalc()); | 128 DCHECK(!node.needsDistributionRecalc()); |
130 DCHECK(node.canParticipateInFlatTree()); | 129 DCHECK(node.canParticipateInFlatTree()); |
131 #endif | |
132 } | 130 } |
133 | 131 |
134 static void assertPostcondition(const Node* node) | 132 static void assertPostcondition(const Node* node) |
135 { | 133 { |
136 #if DCHECK_IS_ON() | 134 #if DCHECK_IS_ON() |
137 if (node) | 135 if (node) |
138 assertPrecondition(*node); | 136 assertPrecondition(*node); |
139 #endif | 137 #endif |
140 } | 138 } |
141 | 139 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 } | 303 } |
306 | 304 |
307 inline Node* FlatTreeTraversal::traverseLastChild(const Node& node) | 305 inline Node* FlatTreeTraversal::traverseLastChild(const Node& node) |
308 { | 306 { |
309 return traverseChild(node, TraversalDirectionBackward); | 307 return traverseChild(node, TraversalDirectionBackward); |
310 } | 308 } |
311 | 309 |
312 } // namespace blink | 310 } // namespace blink |
313 | 311 |
314 #endif | 312 #endif |
OLD | NEW |