| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012,2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2012,2013 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Apple Inc. All rights reserved. | 3 * Copyright (C) 2014 Apple Inc. 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 22 matching lines...) Expand all Loading... |
| 33 #define CollectionItemsCache_h | 33 #define CollectionItemsCache_h |
| 34 | 34 |
| 35 #include "core/html/CollectionIndexCache.h" | 35 #include "core/html/CollectionIndexCache.h" |
| 36 #include "wtf/Vector.h" | 36 #include "wtf/Vector.h" |
| 37 #include <v8.h> | 37 #include <v8.h> |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 template <typename Collection, typename NodeType> | 41 template <typename Collection, typename NodeType> |
| 42 class CollectionItemsCache : public CollectionIndexCache<Collection, NodeType> { | 42 class CollectionItemsCache : public CollectionIndexCache<Collection, NodeType> { |
| 43 DISALLOW_ALLOCATION(); | 43 DISALLOW_NEW(); |
| 44 | 44 |
| 45 typedef CollectionIndexCache<Collection, NodeType> Base; | 45 typedef CollectionIndexCache<Collection, NodeType> Base; |
| 46 | 46 |
| 47 public: | 47 public: |
| 48 CollectionItemsCache(); | 48 CollectionItemsCache(); |
| 49 ~CollectionItemsCache(); | 49 ~CollectionItemsCache(); |
| 50 | 50 |
| 51 DEFINE_INLINE_VIRTUAL_TRACE() | 51 DEFINE_INLINE_VIRTUAL_TRACE() |
| 52 { | 52 { |
| 53 visitor->trace(m_cachedList); | 53 visitor->trace(m_cachedList); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 if (m_listValid) { | 119 if (m_listValid) { |
| 120 ASSERT(this->isCachedNodeCountValid()); | 120 ASSERT(this->isCachedNodeCountValid()); |
| 121 return index < this->cachedNodeCount() ? m_cachedList[index] : nullptr; | 121 return index < this->cachedNodeCount() ? m_cachedList[index] : nullptr; |
| 122 } | 122 } |
| 123 return Base::nodeAt(collection, index); | 123 return Base::nodeAt(collection, index); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace blink | 126 } // namespace blink |
| 127 | 127 |
| 128 #endif // CollectionItemsCache_h | 128 #endif // CollectionItemsCache_h |
| OLD | NEW |