| Index: tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
|
| diff --git a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
|
| index 05419da6d67eb71958ecd944bf247bfe3803fee9..735ec0e8858a4d45da5feda4799da14b63d3e889 100644
|
| --- a/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
|
| +++ b/tools/clang/blink_gc_plugin/CheckFieldsVisitor.cpp
|
| @@ -6,13 +6,10 @@
|
|
|
| #include <cassert>
|
|
|
| -#include "BlinkGCPluginOptions.h"
|
| #include "RecordInfo.h"
|
|
|
| -CheckFieldsVisitor::CheckFieldsVisitor()
|
| - : current_(0),
|
| - stack_allocated_host_(false) {
|
| -}
|
| +CheckFieldsVisitor::CheckFieldsVisitor(const BlinkGCPluginOptions& options)
|
| + : options_(options), current_(0), stack_allocated_host_(false) {}
|
|
|
| CheckFieldsVisitor::Errors& CheckFieldsVisitor::invalid_fields() {
|
| return invalid_fields_;
|
| @@ -34,7 +31,7 @@ bool CheckFieldsVisitor::ContainsInvalidFields(RecordInfo* info) {
|
| return !invalid_fields_.empty();
|
| }
|
|
|
| -void CheckFieldsVisitor::AtMember(Member* edge) {
|
| +void CheckFieldsVisitor::AtMember(Member*) {
|
| if (managed_host_)
|
| return;
|
| // A member is allowed to appear in the context of a root.
|
| @@ -47,6 +44,14 @@ void CheckFieldsVisitor::AtMember(Member* edge) {
|
| invalid_fields_.push_back(std::make_pair(current_, kMemberInUnmanaged));
|
| }
|
|
|
| +void CheckFieldsVisitor::AtWeakMember(WeakMember*) {
|
| + // TODO(sof): remove this once crbug.com/724418's change
|
| + // has safely been rolled out.
|
| + if (options_.enable_weak_members_in_unmanaged_classes)
|
| + return;
|
| + AtMember(nullptr);
|
| +}
|
| +
|
| void CheckFieldsVisitor::AtIterator(Iterator* edge) {
|
| if (!managed_host_)
|
| return;
|
|
|