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

Unified Diff: tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h

Issue 2902563002: blink_gc_plugin: disallow WeakMember<> fields in off-heap objects. (Closed)
Patch Set: add missing file from ps#3 Created 3 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/BlinkGCPluginOptions.h
diff --git a/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h b/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h
index 7aee25f436ed7adc654388df321ef5e09c2ae6d9..4af8950f11f4486a09a6e70d61dc2911f6d4cd44 100644
--- a/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h
+++ b/tools/clang/blink_gc_plugin/BlinkGCPluginOptions.h
@@ -16,6 +16,20 @@ struct BlinkGCPluginOptions {
// GarbageCollectedFinalized<> when just GarbageCollected<> will do.
bool warn_unneeded_finalizer = false;
+ // Member<T> fields are only permitted in managed classes,
+ // something CheckFieldsVisitor verifies, issuing errors if
+ // found in unmanaged classes. WeakMember<T> should be treated
+ // the exact same, but CheckFieldsVisitor was missing the case
+ // for handling the weak member variant until crbug.com/724418.
+ //
+ // We've default-enabled the checking for those also now, but do
+ // offer an opt-out option should enabling the check lead to
+ // unexpected (but wanted, really) compilation errors while
+ // rolling out an updated GC plugin version.
+ //
+ // TODO(sof): remove this option once safely rolled out.
+ bool enable_weak_members_in_unmanaged_classes = false;
+
std::set<std::string> ignored_classes;
std::set<std::string> checked_namespaces;
std::vector<std::string> ignored_directories;
« no previous file with comments | « tools/clang/blink_gc_plugin/BlinkGCPluginConsumer.cpp ('k') | tools/clang/blink_gc_plugin/CheckFieldsVisitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698