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

Side by Side Diff: third_party/WebKit/Source/wtf/LinkedHashSet.h

Issue 2722413005: Migrate WTF::LinkedHashSet/ListHashSet::first() to ::front() (Closed)
Patch Set: Created 3 years, 9 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) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> 4 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 228
229 reverse_iterator rbegin() { return makeReverseIterator(lastNode()); } 229 reverse_iterator rbegin() { return makeReverseIterator(lastNode()); }
230 reverse_iterator rend() { return makeReverseIterator(anchor()); } 230 reverse_iterator rend() { return makeReverseIterator(anchor()); }
231 const_reverse_iterator rbegin() const { 231 const_reverse_iterator rbegin() const {
232 return makeConstReverseIterator(lastNode()); 232 return makeConstReverseIterator(lastNode());
233 } 233 }
234 const_reverse_iterator rend() const { 234 const_reverse_iterator rend() const {
235 return makeConstReverseIterator(anchor()); 235 return makeConstReverseIterator(anchor());
236 } 236 }
237 237
238 Value& first(); 238 Value& front();
239 const Value& first() const; 239 const Value& front() const;
240 void removeFirst(); 240 void removeFirst();
241 241
242 Value& last(); 242 Value& last();
243 const Value& last() const; 243 const Value& last() const;
244 void removeLast(); 244 void removeLast();
245 245
246 iterator find(ValuePeekInType); 246 iterator find(ValuePeekInType);
247 const_iterator find(ValuePeekInType) const; 247 const_iterator find(ValuePeekInType) const;
248 bool contains(ValuePeekInType) const; 248 bool contains(ValuePeekInType) const;
249 249
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
693 swapAnchor(m_anchor, other.m_anchor); 693 swapAnchor(m_anchor, other.m_anchor);
694 } 694 }
695 695
696 template <typename T, typename U, typename V, typename Allocator> 696 template <typename T, typename U, typename V, typename Allocator>
697 inline LinkedHashSet<T, U, V, Allocator>::~LinkedHashSet() { 697 inline LinkedHashSet<T, U, V, Allocator>::~LinkedHashSet() {
698 // The destructor of m_anchor will implicitly be called here, which will 698 // The destructor of m_anchor will implicitly be called here, which will
699 // unlink the anchor from the collection. 699 // unlink the anchor from the collection.
700 } 700 }
701 701
702 template <typename T, typename U, typename V, typename W> 702 template <typename T, typename U, typename V, typename W>
703 inline T& LinkedHashSet<T, U, V, W>::first() { 703 inline T& LinkedHashSet<T, U, V, W>::front() {
704 DCHECK(!isEmpty()); 704 DCHECK(!isEmpty());
705 return firstNode()->m_value; 705 return firstNode()->m_value;
706 } 706 }
707 707
708 template <typename T, typename U, typename V, typename W> 708 template <typename T, typename U, typename V, typename W>
709 inline const T& LinkedHashSet<T, U, V, W>::first() const { 709 inline const T& LinkedHashSet<T, U, V, W>::front() const {
710 DCHECK(!isEmpty()); 710 DCHECK(!isEmpty());
711 return firstNode()->m_value; 711 return firstNode()->m_value;
712 } 712 }
713 713
714 template <typename T, typename U, typename V, typename W> 714 template <typename T, typename U, typename V, typename W>
715 inline void LinkedHashSet<T, U, V, W>::removeFirst() { 715 inline void LinkedHashSet<T, U, V, W>::removeFirst() {
716 DCHECK(!isEmpty()); 716 DCHECK(!isEmpty());
717 m_impl.remove(static_cast<Node*>(m_anchor.m_next)); 717 m_impl.remove(static_cast<Node*>(m_anchor.m_next));
718 } 718 }
719 719
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
929 swap(static_cast<Base&>(a), static_cast<Base&>(b)); 929 swap(static_cast<Base&>(a), static_cast<Base&>(b));
930 swap(a.m_value, b.m_value); 930 swap(a.m_value, b.m_value);
931 Allocator::leaveGCForbiddenScope(); 931 Allocator::leaveGCForbiddenScope();
932 } 932 }
933 933
934 } // namespace WTF 934 } // namespace WTF
935 935
936 using WTF::LinkedHashSet; 936 using WTF::LinkedHashSet;
937 937
938 #endif /* WTF_LinkedHashSet_h */ 938 #endif /* WTF_LinkedHashSet_h */
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebPluginContainerImpl.cpp ('k') | third_party/WebKit/Source/wtf/ListHashSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698