chromium/third_party/blink/renderer/bindings/core/v8/async_iterable.cc

// Copyright 2023 The Chromium Authors. All rights reserved.
// 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/bindings/core/v8/async_iterable.h"

#include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable_creation_key.h"
#include "third_party/blink/renderer/bindings/core/v8/script_function.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"

namespace blink::bindings {

// Common implementation of
// Run{Next,Fulfill,Reject,Return,ReturnFulfill}StepsCallable.
class AsyncIterationSourceBase::CallableCommon
    : public ScriptFunction::Callable {};

class AsyncIterationSourceBase::RunNextStepsCallable final
    : public AsyncIterationSourceBase::CallableCommon {};

class AsyncIterationSourceBase::RunFulfillStepsCallable final
    : public AsyncIterationSourceBase::CallableCommon {};

class AsyncIterationSourceBase::RunRejectStepsCallable final
    : public AsyncIterationSourceBase::CallableCommon {};

class AsyncIterationSourceBase::RunReturnStepsCallable final
    : public AsyncIterationSourceBase::CallableCommon {};

class AsyncIterationSourceBase::RunReturnFulfillStepsCallable final
    : public AsyncIterationSourceBase::CallableCommon {};

AsyncIterationSourceBase::AsyncIterationSourceBase(ScriptState* script_state,
                                                   Kind kind)
    :{}

v8::Local<v8::Promise> AsyncIterationSourceBase::Next(
    ScriptState* script_state,
    ExceptionState& exception_state) {}

v8::Local<v8::Promise> AsyncIterationSourceBase::Return(
    ScriptState* script_state,
    v8::Local<v8::Value> value,
    ExceptionState& exception_state) {}

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

v8::Local<v8::Value> AsyncIterationSourceBase::MakeEndOfIteration() const {}

// step 8. Let nextSteps be the following steps:
ScriptPromise<IDLAny> AsyncIterationSourceBase::RunNextSteps(
    ScriptState* script_state) {}

// step 8.5. Let fulfillSteps be the following steps, given next:
ScriptValue AsyncIterationSourceBase::RunFulfillSteps(
    ScriptState* script_state,
    ScriptValue iter_result_object_or_undefined) {}

// step 8.7. Let rejectSteps be the following steps, given reason:
ScriptValue AsyncIterationSourceBase::RunRejectSteps(ScriptState* script_state,
                                                     ScriptValue reason) {}

// step 8. Let returnSteps be the following steps:
ScriptPromise<IDLAny> AsyncIterationSourceBase::RunReturnSteps(
    ScriptState* script_state,
    ScriptValue value) {}

// step 13. Let fulfillSteps be the following steps:
ScriptValue AsyncIterationSourceBase::RunReturnFulfillSteps(
    ScriptState* script_state,
    ScriptValue value) {}

}  // namespace blink::bindings