OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 DCHECK(element); | 95 DCHECK(element); |
96 | 96 |
97 Map::iterator it = m_map.find(key); | 97 Map::iterator it = m_map.find(key); |
98 if (it == m_map.end()) | 98 if (it == m_map.end()) |
99 return; | 99 return; |
100 | 100 |
101 Member<MapEntry>& entry = it->value; | 101 Member<MapEntry>& entry = it->value; |
102 DCHECK(entry->count); | 102 DCHECK(entry->count); |
103 if (entry->count == 1) { | 103 if (entry->count == 1) { |
104 DCHECK(!entry->element || entry->element == element); | 104 DCHECK(!entry->element || entry->element == element); |
105 m_map.remove(it); | 105 m_map.erase(it); |
106 } else { | 106 } else { |
107 if (entry->element == element) { | 107 if (entry->element == element) { |
108 DCHECK(entry->orderedList.isEmpty() || | 108 DCHECK(entry->orderedList.isEmpty() || |
109 entry->orderedList.front() == element); | 109 entry->orderedList.front() == element); |
110 entry->element = | 110 entry->element = |
111 entry->orderedList.size() > 1 ? entry->orderedList[1] : nullptr; | 111 entry->orderedList.size() > 1 ? entry->orderedList[1] : nullptr; |
112 } | 112 } |
113 entry->count--; | 113 entry->count--; |
114 entry->orderedList.clear(); | 114 entry->orderedList.clear(); |
115 } | 115 } |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 DEFINE_TRACE(DocumentOrderedMap) { | 205 DEFINE_TRACE(DocumentOrderedMap) { |
206 visitor->trace(m_map); | 206 visitor->trace(m_map); |
207 } | 207 } |
208 | 208 |
209 DEFINE_TRACE(DocumentOrderedMap::MapEntry) { | 209 DEFINE_TRACE(DocumentOrderedMap::MapEntry) { |
210 visitor->trace(element); | 210 visitor->trace(element); |
211 visitor->trace(orderedList); | 211 visitor->trace(orderedList); |
212 } | 212 } |
213 | 213 |
214 } // namespace blink | 214 } // namespace blink |
OLD | NEW |