• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef TOOLS_BLINK_GC_PLUGIN_BLINK_GC_PLUGIN_OPTIONS_H_
6 #define TOOLS_BLINK_GC_PLUGIN_BLINK_GC_PLUGIN_OPTIONS_H_
7 
8 #include <set>
9 #include <string>
10 #include <vector>
11 
12 struct BlinkGCPluginOptions {
13   bool dump_graph = false;
14 
15   // If |true|, emit warning for class types which derive from from
16   // GarbageCollectedFinalized<> when just GarbageCollected<> will do.
17   bool warn_unneeded_finalizer = false;
18 
19   // Member<T> fields are only permitted in managed classes,
20   // something CheckFieldsVisitor verifies, issuing errors if
21   // found in unmanaged classes. WeakMember<T> should be treated
22   // the exact same, but CheckFieldsVisitor was missing the case
23   // for handling the weak member variant until crbug.com/724418.
24   //
25   // We've default-enabled the checking for those also now, but do
26   // offer an opt-out option should enabling the check lead to
27   // unexpected (but wanted, really) compilation errors while
28   // rolling out an updated GC plugin version.
29   //
30   // TODO(sof): remove this option once safely rolled out.
31   bool enable_weak_members_in_unmanaged_classes = false;
32 
33   std::set<std::string> ignored_classes;
34   std::set<std::string> checked_namespaces;
35   std::vector<std::string> ignored_directories;
36 };
37 
38 #endif  // TOOLS_BLINK_GC_PLUGIN_BLINK_GC_PLUGIN_OPTIONS_H_
39