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

Unified Diff: Source/wtf/text/StringStatics.cpp

Issue 587173005: Add WTF::String::emptyString16Bit (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
Index: Source/wtf/text/StringStatics.cpp
diff --git a/Source/wtf/text/StringStatics.cpp b/Source/wtf/text/StringStatics.cpp
index 099f00115619cdf3403f25e96563bff563f4b6f2..7746f0682cde294f6caf1261ade91335af0c8f78 100644
--- a/Source/wtf/text/StringStatics.cpp
+++ b/Source/wtf/text/StringStatics.cpp
@@ -36,7 +36,14 @@ namespace WTF {
StringImpl* StringImpl::empty()
{
- DEFINE_STATIC_LOCAL(StringImpl, emptyString, (ConstructEmptyString));
+ DEFINE_STATIC_LOCAL(StringImpl, emptyString, (ConstructEmpty8BitString));
+ WTF_ANNOTATE_BENIGN_RACE(&emptyString, "Benign race on StringImpl::emptyString reference counter");
+ return &emptyString;
+}
+
+StringImpl* StringImpl::empty(StringImpl::Force16Bit)
+{
+ DEFINE_STATIC_LOCAL(StringImpl, emptyString, (ConstructEmpty16BitString));
WTF_ANNOTATE_BENIGN_RACE(&emptyString, "Benign race on StringImpl::emptyString reference counter");
return &emptyString;
}

Powered by Google App Engine
This is Rietveld 408576698