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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 "string created by StringImpl::empty16Bit"); | 47 "string created by StringImpl::empty16Bit"); |
48 return &emptyString; | 48 return &emptyString; |
49 } | 49 } |
50 | 50 |
51 WTF_EXPORT DEFINE_GLOBAL(AtomicString, nullAtom); | 51 WTF_EXPORT DEFINE_GLOBAL(AtomicString, nullAtom); |
52 WTF_EXPORT DEFINE_GLOBAL(AtomicString, emptyAtom); | 52 WTF_EXPORT DEFINE_GLOBAL(AtomicString, emptyAtom); |
53 WTF_EXPORT DEFINE_GLOBAL(AtomicString, starAtom); | 53 WTF_EXPORT DEFINE_GLOBAL(AtomicString, starAtom); |
54 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlAtom); | 54 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlAtom); |
55 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlnsAtom); | 55 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xmlnsAtom); |
56 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xlinkAtom); | 56 WTF_EXPORT DEFINE_GLOBAL(AtomicString, xlinkAtom); |
57 WTF_EXPORT DEFINE_GLOBAL(AtomicString, httpAtom); | |
58 WTF_EXPORT DEFINE_GLOBAL(AtomicString, httpsAtom); | |
59 | 57 |
60 // This is not an AtomicString because it is unlikely to be used as an | 58 // This is not an AtomicString because it is unlikely to be used as an |
61 // event/element/attribute name, so it shouldn't pollute the AtomicString hash | 59 // event/element/attribute name, so it shouldn't pollute the AtomicString hash |
62 // table. | 60 // table. |
63 WTF_EXPORT DEFINE_GLOBAL(String, xmlnsWithColon); | 61 WTF_EXPORT DEFINE_GLOBAL(String, xmlnsWithColon); |
64 | 62 |
65 NEVER_INLINE unsigned StringImpl::hashSlowCase() const { | 63 NEVER_INLINE unsigned StringImpl::hashSlowCase() const { |
66 if (is8Bit()) | 64 if (is8Bit()) |
67 setHash(StringHasher::computeHashAndMaskTop8Bits(characters8(), m_length)); | 65 setHash(StringHasher::computeHashAndMaskTop8Bits(characters8(), m_length)); |
68 else | 66 else |
(...skipping 19 matching lines...) Expand all Loading... |
88 | 86 |
89 void StringStatics::init() { | 87 void StringStatics::init() { |
90 ASSERT(isMainThread()); | 88 ASSERT(isMainThread()); |
91 | 89 |
92 // FIXME: These should be allocated at compile time. | 90 // FIXME: These should be allocated at compile time. |
93 new (NotNull, (void*)&starAtom) AtomicString("*"); | 91 new (NotNull, (void*)&starAtom) AtomicString("*"); |
94 new (NotNull, (void*)&xmlAtom) AtomicString(addStaticASCIILiteral("xml")); | 92 new (NotNull, (void*)&xmlAtom) AtomicString(addStaticASCIILiteral("xml")); |
95 new (NotNull, (void*)&xmlnsAtom) AtomicString(addStaticASCIILiteral("xmlns")); | 93 new (NotNull, (void*)&xmlnsAtom) AtomicString(addStaticASCIILiteral("xmlns")); |
96 new (NotNull, (void*)&xlinkAtom) AtomicString(addStaticASCIILiteral("xlink")); | 94 new (NotNull, (void*)&xlinkAtom) AtomicString(addStaticASCIILiteral("xlink")); |
97 new (NotNull, (void*)&xmlnsWithColon) String("xmlns:"); | 95 new (NotNull, (void*)&xmlnsWithColon) String("xmlns:"); |
98 new (NotNull, (void*)&httpAtom) AtomicString(addStaticASCIILiteral("http")); | |
99 new (NotNull, (void*)&httpsAtom) AtomicString(addStaticASCIILiteral("https")); | |
100 } | 96 } |
101 | 97 |
102 } // namespace WTF | 98 } // namespace WTF |
OLD | NEW |