Skip to content

Commit 960d3fd

Browse files
committed
Prefer isolated copy of name string when copying Nicosia animations
The name StringImpl object can be shared with comositor thread if animaton source object has name StringImpl with ref count 1 (and so isSafeToSendToAnotherThread would return true). Which can lead to a race in StingImpl ref/deref between main and compositor threads.
1 parent 33bfbb4 commit 960d3fd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Source/WebCore/platform/graphics/nicosia/NicosiaAnimation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ Animation::Animation(const String& name, const KeyframeValueList& keyframes, con
184184
}
185185

186186
Animation::Animation(const Animation& other)
187-
: m_name(other.m_name.isSafeToSendToAnotherThread() ? other.m_name : other.m_name.isolatedCopy())
187+
: m_name(other.m_name.isolatedCopy())
188188
, m_keyframes(other.m_keyframes)
189189
, m_boxSize(other.m_boxSize)
190190
, m_timingFunction(other.m_timingFunction->clone())
@@ -202,7 +202,7 @@ Animation::Animation(const Animation& other)
202202

203203
Animation& Animation::operator=(const Animation& other)
204204
{
205-
m_name = other.m_name.isSafeToSendToAnotherThread() ? other.m_name : other.m_name.isolatedCopy();
205+
m_name = other.m_name.isolatedCopy();
206206
m_keyframes = other.m_keyframes;
207207
m_boxSize = other.m_boxSize;
208208
m_timingFunction = other.m_timingFunction->clone();

0 commit comments

Comments
 (0)