chromium/chrome/browser/ai/ai_context_bound_object_set.cc

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

#include "chrome/browser/ai/ai_context_bound_object_set.h"

#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/supports_user_data.h"
#include "base/types/pass_key.h"
#include "content/public/browser/document_user_data.h"
#include "content/public/browser/render_frame_host.h"

namespace {

const char kAIContextBoundObjectSetUserDataKey[] =;

}  // namespace

// The following two classes ensure the `AIContextBoundObjectSet` and the
// `AIContextBoundObject`s will be destroyed when the document or worker host is
// gone. `AIContextBoundObjectSetSupportsUserData` is for workers and
// `AIContextBoundObjectSetDocumentUserData` is for document.
class AIContextBoundObjectSetSupportsUserData
    : public AIContextBoundObjectSet,
      public base::SupportsUserData::Data {};

class AIContextBoundObjectSetDocumentUserData
    : public AIContextBoundObjectSet,
      public content::DocumentUserData<
          AIContextBoundObjectSetDocumentUserData> {};

DOCUMENT_USER_DATA_KEY_IMPL(AIContextBoundObjectSetDocumentUserData);

// static
AIContextBoundObjectSet::ReceiverContextRawRef
AIContextBoundObjectSet::ToReceiverContextRawRef(ReceiverContext context) {}

// static
AIContextBoundObjectSet::ReceiverContext
AIContextBoundObjectSet::ToReceiverContext(
    ReceiverContextRawRef context_raw_ref) {}

AIContextBoundObjectSet::AIContextBoundObjectSet() = default;
AIContextBoundObjectSet::~AIContextBoundObjectSet() = default;

void AIContextBoundObjectSet::AddContextBoundObject(
    std::unique_ptr<AIContextBoundObject> object) {}

void AIContextBoundObjectSet::RemoveContextBoundObject(
    AIContextBoundObject* object) {}

AIContextBoundObjectSet* AIContextBoundObjectSet::GetFromContext(
    ReceiverContext context) {}

size_t AIContextBoundObjectSet::GetSizeForTesting() {}