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

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

Issue 2668903003: Replace WTF::emptyString{16Bit}() with a static global (Closed)
Patch Set: Replace WTF::emptyString{16Bit}() with a static global Created 3 years, 11 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: third_party/WebKit/Source/wtf/text/StringStatics.cpp
diff --git a/third_party/WebKit/Source/wtf/text/StringStatics.cpp b/third_party/WebKit/Source/wtf/text/StringStatics.cpp
index ff7910a313a4624272371a1acf069b804af81d85..d89ef98a8d23c70adc56d5c99b8de8ee70c4ac15 100644
--- a/third_party/WebKit/Source/wtf/text/StringStatics.cpp
+++ b/third_party/WebKit/Source/wtf/text/StringStatics.cpp
@@ -46,6 +46,9 @@ WTF_EXPORT DEFINE_GLOBAL(AtomicString, httpsAtom);
// table.
WTF_EXPORT DEFINE_GLOBAL(String, xmlnsWithColon);
+WTF_EXPORT DEFINE_GLOBAL(String, emptyString);
+WTF_EXPORT DEFINE_GLOBAL(String, emptyString16Bit);
+
NEVER_INLINE unsigned StringImpl::hashSlowCase() const {
if (is8Bit())
setHash(StringHasher::computeHashAndMaskTop8Bits(characters8(), m_length));
@@ -74,6 +77,8 @@ void StringStatics::init() {
DCHECK(isMainThread());
StringImpl::initStatics();
+ new (NotNull, (void*)&emptyString) String(StringImpl::empty);
+ new (NotNull, (void*)&emptyString16Bit) String(StringImpl::empty16Bit);
// FIXME: These should be allocated at compile time.
new (NotNull, (void*)&starAtom) AtomicString("*");
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringBuilderTest.cpp ('k') | third_party/WebKit/Source/wtf/text/StringView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698