1 // Copyright 2016 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef FIELDS_ILLEGAL_TRACING_H_ 6 #define FIELDS_ILLEGAL_TRACING_H_ 7 8 #include "heap/stubs.h" 9 10 namespace blink { 11 12 namespace bar { 13 14 // check that (only) std::unique_ptr<> is reported 15 // as an illegal smart pointer type. 16 template<typename T> class unique_ptr { 17 public: ~unique_ptr()18 ~unique_ptr() { } 19 operator T*() const { return 0; } 20 T* operator->() { return 0; } 21 Trace(Visitor * visitor)22 void Trace(Visitor* visitor) 23 { 24 } 25 }; 26 27 } 28 29 class HeapObject; 30 class PartObject; 31 32 class PartObject { 33 DISALLOW_NEW(); 34 public: 35 void Trace(Visitor*); 36 private: 37 RefPtr<HeapObject> m_obj2; 38 bar::unique_ptr<HeapObject> m_obj3; 39 std::unique_ptr<HeapObject> m_obj4; 40 Vector<int>::iterator m_iterator1; 41 HeapVector<Member<HeapObject>>::iterator m_iterator2; 42 HeapHashSet<PartObject>::const_iterator m_iterator3; 43 }; 44 45 class HeapObject : public GarbageCollectedFinalized<HeapObject> { 46 public: 47 void Trace(Visitor*); 48 private: 49 PartObject m_part; 50 RefPtr<HeapObject> m_obj2; 51 bar::unique_ptr<HeapObject> m_obj3; 52 std::unique_ptr<HeapObject> m_obj4; 53 HeapHashMap<int, Member<HeapObject>>::reverse_iterator m_iterator3; 54 HeapDeque<Member<HeapObject>>::const_reverse_iterator m_iterator4; 55 HeapListHashSet<Member<HeapObject>>::const_iterator m_iterator5; 56 HeapLinkedHashSet<Member<HeapObject>>::const_iterator m_iterator6; 57 }; 58 59 } 60 61 #endif 62