blob: b8068c315fdf7c40039b60dc875769d709038966 [file]
// Copyright 2025 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_CORE_SCRIPT_TOOLS_MODEL_CONTEXT_SUPPLEMENT_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_SCRIPT_TOOLS_MODEL_CONTEXT_SUPPLEMENT_H_
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/script_tools/model_context.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/supplementable.h"
namespace blink {
class CORE_EXPORT ModelContextSupplement final
: public GarbageCollected<ModelContextSupplement>,
public Supplement<Document> {
public:
static const char kSupplementName[];
static ModelContextSupplement& From(Document&);
static ModelContext* GetIfExists(Document&);
static ModelContext* modelContext(Document&);
explicit ModelContextSupplement(Document&);
ModelContextSupplement(const ModelContextSupplement&) = delete;
ModelContextSupplement& operator=(const ModelContextSupplement&) = delete;
void Trace(Visitor*) const override;
private:
ModelContext* modelContext();
Member<ModelContext> model_context_;
};
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_CORE_SCRIPT_TOOLS_MODEL_CONTEXT_SUPPLEMENT_H_