From c2d1b1b49536ffb0f3be77c21f48295c8be77346 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 14 Nov 2017 10:50:31 +0100 Subject: Fix assert with devtools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Qualified names are read from two different threads in debug mode, so the strings they return must be safe to access from the current thread. Change-Id: I071c057e4fd2c215b36a0897058499c678250668 Reviewed-by: Jüri Valdmann Reviewed-by: Alexandru Croitor --- chromium/third_party/WebKit/Source/core/dom/QualifiedName.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chromium/third_party/WebKit/Source/core/dom/QualifiedName.cpp b/chromium/third_party/WebKit/Source/core/dom/QualifiedName.cpp index 8a17372a4ca..32acc2a87a8 100644 --- a/chromium/third_party/WebKit/Source/core/dom/QualifiedName.cpp +++ b/chromium/third_party/WebKit/Source/core/dom/QualifiedName.cpp @@ -106,9 +106,13 @@ QualifiedName::QualifiedNameImpl::~QualifiedNameImpl() { } String QualifiedName::ToString() const { - String local = LocalName(); + const String& local = LocalName().GetString(); if (HasPrefix()) return Prefix().GetString() + ":" + local; +#if !defined(NDEBUG) + if (!local.IsSafeToSendToAnotherThread()) + return local.IsolatedCopy(); +#endif return local; } -- cgit v1.2.1