| 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 9231216e192fe35d67e40d007828b0a9be01a19a..7a807f6aa21917383201f0813aef5c58581958d2 100644
|
| --- a/third_party/WebKit/Source/wtf/text/StringStatics.cpp
|
| +++ b/third_party/WebKit/Source/wtf/text/StringStatics.cpp
|
| @@ -79,15 +79,23 @@ void AtomicString::init()
|
| new (NotNull, (void*)&emptyAtom) AtomicString("");
|
| }
|
|
|
| +template<unsigned charactersCount>
|
| +PassRefPtr<StringImpl> addStaticASCIILiteral(const char (&characters)[charactersCount])
|
| +{
|
| + unsigned length = charactersCount - 1;
|
| + unsigned hash = StringHasher::computeHashAndMaskTop8Bits(reinterpret_cast<const LChar*>(characters), length);
|
| + return adoptRef(StringImpl::createStatic(characters, length, hash));
|
| +}
|
| +
|
| void StringStatics::init()
|
| {
|
| ASSERT(isMainThread());
|
|
|
| // FIXME: These should be allocated at compile time.
|
| new (NotNull, (void*)&starAtom) AtomicString("*", AtomicString::ConstructFromLiteral);
|
| - new (NotNull, (void*)&xmlAtom) AtomicString("xml", AtomicString::ConstructFromLiteral);
|
| - new (NotNull, (void*)&xmlnsAtom) AtomicString("xmlns", AtomicString::ConstructFromLiteral);
|
| - new (NotNull, (void*)&xlinkAtom) AtomicString("xlink", AtomicString::ConstructFromLiteral);
|
| + new (NotNull, (void*)&xmlAtom) AtomicString(addStaticASCIILiteral("xml"));
|
| + new (NotNull, (void*)&xmlnsAtom) AtomicString(addStaticASCIILiteral("xmlns"));
|
| + new (NotNull, (void*)&xlinkAtom) AtomicString(addStaticASCIILiteral("xlink"));
|
| new (NotNull, (void*)&xmlnsWithColon) String("xmlns:");
|
| }
|
|
|
|
|