chromium/third_party/blink/renderer/platform/bindings/active_script_wrappable_manager.h

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_ACTIVE_SCRIPT_WRAPPABLE_MANAGER_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_ACTIVE_SCRIPT_WRAPPABLE_MANAGER_H_

#include <cstddef>
#include <utility>

#include "third_party/blink/renderer/platform/bindings/active_script_wrappable_base.h"
#include "third_party/blink/renderer/platform/bindings/name_client.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/member.h"
#include "third_party/blink/renderer/platform/platform_export.h"

namespace blink {

// ActiveScriptWrappableManager (ASWM) is integrated into the garbage collector
// and keeps ActiveScriptWrappable alive as long as they have
// HasPendingActivity() returning true and are attached to a live
// ExecutionContext.
//
// ASWM integrates with the GC through prologue and weakness callbacks which are
// not allowed to allocate.
class PLATFORM_EXPORT ActiveScriptWrappableManager final
    : public GarbageCollected<ActiveScriptWrappableManager>,
      public NameClient {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_ACTIVE_SCRIPT_WRAPPABLE_MANAGER_H_