| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv
ed. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 { | 142 { |
| 143 static RefPtr<P>& null = *(new RefPtr<P>); | 143 static RefPtr<P>& null = *(new RefPtr<P>); |
| 144 return null; | 144 return null; |
| 145 } | 145 } |
| 146 | 146 |
| 147 typedef PassRefPtr<P> PassInType; | 147 typedef PassRefPtr<P> PassInType; |
| 148 static void store(PassRefPtr<P> value, RefPtr<P>& storage) { storage = v
alue; } | 148 static void store(PassRefPtr<P> value, RefPtr<P>& storage) { storage = v
alue; } |
| 149 | 149 |
| 150 typedef PassRefPtr<P> PassOutType; | 150 typedef PassRefPtr<P> PassOutType; |
| 151 static PassRefPtr<P> passOut(RefPtr<P>& value) { return value.release();
} | 151 static PassRefPtr<P> passOut(RefPtr<P>& value) { return value.release();
} |
| 152 // FIXME: We should consider changing PeekType to a raw pointer for bett
er performance, | 152 |
| 153 // but then callers won't need to call get; doing so will require updati
ng many call sites. | 153 typedef P* PeekType; |
| 154 static PeekType peek(const RefPtr<P>& value) { return value.get(); } |
| 154 }; | 155 }; |
| 155 | 156 |
| 156 template<> struct HashTraits<String> : SimpleClassHashTraits<String> { | 157 template<> struct HashTraits<String> : SimpleClassHashTraits<String> { |
| 157 static const bool hasIsEmptyValueFunction = true; | 158 static const bool hasIsEmptyValueFunction = true; |
| 158 static bool isEmptyValue(const String&); | 159 static bool isEmptyValue(const String&); |
| 159 }; | 160 }; |
| 160 | 161 |
| 161 // This struct template is an implementation detail of the isHashTraitsEmpty
Value function, | 162 // This struct template is an implementation detail of the isHashTraitsEmpty
Value function, |
| 162 // which selects either the emptyValue function or the isEmptyValue function
to check for empty values. | 163 // which selects either the emptyValue function or the isEmptyValue function
to check for empty values. |
| 163 template<typename Traits, bool hasEmptyValueFunction> struct HashTraitsEmpty
ValueChecker; | 164 template<typename Traits, bool hasEmptyValueFunction> struct HashTraitsEmpty
ValueChecker; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 }; | 247 }; |
| 247 | 248 |
| 248 } // namespace WTF | 249 } // namespace WTF |
| 249 | 250 |
| 250 using WTF::HashTraits; | 251 using WTF::HashTraits; |
| 251 using WTF::PairHashTraits; | 252 using WTF::PairHashTraits; |
| 252 using WTF::NullableHashTraits; | 253 using WTF::NullableHashTraits; |
| 253 using WTF::SimpleClassHashTraits; | 254 using WTF::SimpleClassHashTraits; |
| 254 | 255 |
| 255 #endif // WTF_HashTraits_h | 256 #endif // WTF_HashTraits_h |
| OLD | NEW |