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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Issue 2680843006: Tidy DEFINE_(THREAD_SAFE_)STATIC_LOCAL() implementations. (Closed)
Patch Set: explain safety of HTMLTableSectionElement singletons Created 3 years, 10 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
Index: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
index 56c31fe0b266e8d2497cc35559d694c2c26ea10b..9f2cfafd71616cbacb0e287205fb69505a950283 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -146,16 +146,24 @@ using namespace HTMLNames;
ComputedStyle* StyleResolver::s_styleNotYetAvailable;
static StylePropertySet* leftToRightDeclaration() {
+ // |MutableStylePropertySet::m_cssomWrapper| is a |ScriptWrappable|,
+ // which must not leak between contexts via this singleton. That
+ // cannot happen as that field will not be instantiated for this
+ // particular singleton. Turn off the verification check.
DEFINE_STATIC_LOCAL(MutableStylePropertySet, leftToRightDecl,
haraken 2017/02/11 10:25:20 Ditto. If there's a way to avoid using DEFINE_STAT
- (MutableStylePropertySet::create(HTMLQuirksMode)));
+ (MutableStylePropertySet::create(HTMLQuirksMode)),
+ CheckScriptWrappable::No);
if (leftToRightDecl.isEmpty())
leftToRightDecl.setProperty(CSSPropertyDirection, CSSValueLtr);
return &leftToRightDecl;
}
static StylePropertySet* rightToLeftDeclaration() {
+ // See |leftToRightDeclaration()| comment on why |CheckScriptWrappable::No|
+ // is used.
DEFINE_STATIC_LOCAL(MutableStylePropertySet, rightToLeftDecl,
- (MutableStylePropertySet::create(HTMLQuirksMode)));
+ (MutableStylePropertySet::create(HTMLQuirksMode)),
+ CheckScriptWrappable::No);
if (rightToLeftDecl.isEmpty())
rightToLeftDecl.setProperty(CSSPropertyDirection, CSSValueRtl);
return &rightToLeftDecl;

Powered by Google App Engine
This is Rietveld 408576698