| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #ifndef CollectionIndexCache_h | 32 #ifndef CollectionIndexCache_h |
| 33 #define CollectionIndexCache_h | 33 #define CollectionIndexCache_h |
| 34 | 34 |
| 35 #include "platform/heap/Handle.h" |
| 36 |
| 35 namespace blink { | 37 namespace blink { |
| 36 | 38 |
| 37 template <typename Collection, typename NodeType> | 39 template <typename Collection, typename NodeType> |
| 38 class CollectionIndexCache { | 40 class CollectionIndexCache { |
| 39 DISALLOW_NEW(); | 41 DISALLOW_NEW(); |
| 40 | 42 |
| 41 public: | 43 public: |
| 42 CollectionIndexCache(); | 44 CollectionIndexCache(); |
| 43 | 45 |
| 44 bool isEmpty(const Collection& collection) { | 46 bool isEmpty(const Collection& collection) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 setCachedNodeCount(currentIndex + 1); | 208 setCachedNodeCount(currentIndex + 1); |
| 207 return nullptr; | 209 return nullptr; |
| 208 } | 210 } |
| 209 setCachedNode(currentNode, currentIndex); | 211 setCachedNode(currentNode, currentIndex); |
| 210 return currentNode; | 212 return currentNode; |
| 211 } | 213 } |
| 212 | 214 |
| 213 } // namespace blink | 215 } // namespace blink |
| 214 | 216 |
| 215 #endif // CollectionIndexCache_h | 217 #endif // CollectionIndexCache_h |
| OLD | NEW |