// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef FIELDS_ILLEGAL_TRACING_H_ #define FIELDS_ILLEGAL_TRACING_H_ #include "heap/stubs.h" namespace blink { namespace bar { // check that (only) std::unique_ptr<> is reported // as an illegal smart pointer type. template class unique_ptr { public: ~unique_ptr() { } operator T*() const { return 0; } T* operator->() { return 0; } void Trace(Visitor* visitor) { } }; } class HeapObject; class PartObject; class PartObject { DISALLOW_NEW(); public: void Trace(Visitor*); private: RefPtr m_obj2; bar::unique_ptr m_obj3; std::unique_ptr m_obj4; Vector::iterator m_iterator1; HeapVector>::iterator m_iterator2; HeapHashSet::const_iterator m_iterator3; }; class HeapObject : public GarbageCollected { public: void Trace(Visitor*); private: PartObject m_part; RefPtr m_obj2; bar::unique_ptr m_obj3; std::unique_ptr m_obj4; HeapHashMap>::reverse_iterator m_iterator3; HeapDeque>::const_reverse_iterator m_iterator4; HeapListHashSet>::const_iterator m_iterator5; HeapLinkedHashSet>::const_iterator m_iterator6; }; } #endif