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

Side by Side 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 5 years, 11 months 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
OLDNEW
(Empty)
1 // Copyright 2014 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 TEMPLATED_CLASS_WITH_LOCAL_CLASS_REQUIRES_TRACE_H
6 #define TEMPLATED_CLASS_WITH_LOCAL_CLASS_REQUIRES_TRACE_H
7
8 #include "heap/stubs.h"
9
10 namespace blink {
11
12 class NonHeapObject { };
13
14 class HeapObject : public GarbageCollected<HeapObject> {
15 public:
16 HeapObject() { }
17
18 void trace(Visitor*) { }
19 };
20
21 template<typename T>
22 class TemplatedObject final
23 : public GarbageCollectedFinalized<TemplatedObject<T> > {
24 public:
25 TemplatedObject(T*)
26 {
27 }
28
29 void trace(Visitor*);
30
31 private:
32 class Local final : public GarbageCollected<Local> {
33 public:
34 void trace(Visitor* visitor)
35 {
36 visitor->trace(m_heapObject);
37 visitor->trace(m_object);
38 }
39 private:
40 Member<HeapObject> m_heapObject;
41 OwnPtr<HeapObject> m_object;
42 };
43
44 Member<Local> m_local;
45 Member<T> m_memberRef;
46 OwnPtr<T> m_ownRef;
47 };
48
49 } // namespace blink
50
51 #endif // TEMPLATED_CLASS_WITH_LOCAL_CLASS_REQUIRES_TRACE_H
52
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698