OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ScriptValueTraits_h |
| 6 #define ScriptValueTraits_h |
| 7 |
| 8 #include "bindings/core/v8/ScriptValue.h" |
| 9 #include "wtf/HashTraits.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 struct ScriptValueHash { |
| 14 static unsigned hash(const ScriptValue& value) { return value.identityHash()
; } |
| 15 static bool equal(const ScriptValue& a, const ScriptValue& b) { return a ==
b; } |
| 16 static const bool safeToCompareToEmptyOrDeleted = true; |
| 17 }; |
| 18 |
| 19 struct ScriptValueHashTraits : WTF::SimpleClassHashTraits<ScriptValue> { |
| 20 static const bool hasIsEmptyValueFunction = true; |
| 21 static bool isEmptyValue(const ScriptValue& value) { return value.isEmpty()
&& !value.isHashTableDeletedValue(); } |
| 22 }; |
| 23 |
| 24 } // namespace blink |
| 25 |
| 26 #endif // !defined(ScriptValueTraits_h) |
OLD | NEW |