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 #include "config.h" | 5 #include "config.h" |
6 #include "core/inspector/InspectorNodeIds.h" | 6 #include "core/inspector/InspectorNodeIds.h" |
7 | 7 |
8 #if ENABLE(OILPAN) | 8 #if ENABLE(OILPAN) |
9 #include "core/dom/Node.h" | 9 #include "core/dom/Node.h" |
10 #else | 10 #else |
11 #include "core/dom/WeakNodeMap.h" | 11 #include "core/dom/WeakNodeMap.h" |
12 #endif | 12 #endif |
13 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 #if ENABLE(OILPAN) | 17 #if ENABLE(OILPAN) |
18 typedef HeapHashMap<WeakMember<Node>, int> NodeToIdMap; | 18 typedef HeapHashMap<WeakMember<Node>, int> NodeToIdMap; |
19 typedef HeapHashMap<int, WeakMember<Node> > IdToNodeMap; | 19 typedef HeapHashMap<int, WeakMember<Node>> IdToNodeMap; |
20 | 20 |
21 static NodeToIdMap& nodeToIdMap() | 21 static NodeToIdMap& nodeToIdMap() |
22 { | 22 { |
23 DEFINE_STATIC_LOCAL(Persistent<NodeToIdMap>, nodeToIdMap, (new NodeToIdMap()
)); | 23 DEFINE_STATIC_LOCAL(Persistent<NodeToIdMap>, nodeToIdMap, (new NodeToIdMap()
)); |
24 return *nodeToIdMap; | 24 return *nodeToIdMap; |
25 } | 25 } |
26 | 26 |
27 static IdToNodeMap& idToNodeMap() | 27 static IdToNodeMap& idToNodeMap() |
28 { | 28 { |
29 DEFINE_STATIC_LOCAL(Persistent<IdToNodeMap>, idToNodeMap, (new IdToNodeMap()
)); | 29 DEFINE_STATIC_LOCAL(Persistent<IdToNodeMap>, idToNodeMap, (new IdToNodeMap()
)); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 return result; | 66 return result; |
67 } | 67 } |
68 | 68 |
69 Node* InspectorNodeIds::nodeForId(int id) | 69 Node* InspectorNodeIds::nodeForId(int id) |
70 { | 70 { |
71 return nodeIds().node(id); | 71 return nodeIds().node(id); |
72 } | 72 } |
73 #endif | 73 #endif |
74 | 74 |
75 } | 75 } |
OLD | NEW |