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

Unified Diff: Source/wtf/text/StringImpl.h

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
« no previous file with comments | « no previous file | Source/wtf/text/StringStatics.cpp » ('j') | Source/wtf/text/WTFString.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/StringImpl.h
diff --git a/Source/wtf/text/StringImpl.h b/Source/wtf/text/StringImpl.h
index 2c35a29413685f9f03114ef3759f841a3612a8e5..3df9d64ae4ebf8ebe29dc5110ea1ae349f2a2bdf 100644
--- a/Source/wtf/text/StringImpl.h
+++ b/Source/wtf/text/StringImpl.h
@@ -125,13 +125,13 @@ private:
// Used to construct static strings, which have an special refCount that can never hit zero.
// This means that the static string will never be destroyed, which is important because
// static strings will be shared across threads & ref-counted in a non-threadsafe manner.
- enum ConstructEmptyStringTag { ConstructEmptyString };
- explicit StringImpl(ConstructEmptyStringTag)
+ enum ConstructEmptyStringTag { ConstructEmpty8BitString, ConstructEmpty16BitString };
+ explicit StringImpl(ConstructEmptyStringTag tag)
: m_refCount(1)
, m_length(0)
, m_hash(0)
, m_isAtomic(false)
- , m_is8Bit(true)
+ , m_is8Bit(tag == ConstructEmpty8BitString)
Mikhail 2014/09/23 09:48:10 think this is not enough, see below there is: STRI
, m_isStatic(true)
{
// Ensure that the hash is computed so that AtomicStringHash can call existingHash()
@@ -290,7 +290,9 @@ public:
--m_refCount;
}
+ enum Force16Bit { Force16BitEmpty };
static StringImpl* empty();
+ static StringImpl* empty(Force16Bit);
// FIXME: Does this really belong in StringImpl?
template <typename T> static void copyChars(T* destination, const T* source, unsigned numCharacters)
« no previous file with comments | « no previous file | Source/wtf/text/StringStatics.cpp » ('j') | Source/wtf/text/WTFString.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698