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

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

Issue 2655853003: Replace StringImpl::empty{16Bit}() with a static member (Closed)
Patch Set: annotate race 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
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringMac.mm ('k') | third_party/WebKit/Source/wtf/text/StringView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2bb0dbe5fc6bf8bc5138847c38e106e5ec92d968..ff7910a313a4624272371a1acf069b804af81d85 100644
--- a/third_party/WebKit/Source/wtf/text/StringStatics.cpp
+++ b/third_party/WebKit/Source/wtf/text/StringStatics.cpp
@@ -32,22 +32,6 @@
namespace WTF {
-StringImpl* StringImpl::empty() {
- DEFINE_STATIC_LOCAL(StringImpl, emptyString, (ConstructEmptyString));
- WTF_ANNOTATE_BENIGN_RACE(&emptyString,
- "Benign race on the reference counter of a static "
- "string created by StringImpl::empty");
- return &emptyString;
-}
-
-StringImpl* StringImpl::empty16Bit() {
- DEFINE_STATIC_LOCAL(StringImpl, emptyString, (ConstructEmptyString16Bit));
- WTF_ANNOTATE_BENIGN_RACE(&emptyString,
- "Benign race on the reference counter of a static "
- "string created by StringImpl::empty16Bit");
- return &emptyString;
-}
-
WTF_EXPORT DEFINE_GLOBAL(AtomicString, nullAtom);
WTF_EXPORT DEFINE_GLOBAL(AtomicString, emptyAtom);
WTF_EXPORT DEFINE_GLOBAL(AtomicString, starAtom);
@@ -89,6 +73,8 @@ PassRefPtr<StringImpl> addStaticASCIILiteral(
void StringStatics::init() {
DCHECK(isMainThread());
+ StringImpl::initStatics();
+
// FIXME: These should be allocated at compile time.
new (NotNull, (void*)&starAtom) AtomicString("*");
new (NotNull, (void*)&xmlAtom) AtomicString(addStaticASCIILiteral("xml"));
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringMac.mm ('k') | third_party/WebKit/Source/wtf/text/StringView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698