diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-11-14 10:50:31 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-12-05 17:04:17 +0100 |
commit | c2d1b1b49536ffb0f3be77c21f48295c8be77346 (patch) | |
tree | 4712a6566328bbb56de111d8468f5c12d87ace31 | |
parent | 6b8798db5d44ef54362139caa081ed345e5d24c7 (diff) | |
download | qtwebengine-chromium-c2d1b1b49536ffb0f3be77c21f48295c8be77346.tar.gz |
Fix assert with devtools
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 <juri.valdmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r-- | chromium/third_party/WebKit/Source/core/dom/QualifiedName.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |