| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * Copyright (C) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 return false; | 89 return false; |
| 90 } | 90 } |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 class MatchedPropertiesCache { | 93 class MatchedPropertiesCache { |
| 94 DISALLOW_NEW(); | 94 DISALLOW_NEW(); |
| 95 WTF_MAKE_NONCOPYABLE(MatchedPropertiesCache); | 95 WTF_MAKE_NONCOPYABLE(MatchedPropertiesCache); |
| 96 | 96 |
| 97 public: | 97 public: |
| 98 MatchedPropertiesCache(); | 98 MatchedPropertiesCache(); |
| 99 ~MatchedPropertiesCache() { ASSERT(m_cache.isEmpty()); } | 99 ~MatchedPropertiesCache() { DCHECK(m_cache.isEmpty()); } |
| 100 | 100 |
| 101 const CachedMatchedProperties* find(unsigned hash, | 101 const CachedMatchedProperties* find(unsigned hash, |
| 102 const StyleResolverState&, | 102 const StyleResolverState&, |
| 103 const MatchedPropertiesVector&); | 103 const MatchedPropertiesVector&); |
| 104 void add(const ComputedStyle&, | 104 void add(const ComputedStyle&, |
| 105 const ComputedStyle& parentStyle, | 105 const ComputedStyle& parentStyle, |
| 106 unsigned hash, | 106 unsigned hash, |
| 107 const MatchedPropertiesVector&); | 107 const MatchedPropertiesVector&); |
| 108 | 108 |
| 109 void clear(); | 109 void clear(); |
| 110 void clearViewportDependent(); | 110 void clearViewportDependent(); |
| 111 | 111 |
| 112 static bool isCacheable(const StyleResolverState&); | 112 static bool isCacheable(const StyleResolverState&); |
| 113 | 113 |
| 114 DECLARE_TRACE(); | 114 DECLARE_TRACE(); |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 using Cache = HeapHashMap<unsigned, | 117 using Cache = HeapHashMap<unsigned, |
| 118 Member<CachedMatchedProperties>, | 118 Member<CachedMatchedProperties>, |
| 119 DefaultHash<unsigned>::Hash, | 119 DefaultHash<unsigned>::Hash, |
| 120 HashTraits<unsigned>, | 120 HashTraits<unsigned>, |
| 121 CachedMatchedPropertiesHashTraits>; | 121 CachedMatchedPropertiesHashTraits>; |
| 122 Cache m_cache; | 122 Cache m_cache; |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace blink | 125 } // namespace blink |
| 126 | 126 |
| 127 #endif | 127 #endif |
| OLD | NEW |