chromium/third_party/blink/renderer/modules/ai/ai_rewriter_factory.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 "third_party/blink/renderer/modules/ai/ai_rewriter_factory.h"

#include "base/notreached.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "third_party/blink/public/mojom/ai/ai_manager.mojom-blink.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_ai_rewriter_create_options.h"
#include "third_party/blink/renderer/core/dom/abort_signal.h"
#include "third_party/blink/renderer/modules/ai/ai.h"
#include "third_party/blink/renderer/modules/ai/ai_rewriter.h"
#include "third_party/blink/renderer/modules/ai/exception_helpers.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/heap/self_keep_alive.h"
#include "third_party/blink/renderer/platform/mojo/heap_mojo_receiver.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"

namespace blink {
namespace {

const char kExceptionMessageUnableToCreateRewriter[] =;

mojom::blink::AIRewriterTone ToMojoAIRewriterTone(V8AIRewriterTone tone) {}

mojom::blink::AIRewriterLength ToMojoAIRewriterLength(V8AIRewriterLength tone) {}

// TODO(crbug.com/358214322): Consider unifying the logic of this class with
// CreateWriterClient in ai_writer_factory.cc.
class CreateRewriterClient : public GarbageCollected<CreateRewriterClient>,
                             public mojom::blink::AIManagerCreateRewriterClient,
                             public ContextLifecycleObserver {};

}  // namespace

AIRewriterFactory::AIRewriterFactory(AI* ai)
    :{}

void AIRewriterFactory::Trace(Visitor* visitor) const {}

ScriptPromise<AIRewriter> AIRewriterFactory::create(
    ScriptState* script_state,
    const AIRewriterCreateOptions* options,
    ExceptionState& exception_state) {}

}  // namespace blink