• Jeremy Roman's avatar
    Augment the blink gc plugin to detect missing USING_GARBAGE_COLLECTED_MIXIN. · 30bc14da
    Jeremy Roman authored
    It's a common and difficult to debug pitfall when you derive a GC mixin
    but fail to use this macro. It leads to confusing crashes during tracing.
    
    With this CL, the compiler will emit a warning like this:
    
      In file included from ../../third_party/blink/renderer/core/html/portal/document_portals.cc:5:
      ../../third_party/blink/renderer/core/html/portal/document_portals.h:17:25: error: [blink-gc] Garbage-collected class 'DocumentPortals' derives mixin class 'Supplement<blink::Document>'. You must add USING_GARBAGE_COLLECTED_MIXIN(DocumentPortals).
                              public Supplement<Document> {
                              ~~~~~~~^~~~~~~~~~~~~~~~~~~~
      ../../third_party/blink/renderer/platform/supplementable.h:119:27: note: [blink-gc] Mixin base class derived here:
      class Supplement : public GarbageCollectedMixin {
                         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~
      1 error generated.
    
    Bug: 869498
    Change-Id: I93454c418d53ebe0fcd411e0a829597dd9aaf925
    Reviewed-on: https://chromium-review.googlesource.com/c/1340784
    Commit-Queue: Jeremy Roman <jbroman@chromium.org>
    Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#609280}
    30bc14da
DiagnosticsReporter.h 7.2 KB