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

Side by Side Diff: Source/core/dom/SelectorQuery.cpp

Issue 290333008: Oilpan: add [WillBeGarbageCollected] for Element. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased + remove WebNode FIXME Created 6 years, 7 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
« no previous file with comments | « Source/core/dom/SelectorQuery.h ('k') | Source/core/html/HTMLAllCollection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2013 Apple Inc. All rights reserved.
3 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 3 * Copyright (C) 2014 Samsung Electronics. All rights 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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return false; 134 return false;
135 } 135 }
136 136
137 PassRefPtrWillBeRawPtr<NodeList> SelectorDataList::queryAll(ContainerNode& rootN ode) const 137 PassRefPtrWillBeRawPtr<NodeList> SelectorDataList::queryAll(ContainerNode& rootN ode) const
138 { 138 {
139 Vector<RefPtr<Node> > result; 139 Vector<RefPtr<Node> > result;
140 execute<AllElementsSelectorQueryTrait>(rootNode, result); 140 execute<AllElementsSelectorQueryTrait>(rootNode, result);
141 return StaticNodeList::adopt(result); 141 return StaticNodeList::adopt(result);
142 } 142 }
143 143
144 PassRefPtr<Element> SelectorDataList::queryFirst(ContainerNode& rootNode) const 144 PassRefPtrWillBeRawPtr<Element> SelectorDataList::queryFirst(ContainerNode& root Node) const
145 { 145 {
146 Element* matchedElement = 0; 146 Element* matchedElement = 0;
147 execute<SingleElementSelectorQueryTrait>(rootNode, matchedElement); 147 execute<SingleElementSelectorQueryTrait>(rootNode, matchedElement);
148 return matchedElement; 148 return matchedElement;
149 } 149 }
150 150
151 template <typename SelectorQueryTrait> 151 template <typename SelectorQueryTrait>
152 void SelectorDataList::collectElementsByClassName(ContainerNode& rootNode, const AtomicString& className, typename SelectorQueryTrait::OutputType& output) cons t 152 void SelectorDataList::collectElementsByClassName(ContainerNode& rootNode, const AtomicString& className, typename SelectorQueryTrait::OutputType& output) cons t
153 { 153 {
154 for (Element* element = ElementTraversal::firstWithin(rootNode); element; el ement = ElementTraversal::next(*element, &rootNode)) { 154 for (Element* element = ElementTraversal::firstWithin(rootNode); element; el ement = ElementTraversal::next(*element, &rootNode)) {
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 bool SelectorQuery::matches(Element& element) const 473 bool SelectorQuery::matches(Element& element) const
474 { 474 {
475 return m_selectors.matches(element); 475 return m_selectors.matches(element);
476 } 476 }
477 477
478 PassRefPtrWillBeRawPtr<NodeList> SelectorQuery::queryAll(ContainerNode& rootNode ) const 478 PassRefPtrWillBeRawPtr<NodeList> SelectorQuery::queryAll(ContainerNode& rootNode ) const
479 { 479 {
480 return m_selectors.queryAll(rootNode); 480 return m_selectors.queryAll(rootNode);
481 } 481 }
482 482
483 PassRefPtr<Element> SelectorQuery::queryFirst(ContainerNode& rootNode) const 483 PassRefPtrWillBeRawPtr<Element> SelectorQuery::queryFirst(ContainerNode& rootNod e) const
484 { 484 {
485 return m_selectors.queryFirst(rootNode); 485 return m_selectors.queryFirst(rootNode);
486 } 486 }
487 487
488 SelectorQuery* SelectorQueryCache::add(const AtomicString& selectors, const Docu ment& document, ExceptionState& exceptionState) 488 SelectorQuery* SelectorQueryCache::add(const AtomicString& selectors, const Docu ment& document, ExceptionState& exceptionState)
489 { 489 {
490 HashMap<AtomicString, OwnPtr<SelectorQuery> >::iterator it = m_entries.find( selectors); 490 HashMap<AtomicString, OwnPtr<SelectorQuery> >::iterator it = m_entries.find( selectors);
491 if (it != m_entries.end()) 491 if (it != m_entries.end())
492 return it->value.get(); 492 return it->value.get();
493 493
(...skipping 21 matching lines...) Expand all
515 m_entries.add(selectors, selectorQuery.release()); 515 m_entries.add(selectors, selectorQuery.release());
516 return rawSelectorQuery; 516 return rawSelectorQuery;
517 } 517 }
518 518
519 void SelectorQueryCache::invalidate() 519 void SelectorQueryCache::invalidate()
520 { 520 {
521 m_entries.clear(); 521 m_entries.clear();
522 } 522 }
523 523
524 } 524 }
OLDNEW
« no previous file with comments | « Source/core/dom/SelectorQuery.h ('k') | Source/core/html/HTMLAllCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698