Index: third_party/WebKit/Source/wtf/text/StringImpl.cpp |
diff --git a/third_party/WebKit/Source/wtf/text/StringImpl.cpp b/third_party/WebKit/Source/wtf/text/StringImpl.cpp |
index bb0eaeb4b05b34f5917021c8bf8eb9fe616a3bd9..04646b4b68998fd4660b77d52112bd556d77abba 100644 |
--- a/third_party/WebKit/Source/wtf/text/StringImpl.cpp |
+++ b/third_party/WebKit/Source/wtf/text/StringImpl.cpp |
@@ -286,6 +286,19 @@ void StringImpl::destroyIfNotStatic() |
delete this; |
} |
+bool StringImpl::isSafeToSendToAnotherThread() const |
+{ |
+ if (isStatic()) |
+ return true; |
+ // AtomicStrings are not safe to send between threads as ~StringImpl() |
+ // will try to remove them from the wrong AtomicStringTable. |
+ if (isAtomic()) |
+ return false; |
+ if (hasOneRef()) |
+ return true; |
+ return false; |
+} |
+ |
PassRefPtr<StringImpl> StringImpl::createUninitialized(unsigned length, LChar*& data) |
{ |
if (!length) { |