OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef DOMNodeIds_h | 5 #ifndef DOMNodeIds_h |
6 #define DOMNodeIds_h | 6 #define DOMNodeIds_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/dom/Node.h" | 9 #include "core/dom/Node.h" |
10 #include "core/dom/WeakIdentifierMap.h" | 10 #include "core/dom/WeakIdentifierMap.h" |
| 11 #include "wtf/Allocator.h" |
11 | 12 |
12 namespace blink { | 13 namespace blink { |
13 | 14 |
14 #if !ENABLE(OILPAN) | 15 #if !ENABLE(OILPAN) |
15 template<> struct WeakIdentifierMapTraits<Node> { | 16 template<> struct WeakIdentifierMapTraits<Node> { |
16 static void removedFromIdentifierMap(Node*); | 17 static void removedFromIdentifierMap(Node*); |
17 static void addedToIdentifierMap(Node*); | 18 static void addedToIdentifierMap(Node*); |
18 }; | 19 }; |
19 #endif | 20 #endif |
20 | 21 |
21 DECLARE_WEAK_IDENTIFIER_MAP(Node); | 22 DECLARE_WEAK_IDENTIFIER_MAP(Node); |
22 | 23 |
23 class CORE_EXPORT DOMNodeIds { | 24 class CORE_EXPORT DOMNodeIds { |
| 25 STATIC_ONLY(DOMNodeIds); |
24 public: | 26 public: |
25 static int idForNode(Node*); | 27 static int idForNode(Node*); |
26 static Node* nodeForId(int id); | 28 static Node* nodeForId(int id); |
27 }; | 29 }; |
28 | 30 |
29 } // namespace blink | 31 } // namespace blink |
30 | 32 |
31 | 33 |
32 #endif // DOMNodeIds_h | 34 #endif // DOMNodeIds_h |
OLD | NEW |