chromium/third_party/blink/renderer/core/dom/observable_internal_observer.h

// 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.

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_DOM_OBSERVABLE_INTERNAL_OBSERVER_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_DOM_OBSERVABLE_INTERNAL_OBSERVER_H_

#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_script_runner.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"

namespace blink {

// Implementation of the DOM `Observable` API's "internal observer" concept.
// See: https://wicg.github.io/observable/#internal-observer. It is responsible
// for holding onto the concrete "next", "error", and "complete" algorithms that
// `Subscriber::{next(), error(), complete()} ultimately invoke.
//
// Most of the time these algorithms are whatever JavaScript passes in as
// callbacks in the Web IDL `Observer` dictionary. But for the various
// Promise-returning operators on the Observable interface [1], it is C++ that
// subscribes to an Observable, passing in its own native "next", "error", and
// "complete" algorithms in the `ObservableInternalObserver`.
//
// [1]: https://wicg.github.io/observable/#promise-returning-operators)
class CORE_EXPORT ObservableInternalObserver
    : public GarbageCollected<ObservableInternalObserver> {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_DOM_OBSERVABLE_INTERNAL_OBSERVER_H_