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 "modules/canvas2d/HitRegion.h" | 5 #include "modules/canvas2d/HitRegion.h" |
6 | 6 |
7 #include "core/dom/AXObjectCache.h" | 7 #include "core/dom/AXObjectCache.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 if (hitRegion->control()) | 39 if (hitRegion->control()) |
40 m_hitRegionControlMap.set(hitRegion->control(), hitRegion); | 40 m_hitRegionControlMap.set(hitRegion->control(), hitRegion); |
41 } | 41 } |
42 | 42 |
43 void HitRegionManager::removeHitRegion(HitRegion* hitRegion) { | 43 void HitRegionManager::removeHitRegion(HitRegion* hitRegion) { |
44 if (!hitRegion) | 44 if (!hitRegion) |
45 return; | 45 return; |
46 | 46 |
47 if (!hitRegion->id().isEmpty()) | 47 if (!hitRegion->id().isEmpty()) |
48 m_hitRegionIdMap.remove(hitRegion->id()); | 48 m_hitRegionIdMap.erase(hitRegion->id()); |
49 | 49 |
50 if (hitRegion->control()) | 50 if (hitRegion->control()) |
51 m_hitRegionControlMap.remove(hitRegion->control()); | 51 m_hitRegionControlMap.erase(hitRegion->control()); |
52 | 52 |
53 m_hitRegionList.remove(hitRegion); | 53 m_hitRegionList.remove(hitRegion); |
54 } | 54 } |
55 | 55 |
56 void HitRegionManager::removeHitRegionById(const String& id) { | 56 void HitRegionManager::removeHitRegionById(const String& id) { |
57 if (!id.isEmpty()) | 57 if (!id.isEmpty()) |
58 removeHitRegion(getHitRegionById(id)); | 58 removeHitRegion(getHitRegionById(id)); |
59 } | 59 } |
60 | 60 |
61 void HitRegionManager::removeHitRegionByControl(const Element* control) { | 61 void HitRegionManager::removeHitRegionByControl(const Element* control) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 return m_hitRegionList.size(); | 118 return m_hitRegionList.size(); |
119 } | 119 } |
120 | 120 |
121 DEFINE_TRACE(HitRegionManager) { | 121 DEFINE_TRACE(HitRegionManager) { |
122 visitor->trace(m_hitRegionList); | 122 visitor->trace(m_hitRegionList); |
123 visitor->trace(m_hitRegionIdMap); | 123 visitor->trace(m_hitRegionIdMap); |
124 visitor->trace(m_hitRegionControlMap); | 124 visitor->trace(m_hitRegionControlMap); |
125 } | 125 } |
126 | 126 |
127 } // namespace blink | 127 } // namespace blink |
OLD | NEW |