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

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

Issue 280123002: Oilpan: move LiveNodeList collections to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Have NodeRareData clear out NodeListsNodeData instead. 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/dom/StaticNodeList.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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 { 127 {
128 unsigned selectorCount = m_selectors.size(); 128 unsigned selectorCount = m_selectors.size();
129 for (unsigned i = 0; i < selectorCount; ++i) { 129 for (unsigned i = 0; i < selectorCount; ++i) {
130 if (selectorMatches(*m_selectors[i], targetElement, targetElement)) 130 if (selectorMatches(*m_selectors[i], targetElement, targetElement))
131 return true; 131 return true;
132 } 132 }
133 133
134 return false; 134 return false;
135 } 135 }
136 136
137 PassRefPtr<NodeList> SelectorDataList::queryAll(ContainerNode& rootNode) 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 PassRefPtr<Element> SelectorDataList::queryFirst(ContainerNode& rootNode) const
145 { 145 {
146 Element* matchedElement = 0; 146 Element* matchedElement = 0;
147 execute<SingleElementSelectorQueryTrait>(rootNode, matchedElement); 147 execute<SingleElementSelectorQueryTrait>(rootNode, matchedElement);
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 : m_selectorList(selectorList) 468 : m_selectorList(selectorList)
469 { 469 {
470 m_selectors.initialize(m_selectorList); 470 m_selectors.initialize(m_selectorList);
471 } 471 }
472 472
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 PassRefPtr<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 PassRefPtr<Element> SelectorQuery::queryFirst(ContainerNode& rootNode) 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)
(...skipping 26 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/dom/StaticNodeList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698