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

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

Issue 192933002: Check that classes with non-trivial destructors have finalization support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: tools/clang/blink_gc_plugin/tests/class_requires_finalization_mixin.h
diff --git a/tools/clang/blink_gc_plugin/tests/class_requires_finalization_mixin.h b/tools/clang/blink_gc_plugin/tests/class_requires_finalization_mixin.h
new file mode 100644
index 0000000000000000000000000000000000000000..f321281d3622f3b989c9615560282d2adc5ebfb0
--- /dev/null
+++ b/tools/clang/blink_gc_plugin/tests/class_requires_finalization_mixin.h
@@ -0,0 +1,42 @@
+// 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 CLASS_REQUIRES_FINALIZATION_MIXIN_H_
+#define CLASS_REQUIRES_FINALIZATION_MIXIN_H_
+
+#include "heap/stubs.h"
+
+namespace WebCore {
+
+class OffHeap : public RefCounted<OffHeap> { };
+class OnHeap : public GarbageCollected<OnHeap> { };
+
+class Mixin : public GarbageCollectedMixin {
+public:
+ void trace(Visitor*);
+private:
+ RefPtr<OffHeap> m_offHeap; // Requires finalization
+ Member<OnHeap> m_onHeap;
+};
+
+class NeedsFinalizer : public GarbageCollected<NeedsFinalizer>, public Mixin {
+ USING_GARBAGE_COLLECTED_MIXIN(NeedsFinalizer);
+public:
+ void trace(Visitor*);
+private:
+ Member<OnHeap> m_obj;
+};
+
+class HasFinalizer : public GarbageCollectedFinalized<HasFinalizer>,
+ public Mixin {
+ USING_GARBAGE_COLLECTED_MIXIN(HasFinalizer);
+public:
+ void trace(Visitor*);
+private:
+ Member<OnHeap> m_obj;
+};
+
+}
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698