chromium/third_party/openscreen/src/cast/streaming/public/session_messenger.h

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CAST_STREAMING_PUBLIC_SESSION_MESSENGER_H_
#define CAST_STREAMING_PUBLIC_SESSION_MESSENGER_H_

#include <functional>
#include <string>
#include <utility>
#include <vector>

#include "absl/types/variant.h"
#include "cast/common/public/message_port.h"
#include "cast/streaming/public/answer_messages.h"
#include "cast/streaming/public/offer_messages.h"
#include "cast/streaming/public/receiver_message.h"
#include "cast/streaming/sender_message.h"
#include "json/value.h"
#include "platform/api/task_runner.h"
#include "util/flat_map.h"
#include "util/weak_ptr.h"

namespace openscreen::cast {

// A message port interface designed specifically for use by the Receiver
// and Sender session classes.
class SessionMessenger : public MessagePort::Client {};

// Message port interface designed to handle sending messages to and
// from a receiver. When possible, errors receiving messages are reported
// to the ReplyCallback passed to SendRequest(), otherwise errors are
// reported to the ErrorCallback passed in the constructor.
class SenderSessionMessenger final : public SessionMessenger {};

// Message port interface designed for messaging to and from a sender.
class ReceiverSessionMessenger final : public SessionMessenger {};

}  // namespace openscreen::cast

#endif  // CAST_STREAMING_PUBLIC_SESSION_MESSENGER_H_