| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "StringStatics.h" | 27 #include "StringStatics.h" |
| 28 | 28 |
| 29 #include "AtomicString.h" | 29 #include "AtomicString.h" |
| 30 #include "StringImpl.h" | 30 #include "StringImpl.h" |
| 31 #include "wtf/DynamicAnnotations.h" | 31 #include "wtf/DynamicAnnotations.h" |
| 32 #include "wtf/MainThread.h" | 32 #include "wtf/MainThread.h" |
| 33 #include "wtf/StaticConstructors.h" | 33 #include "wtf/StaticConstructors.h" |
| 34 | 34 |
| 35 namespace WTF { | 35 namespace WTF { |
| 36 | 36 |
| 37 StringImpl* StringImpl::empty() | 37 StringImpl* StringImpl::empty(bool is8Bit) |
| 38 { | 38 { |
| 39 DEFINE_STATIC_LOCAL(StringImpl, emptyString, (ConstructEmptyString)); | 39 DEFINE_STATIC_LOCAL(StringImpl, empty8BitString, (ConstructEmpty8BitString))
; |
| 40 WTF_ANNOTATE_BENIGN_RACE(&emptyString, "Benign race on StringImpl::emptyStri
ng reference counter"); | 40 DEFINE_STATIC_LOCAL(StringImpl, empty16BitString, (ConstructEmpty16BitString
)); |
| 41 return &emptyString; | 41 WTF_ANNOTATE_BENIGN_RACE(&empty8BitString, "Benign race on StringImpl::empty
8BitString reference counter"); |
| 42 WTF_ANNOTATE_BENIGN_RACE(&empty16BitString, "Benign race on StringImpl::empt
y16BitString reference counter"); |
| 43 return is8Bit ? &empty8BitString : &empty16BitString; |
| 42 } | 44 } |
| 43 | 45 |
| 44 WTF_EXPORT DEFINE_GLOBAL(AtomicString, nullAtom) | 46 WTF_EXPORT DEFINE_GLOBAL(AtomicString, nullAtom) |
| 45 WTF_EXPORT DEFINE_GLOBAL(AtomicString, emptyAtom) | 47 WTF_EXPORT DEFINE_GLOBAL(AtomicString, emptyAtom) |
| 46 WTF_EXPORT DEFINE_GLOBAL(AtomicString, starAtom) | 48 WTF_EXPORT DEFINE_GLOBAL(AtomicString, starAtom) |
| 47 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlAtom) | 49 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlAtom) |
| 48 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlnsAtom) | 50 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlnsAtom) |
| 49 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xlinkAtom) | 51 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xlinkAtom) |
| 50 | 52 |
| 51 // This is not an AtomicString because it is unlikely to be used as an | 53 // This is not an AtomicString because it is unlikely to be used as an |
| (...skipping 24 matching lines...) Expand all Loading... |
| 76 | 78 |
| 77 // FIXME: These should be allocated at compile time. | 79 // FIXME: These should be allocated at compile time. |
| 78 new (NotNull, (void*)&starAtom) AtomicString("*", AtomicString::ConstructFro
mLiteral); | 80 new (NotNull, (void*)&starAtom) AtomicString("*", AtomicString::ConstructFro
mLiteral); |
| 79 new (NotNull, (void*)&xmlAtom) AtomicString("xml", AtomicString::ConstructFr
omLiteral); | 81 new (NotNull, (void*)&xmlAtom) AtomicString("xml", AtomicString::ConstructFr
omLiteral); |
| 80 new (NotNull, (void*)&xmlnsAtom) AtomicString("xmlns", AtomicString::Constru
ctFromLiteral); | 82 new (NotNull, (void*)&xmlnsAtom) AtomicString("xmlns", AtomicString::Constru
ctFromLiteral); |
| 81 new (NotNull, (void*)&xlinkAtom) AtomicString("xlink", AtomicString::Constru
ctFromLiteral); | 83 new (NotNull, (void*)&xlinkAtom) AtomicString("xlink", AtomicString::Constru
ctFromLiteral); |
| 82 new (NotNull, (void*)&xmlnsWithColon) String("xmlns:"); | 84 new (NotNull, (void*)&xmlnsWithColon) String("xmlns:"); |
| 83 } | 85 } |
| 84 | 86 |
| 85 } | 87 } |
| OLD | NEW |