| Index: third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
|
| index de14f7a56637d737bf52b3e482ddc5cb745a6008..83ba6adf45439a0583546f9b1e0f214cd0403864 100644
|
| --- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
|
| +++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
|
| @@ -158,9 +158,33 @@ bool CSSPrimitiveValue::colorIsDerivedFromElement() const
|
| }
|
|
|
| using CSSTextCache = WillBePersistentHeapHashMap<RawPtrWillBeWeakMember<const CSSPrimitiveValue>, String>;
|
| +
|
| +#if ENABLE(OILPAN) && defined(LEAK_SANITIZER)
|
| +
|
| +namespace {
|
| +// With LSan, wrap the persistent cache so that the registration of the
|
| +// (per-thread) static reference can be done.
|
| +class CSSTextCacheWrapper {
|
| +public:
|
| + CSSTextCacheWrapper()
|
| + {
|
| + m_cache.registerAsStaticReference();
|
| + }
|
| +
|
| + operator CSSTextCache&() { return m_cache; }
|
| +
|
| +private:
|
| + CSSTextCache m_cache;
|
| +};
|
| +
|
| +}
|
| +#else
|
| +using CSSTextCacheWrapper = CSSTextCache;
|
| +#endif
|
| +
|
| static CSSTextCache& cssTextCache()
|
| {
|
| - AtomicallyInitializedStaticReference(ThreadSpecific<CSSTextCache>, cache, new ThreadSpecific<CSSTextCache>());
|
| + AtomicallyInitializedStaticReference(ThreadSpecific<CSSTextCacheWrapper>, cache, new ThreadSpecific<CSSTextCacheWrapper>);
|
| return *cache;
|
| }
|
|
|
|
|