summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfs <fs@opera.com>2015-12-07 17:26:43 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-08 01:27:43 +0000
commit56c43a002072a04abe25a77f400a1e3425ab8991 (patch)
tree0a966c521b9d56d1f2803f2827c721092b50edf6
parent1622efb4e4c04a6957011665ddf4b7568cdf5d1f (diff)
downloadchromium_src-56c43a002072a04abe25a77f400a1e3425ab8991.zip
chromium_src-56c43a002072a04abe25a77f400a1e3425ab8991.tar.gz
chromium_src-56c43a002072a04abe25a77f400a1e3425ab8991.tar.bz2
Avoid race-warning for access to animatableAttributes
Collecting debug data during a commit in CC can land us in this method while not running in the main thread (although it'll be blocked). Since this is assert-only code, switch to a thread-safe initializer to avoid triggering this warning. Hopefully this doesn't slow things down to badly on bots. BUG=545972 Review URL: https://codereview.chromium.org/1487813002 Cr-Commit-Position: refs/heads/master@{#363687}
-rw-r--r--third_party/WebKit/Source/core/svg/SVGElement.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/third_party/WebKit/Source/core/svg/SVGElement.cpp b/third_party/WebKit/Source/core/svg/SVGElement.cpp
index f98217d..d545acb 100644
--- a/third_party/WebKit/Source/core/svg/SVGElement.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGElement.cpp
@@ -51,6 +51,7 @@
#include "core/svg/properties/SVGProperty.h"
#include "platform/JSONValues.h"
#include "wtf/TemporaryChange.h"
+#include "wtf/Threading.h"
namespace blink {
@@ -1007,7 +1008,9 @@ SVGElement::InstanceUpdateBlocker::~InstanceUpdateBlocker()
#if ENABLE(ASSERT)
bool SVGElement::isAnimatableAttribute(const QualifiedName& name) const
{
- DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, animatableAttributes, ());
+ // This static is atomically initialized to dodge a warning about
+ // a race when dumping debug data for a layer.
+ AtomicallyInitializedStaticReference(HashSet<QualifiedName>, animatableAttributes, new HashSet<QualifiedName>());
if (animatableAttributes.isEmpty()) {
const QualifiedName* const animatableAttrs[] = {