#include "third_party/blink/renderer/modules/direct_sockets/udp_readable_stream_wrapper.h"
#include "base/functional/callback_forward.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "net/base/net_errors.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_underlying_source.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_arraybuffer_arraybufferview.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_udp_message.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/dom/events/event_target_impl.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/streams/readable_stream.h"
#include "third_party/blink/renderer/core/streams/readable_stream_default_controller_with_script_scope.h"
#include "third_party/blink/renderer/core/streams/underlying_source_base.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
#include "third_party/blink/renderer/modules/direct_sockets/stream_wrapper.h"
#include "third_party/blink/renderer/modules/direct_sockets/udp_writable_stream_wrapper.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/bindings/v8_throw_exception.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_deque.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
namespace {
constexpr uint32_t kReadableStreamBufferSize = …;
}
UDPReadableStreamWrapper::UDPReadableStreamWrapper(
ScriptState* script_state,
CloseOnceCallback on_close,
const Member<UDPSocketMojoRemote> udp_socket,
mojo::PendingReceiver<network::mojom::blink::UDPSocketListener>
socket_listener)
: … { … }
void UDPReadableStreamWrapper::Pull() { … }
void UDPReadableStreamWrapper::Trace(Visitor* visitor) const { … }
void UDPReadableStreamWrapper::CloseStream() { … }
void UDPReadableStreamWrapper::ErrorStream(int32_t error_code) { … }
void UDPReadableStreamWrapper::OnReceived(
int32_t result,
const std::optional<::net::IPEndPoint>& src_addr,
std::optional<::base::span<const ::uint8_t>> data) { … }
}