| OLD | NEW |
| 1 /* | 1 /* |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv
ed. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv
ed. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 case CSSValueWebkitLink: | 151 case CSSValueWebkitLink: |
| 152 case CSSValueWebkitActivelink: | 152 case CSSValueWebkitActivelink: |
| 153 case CSSValueCurrentcolor: | 153 case CSSValueCurrentcolor: |
| 154 return true; | 154 return true; |
| 155 default: | 155 default: |
| 156 return false; | 156 return false; |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 using CSSTextCache = WillBePersistentHeapHashMap<RawPtrWillBeWeakMember<const CS
SPrimitiveValue>, String>; | 160 using CSSTextCache = WillBePersistentHeapHashMap<RawPtrWillBeWeakMember<const CS
SPrimitiveValue>, String>; |
| 161 | |
| 162 #if ENABLE(OILPAN) && defined(LEAK_SANITIZER) | |
| 163 | |
| 164 namespace { | |
| 165 // With LSan, wrap the persistent cache so that the registration of the | |
| 166 // (per-thread) static reference can be done. | |
| 167 class CSSTextCacheWrapper { | |
| 168 public: | |
| 169 CSSTextCacheWrapper() | |
| 170 { | |
| 171 m_cache.registerAsStaticReference(); | |
| 172 } | |
| 173 | |
| 174 operator CSSTextCache&() { return m_cache; } | |
| 175 | |
| 176 private: | |
| 177 CSSTextCache m_cache; | |
| 178 }; | |
| 179 | |
| 180 } | |
| 181 #else | |
| 182 using CSSTextCacheWrapper = CSSTextCache; | |
| 183 #endif | |
| 184 | |
| 185 static CSSTextCache& cssTextCache() | 161 static CSSTextCache& cssTextCache() |
| 186 { | 162 { |
| 187 AtomicallyInitializedStaticReference(ThreadSpecific<CSSTextCacheWrapper>, ca
che, new ThreadSpecific<CSSTextCacheWrapper>); | 163 AtomicallyInitializedStaticReference(ThreadSpecific<CSSTextCache>, cache, ne
w ThreadSpecific<CSSTextCache>()); |
| 188 return *cache; | 164 return *cache; |
| 189 } | 165 } |
| 190 | 166 |
| 191 CSSPrimitiveValue::UnitType CSSPrimitiveValue::typeWithCalcResolved() const | 167 CSSPrimitiveValue::UnitType CSSPrimitiveValue::typeWithCalcResolved() const |
| 192 { | 168 { |
| 193 if (type() != UnitType::Calc) | 169 if (type() != UnitType::Calc) |
| 194 return type(); | 170 return type(); |
| 195 | 171 |
| 196 switch (m_value.calc->category()) { | 172 switch (m_value.calc->category()) { |
| 197 case CalcAngle: | 173 case CalcAngle: |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 visitor->trace(m_value.calc); | 838 visitor->trace(m_value.calc); |
| 863 break; | 839 break; |
| 864 default: | 840 default: |
| 865 break; | 841 break; |
| 866 } | 842 } |
| 867 #endif | 843 #endif |
| 868 CSSValue::traceAfterDispatch(visitor); | 844 CSSValue::traceAfterDispatch(visitor); |
| 869 } | 845 } |
| 870 | 846 |
| 871 } // namespace blink | 847 } // namespace blink |
| OLD | NEW |