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

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

Issue 2574773002: Migrate WTF::Vector::append() to ::push_back() [part 4 of N] (Closed)
Patch Set: rebase Created 4 years 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) 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 DCHECK(!output); 52 DCHECK(!output);
53 output = &element; 53 output = &element;
54 } 54 }
55 }; 55 };
56 56
57 struct AllElementsSelectorQueryTrait { 57 struct AllElementsSelectorQueryTrait {
58 typedef HeapVector<Member<Element>> OutputType; 58 typedef HeapVector<Member<Element>> OutputType;
59 static const bool shouldOnlyMatchFirstElement = false; 59 static const bool shouldOnlyMatchFirstElement = false;
60 ALWAYS_INLINE static void appendElement(OutputType& output, 60 ALWAYS_INLINE static void appendElement(OutputType& output,
61 Element& element) { 61 Element& element) {
62 output.append(&element); 62 output.push_back(&element);
63 } 63 }
64 }; 64 };
65 65
66 enum ClassElementListBehavior { AllElements, OnlyRoots }; 66 enum ClassElementListBehavior { AllElements, OnlyRoots };
67 67
68 template <ClassElementListBehavior onlyRoots> 68 template <ClassElementListBehavior onlyRoots>
69 class ClassElementList { 69 class ClassElementList {
70 STACK_ALLOCATED(); 70 STACK_ALLOCATED();
71 71
72 public: 72 public:
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 641
642 return m_entries.add(selectors, SelectorQuery::adopt(std::move(selectorList))) 642 return m_entries.add(selectors, SelectorQuery::adopt(std::move(selectorList)))
643 .storedValue->value.get(); 643 .storedValue->value.get();
644 } 644 }
645 645
646 void SelectorQueryCache::invalidate() { 646 void SelectorQueryCache::invalidate() {
647 m_entries.clear(); 647 m_entries.clear();
648 } 648 }
649 649
650 } // namespace blink 650 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698