Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp

Issue 1667813002: Allow cssTextCache to be used on the main thread only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add back release assert Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 c75236746b912b5a401770e520f52b252cbe468e..e0a2c77a8136577e2eed8503a7e9512d6985d109 100644
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
@@ -30,8 +30,6 @@
#include "platform/LayoutUnit.h"
#include "platform/fonts/FontMetrics.h"
#include "wtf/StdLibExtras.h"
-#include "wtf/ThreadSpecific.h"
-#include "wtf/Threading.h"
#include "wtf/text/StringBuffer.h"
#include "wtf/text/StringBuilder.h"
@@ -158,33 +156,11 @@ 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()
{
- DEFINE_THREAD_SAFE_STATIC_LOCAL(ThreadSpecific<CSSTextCacheWrapper>, cache, new ThreadSpecific<CSSTextCacheWrapper>);
- return *cache;
+ RELEASE_ASSERT(isMainThread());
+ DEFINE_STATIC_LOCAL(CSSTextCache, cache, ());
+ return cache;
}
CSSPrimitiveValue::UnitType CSSPrimitiveValue::typeWithCalcResolved() const
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698