#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) { … }
class CreateRewriterClient : public GarbageCollected<CreateRewriterClient>,
public mojom::blink::AIManagerCreateRewriterClient,
public ContextLifecycleObserver { … };
}
AIRewriterFactory::AIRewriterFactory(AI* ai)
: … { … }
void AIRewriterFactory::Trace(Visitor* visitor) const { … }
ScriptPromise<AIRewriter> AIRewriterFactory::create(
ScriptState* script_state,
const AIRewriterCreateOptions* options,
ExceptionState& exception_state) { … }
}