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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 // If we hit the end of either list above we need to reattach all remaining
nodes. | 86 // If we hit the end of either list above we need to reattach all remaining
nodes. |
87 | 87 |
88 for ( ; i < m_distributedNodes.size(); ++i) | 88 for ( ; i < m_distributedNodes.size(); ++i) |
89 m_distributedNodes.at(i)->lazyReattachIfAttached(); | 89 m_distributedNodes.at(i)->lazyReattachIfAttached(); |
90 | 90 |
91 for ( ; j < distributedNodes.size(); ++j) | 91 for ( ; j < distributedNodes.size(); ++j) |
92 distributedNodes.at(j)->lazyReattachIfAttached(); | 92 distributedNodes.at(j)->lazyReattachIfAttached(); |
93 | 93 |
94 m_distributedNodes.swap(distributedNodes); | 94 m_distributedNodes.swap(distributedNodes); |
95 #if ENABLE(OILPAN) | 95 // Deallocate a Vector and a HashMap explicitly so that |
96 // Deallocate a Vector and a HashMap explicitly in order that Oilpan can | 96 // Oilpan can recycle them without an intervening GC. |
97 // recycle them without GC. | |
98 distributedNodes.clear(); | 97 distributedNodes.clear(); |
99 #endif | |
100 m_distributedNodes.shrinkToFit(); | 98 m_distributedNodes.shrinkToFit(); |
101 } | 99 } |
102 | 100 |
103 void InsertionPoint::attach(const AttachContext& context) | 101 void InsertionPoint::attach(const AttachContext& context) |
104 { | 102 { |
105 // We need to attach the distribution here so that they're inserted in the r
ight order | 103 // We need to attach the distribution here so that they're inserted in the r
ight order |
106 // otherwise the n^2 protection inside LayoutTreeBuilder will cause them to
be | 104 // otherwise the n^2 protection inside LayoutTreeBuilder will cause them to
be |
107 // inserted in the wrong place later. This also lets distributed nodes benef
it from | 105 // inserted in the wrong place later. This also lets distributed nodes benef
it from |
108 // the n^2 protection. | 106 // the n^2 protection. |
109 for (size_t i = 0; i < m_distributedNodes.size(); ++i) { | 107 for (size_t i = 0; i < m_distributedNodes.size(); ++i) { |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 if (!insertionPoints) | 285 if (!insertionPoints) |
288 return; | 286 return; |
289 for (size_t i = 0; i < insertionPoints->size(); ++i) | 287 for (size_t i = 0; i < insertionPoints->size(); ++i) |
290 results.append(insertionPoints->at(i).get()); | 288 results.append(insertionPoints->at(i).get()); |
291 DCHECK_NE(current, insertionPoints->last().get()); | 289 DCHECK_NE(current, insertionPoints->last().get()); |
292 current = insertionPoints->last().get(); | 290 current = insertionPoints->last().get(); |
293 } | 291 } |
294 } | 292 } |
295 | 293 |
296 } // namespace blink | 294 } // namespace blink |
OLD | NEW |