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

Unified Diff: tools/clang/blink_gc_plugin/tests/templated_class_with_local_class_requires_trace.h

Issue 827693004: Blink GC plugin: improve handling of type dependent bases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
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
+

Powered by Google App Engine
This is Rietveld 408576698