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

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

Issue 2553673002: Disallow off-heap containers containing raw on-heap pointers. (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/wtf/HashSet.h ('k') | third_party/WebKit/Source/wtf/ListHashSet.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) 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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 Superclass::operator++(); 591 Superclass::operator++();
592 return *this; 592 return *this;
593 } 593 }
594 594
595 // Postfix ++ and -- intentionally omitted. 595 // Postfix ++ and -- intentionally omitted.
596 596
597 template <typename T, typename U, typename V, typename W> 597 template <typename T, typename U, typename V, typename W>
598 friend class LinkedHashSet; 598 friend class LinkedHashSet;
599 }; 599 };
600 600
601 template <typename T, typename U, typename V, typename W> 601 template <typename T, typename U, typename V, typename Allocator>
602 inline LinkedHashSet<T, U, V, W>::LinkedHashSet() {} 602 inline LinkedHashSet<T, U, V, Allocator>::LinkedHashSet() {
603 static_assert(
604 Allocator::isGarbageCollected ||
605 !IsPointerToGarbageCollectedType<T>::value,
606 "Cannot put raw pointers to garbage-collected classes into "
607 "an off-heap LinkedHashSet. Use HeapLinkedHashSet<Member<T>> instead.");
608 }
603 609
604 template <typename T, typename U, typename V, typename W> 610 template <typename T, typename U, typename V, typename W>
605 inline LinkedHashSet<T, U, V, W>::LinkedHashSet(const LinkedHashSet& other) 611 inline LinkedHashSet<T, U, V, W>::LinkedHashSet(const LinkedHashSet& other)
606 : m_anchor() { 612 : m_anchor() {
607 const_iterator end = other.end(); 613 const_iterator end = other.end();
608 for (const_iterator it = other.begin(); it != end; ++it) 614 for (const_iterator it = other.begin(); it != end; ++it)
609 add(*it); 615 add(*it);
610 } 616 }
611 617
612 template <typename T, typename U, typename V, typename W> 618 template <typename T, typename U, typename V, typename W>
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 swap(static_cast<Base&>(a), static_cast<Base&>(b)); 874 swap(static_cast<Base&>(a), static_cast<Base&>(b));
869 swap(a.m_value, b.m_value); 875 swap(a.m_value, b.m_value);
870 Allocator::leaveGCForbiddenScope(); 876 Allocator::leaveGCForbiddenScope();
871 } 877 }
872 878
873 } // namespace WTF 879 } // namespace WTF
874 880
875 using WTF::LinkedHashSet; 881 using WTF::LinkedHashSet;
876 882
877 #endif /* WTF_LinkedHashSet_h */ 883 #endif /* WTF_LinkedHashSet_h */
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/HashSet.h ('k') | third_party/WebKit/Source/wtf/ListHashSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698