Index: tools/clang/blink_gc_plugin/tests/templated_class_with_local_class_requires_trace.h |
diff --git a/tools/clang/blink_gc_plugin/tests/templated_class_with_local_class_requires_trace.h b/tools/clang/blink_gc_plugin/tests/templated_class_with_local_class_requires_trace.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d2b0225eee1c9ab15d50cda0089e82a7fbd4c54f |
--- /dev/null |
+++ b/tools/clang/blink_gc_plugin/tests/templated_class_with_local_class_requires_trace.h |
@@ -0,0 +1,52 @@ |
+// Copyright 2014 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 TEMPLATED_CLASS_WITH_LOCAL_CLASS_REQUIRES_TRACE_H |
+#define TEMPLATED_CLASS_WITH_LOCAL_CLASS_REQUIRES_TRACE_H |
+ |
+#include "heap/stubs.h" |
+ |
+namespace blink { |
+ |
+class NonHeapObject { }; |
+ |
+class HeapObject : public GarbageCollected<HeapObject> { |
+public: |
+ HeapObject() { } |
+ |
+ void trace(Visitor*) { } |
+}; |
+ |
+template<typename T> |
+class TemplatedObject final |
+ : public GarbageCollectedFinalized<TemplatedObject<T> > { |
+public: |
+ TemplatedObject(T*) |
+ { |
+ } |
+ |
+ void trace(Visitor*); |
+ |
+private: |
+ class Local final : public GarbageCollected<Local> { |
+ public: |
+ void trace(Visitor* visitor) |
+ { |
+ visitor->trace(m_heapObject); |
+ visitor->trace(m_object); |
+ } |
+ private: |
+ Member<HeapObject> m_heapObject; |
+ OwnPtr<HeapObject> m_object; |
+ }; |
+ |
+ Member<Local> m_local; |
+ Member<T> m_memberRef; |
+ OwnPtr<T> m_ownRef; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // TEMPLATED_CLASS_WITH_LOCAL_CLASS_REQUIRES_TRACE_H |
+ |