Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Unified Diff: third_party/WebKit/Source/wtf/text/WTFString.cpp

Issue 2335573003: Move String::isSafeToSendToAnotherThread to StringImpl. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImpl.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/WTFString.cpp
diff --git a/third_party/WebKit/Source/wtf/text/WTFString.cpp b/third_party/WebKit/Source/wtf/text/WTFString.cpp
index 1686121ee24e005b6c8e6d665fa2ffea99ed07e2..c8aaeb4a1d65191bc33157b6ec17beb6e1af0dd4 100644
--- a/third_party/WebKit/Source/wtf/text/WTFString.cpp
+++ b/third_party/WebKit/Source/wtf/text/WTFString.cpp
@@ -571,17 +571,7 @@ String String::isolatedCopy() const
bool String::isSafeToSendToAnotherThread() const
{
- if (!impl())
- return true;
- if (impl()->isStatic())
- return true;
- // AtomicStrings are not safe to send between threads as ~StringImpl()
- // will try to remove them from the wrong AtomicStringTable.
- if (impl()->isAtomic())
- return false;
- if (impl()->hasOneRef())
- return true;
- return false;
+ return !m_impl || m_impl->isSafeToSendToAnotherThread();
}
void String::split(const String& separator, bool allowEmptyEntries, Vector<String>& result) const
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698