Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(741)

Side by Side Diff: third_party/WebKit/Source/core/dom/DocumentOrderedMap.cpp

Issue 2694283003: Annotate ScriptWrappable-embedding singletons.
Patch Set: add XPathValue singleton Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 Element* DocumentOrderedMap::getElementById(const AtomicString& key, 150 Element* DocumentOrderedMap::getElementById(const AtomicString& key,
151 const TreeScope* scope) const { 151 const TreeScope* scope) const {
152 return get<keyMatchesId>(key, scope); 152 return get<keyMatchesId>(key, scope);
153 } 153 }
154 154
155 const HeapVector<Member<Element>>& DocumentOrderedMap::getAllElementsById( 155 const HeapVector<Member<Element>>& DocumentOrderedMap::getAllElementsById(
156 const AtomicString& key, 156 const AtomicString& key,
157 const TreeScope* scope) const { 157 const TreeScope* scope) const {
158 DCHECK(key); 158 DCHECK(key);
159 DCHECK(scope); 159 DCHECK(scope);
160 ALLOW_UNSAFE_SINGLETON()
160 DEFINE_STATIC_LOCAL(HeapVector<Member<Element>>, emptyVector, 161 DEFINE_STATIC_LOCAL(HeapVector<Member<Element>>, emptyVector,
161 (new HeapVector<Member<Element>>)); 162 (new HeapVector<Member<Element>>));
162 163
163 Map::iterator it = m_map.find(key); 164 Map::iterator it = m_map.find(key);
164 if (it == m_map.end()) 165 if (it == m_map.end())
165 return emptyVector; 166 return emptyVector;
166 167
167 Member<MapEntry>& entry = it->value; 168 Member<MapEntry>& entry = it->value;
168 DCHECK(entry->count); 169 DCHECK(entry->count);
169 170
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 DEFINE_TRACE(DocumentOrderedMap) { 206 DEFINE_TRACE(DocumentOrderedMap) {
206 visitor->trace(m_map); 207 visitor->trace(m_map);
207 } 208 }
208 209
209 DEFINE_TRACE(DocumentOrderedMap::MapEntry) { 210 DEFINE_TRACE(DocumentOrderedMap::MapEntry) {
210 visitor->trace(element); 211 visitor->trace(element);
211 visitor->trace(orderedList); 212 visitor->trace(orderedList);
212 } 213 }
213 214
214 } // namespace blink 215 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698