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

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

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/ParentNode.h ('k') | Source/core/dom/SelectorQuery.cpp » ('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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class Node; 43 class Node;
44 class NodeList; 44 class NodeList;
45 class SimpleNodeList; 45 class SimpleNodeList;
46 class SpaceSplitString; 46 class SpaceSplitString;
47 47
48 class SelectorDataList { 48 class SelectorDataList {
49 public: 49 public:
50 void initialize(const CSSSelectorList&); 50 void initialize(const CSSSelectorList&);
51 bool matches(Element&) const; 51 bool matches(Element&) const;
52 PassRefPtrWillBeRawPtr<NodeList> queryAll(ContainerNode& rootNode) const; 52 PassRefPtrWillBeRawPtr<NodeList> queryAll(ContainerNode& rootNode) const;
53 PassRefPtr<Element> queryFirst(ContainerNode& rootNode) const; 53 PassRefPtrWillBeRawPtr<Element> queryFirst(ContainerNode& rootNode) const;
54 54
55 private: 55 private:
56 bool canUseFastQuery(const ContainerNode& rootNode) const; 56 bool canUseFastQuery(const ContainerNode& rootNode) const;
57 bool selectorMatches(const CSSSelector&, Element&, const ContainerNode&) con st; 57 bool selectorMatches(const CSSSelector&, Element&, const ContainerNode&) con st;
58 58
59 template <typename SelectorQueryTrait> 59 template <typename SelectorQueryTrait>
60 void collectElementsByClassName(ContainerNode& rootNode, const AtomicString& className, typename SelectorQueryTrait::OutputType&) const; 60 void collectElementsByClassName(ContainerNode& rootNode, const AtomicString& className, typename SelectorQueryTrait::OutputType&) const;
61 template <typename SelectorQueryTrait> 61 template <typename SelectorQueryTrait>
62 void collectElementsByTagName(ContainerNode& rootNode, const QualifiedName& tagName, typename SelectorQueryTrait::OutputType&) const; 62 void collectElementsByTagName(ContainerNode& rootNode, const QualifiedName& tagName, typename SelectorQueryTrait::OutputType&) const;
63 63
(...skipping 20 matching lines...) Expand all
84 bool m_crossesTreeBoundary; 84 bool m_crossesTreeBoundary;
85 }; 85 };
86 86
87 class SelectorQuery { 87 class SelectorQuery {
88 WTF_MAKE_NONCOPYABLE(SelectorQuery); 88 WTF_MAKE_NONCOPYABLE(SelectorQuery);
89 WTF_MAKE_FAST_ALLOCATED; 89 WTF_MAKE_FAST_ALLOCATED;
90 public: 90 public:
91 explicit SelectorQuery(const CSSSelectorList&); 91 explicit SelectorQuery(const CSSSelectorList&);
92 bool matches(Element&) const; 92 bool matches(Element&) const;
93 PassRefPtrWillBeRawPtr<NodeList> queryAll(ContainerNode& rootNode) const; 93 PassRefPtrWillBeRawPtr<NodeList> queryAll(ContainerNode& rootNode) const;
94 PassRefPtr<Element> queryFirst(ContainerNode& rootNode) const; 94 PassRefPtrWillBeRawPtr<Element> queryFirst(ContainerNode& rootNode) const;
95 private: 95 private:
96 SelectorDataList m_selectors; 96 SelectorDataList m_selectors;
97 CSSSelectorList m_selectorList; 97 CSSSelectorList m_selectorList;
98 }; 98 };
99 99
100 class SelectorQueryCache { 100 class SelectorQueryCache {
101 WTF_MAKE_FAST_ALLOCATED; 101 WTF_MAKE_FAST_ALLOCATED;
102 public: 102 public:
103 SelectorQuery* add(const AtomicString&, const Document&, ExceptionState&); 103 SelectorQuery* add(const AtomicString&, const Document&, ExceptionState&);
104 void invalidate(); 104 void invalidate();
105 105
106 private: 106 private:
107 HashMap<AtomicString, OwnPtr<SelectorQuery> > m_entries; 107 HashMap<AtomicString, OwnPtr<SelectorQuery> > m_entries;
108 }; 108 };
109 109
110 } 110 }
111 111
112 #endif 112 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/ParentNode.h ('k') | Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698