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

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

Issue 1158623002: Extend destructor checks to account for eagerly finalized class types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updated to look for IsEagerlyFinalizedMarker instead Created 5 years, 7 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/destructor_eagerly_finalized.h
diff --git a/tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.h b/tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.h
new file mode 100644
index 0000000000000000000000000000000000000000..77a29dea097bdeeac02b11ec22f1d81147ee130b
--- /dev/null
+++ b/tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.h
@@ -0,0 +1,47 @@
+// Copyright 2015 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 DESTRUCTOR_EAGERLY_FINALIZED_H_
+#define DESTRUCTOR_EAGERLY_FINALIZED_H_
+
+#include "heap/stubs.h"
+
+namespace blink {
+
+class HeapObject : public GarbageCollected<HeapObject> {
+public:
+ void trace(Visitor*) { }
+ void foo() { }
+};
+
+class HeapObjectEagerFinalized
+ : public GarbageCollectedFinalized<HeapObjectEagerFinalized> {
+public:
+ EAGERLY_FINALIZED();
+ ~HeapObjectEagerFinalized();
+ void trace(Visitor*);
+
+ void foo() { }
+
+private:
+ Member<HeapObject> m_obj;
+};
+
+// Accessing other eagerly finalized objects during finalization is not allowed.
+class HeapObjectEagerFinalizedAlso
+ : public GarbageCollectedFinalized<HeapObjectEagerFinalizedAlso> {
+public:
+ EAGERLY_FINALIZED();
+ ~HeapObjectEagerFinalizedAlso();
+ void trace(Visitor*);
+
+private:
+ Member<HeapObject> m_heapObject;
+ Member<HeapObjectEagerFinalized> m_heapObjectFinalized;
+ HeapVector<Member<HeapObjectEagerFinalized>> m_heapVector;
+};
+
+} // namespace blink
+
+#endif // DESTRUCTOR_EAGERLY_FINALIZED_H_
« no previous file with comments | « tools/clang/blink_gc_plugin/RecordInfo.cpp ('k') | tools/clang/blink_gc_plugin/tests/destructor_eagerly_finalized.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698