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

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

Issue 374593002: Support ignorance of base class finalizers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reworked, static check now expressed by RecordInfo::NeedsFinalization() Created 6 years, 5 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_field.h
diff --git a/tools/clang/blink_gc_plugin/tests/class_requires_finalization_field.h b/tools/clang/blink_gc_plugin/tests/class_requires_finalization_field.h
index 8d8ac3503223fc80fa990d7bad8284188f9b6b15..90a9ed439a7cd72e4c839a190c6a9ad15ad4ca8c 100644
--- a/tools/clang/blink_gc_plugin/tests/class_requires_finalization_field.h
+++ b/tools/clang/blink_gc_plugin/tests/class_requires_finalization_field.h
@@ -14,6 +14,15 @@ public:
virtual void trace(Visitor*) { }
};
+// WebCore::ScriptWrappable receives special treatment
+// so as to allow it to be used together with GarbageCollected<T>,
+// even when its user-declared destructor is provided.
+// As it is with Oilpan disabled.
+class ScriptWrappable {
+public:
+ ~ScriptWrappable() { /* user-declared, thus, non-trivial */ }
+};
+
// Has a non-trivial dtor (user-declared).
class B {
public:
@@ -41,7 +50,7 @@ struct VectorTraits<WebCore::C> {
namespace WebCore {
// Off-heap vectors always need to be finalized.
-class NeedsFinalizer : public A {
+class NeedsFinalizer : public A, public ScriptWrappable {
public:
void trace(Visitor*);
private:
@@ -58,7 +67,7 @@ private:
};
// On-heap vectors with no inlined objects never need to be finalized.
-class DoesNotNeedFinalizer : public A {
+class DoesNotNeedFinalizer : public A, public ScriptWrappable {
public:
void trace(Visitor*);
private:
@@ -67,7 +76,7 @@ private:
// On-heap vectors with inlined objects that don't need destruction
// don't need to be finalized.
-class AlsoDoesNotNeedFinalizer : public A {
+class AlsoDoesNotNeedFinalizer : public A, public ScriptWrappable {
public:
void trace(Visitor*);
private:

Powered by Google App Engine
This is Rietveld 408576698