// Copyright (c) 2017 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.

#ifndef QUICHE_QUIC_QUARTC_QUARTC_DISPATCHER_H_
#define QUICHE_QUIC_QUARTC_QUARTC_DISPATCHER_H_

#include "net/third_party/quiche/src/quic/core/crypto/quic_crypto_server_config.h"
#include "net/third_party/quiche/src/quic/core/quic_alarm_factory.h"
#include "net/third_party/quiche/src/quic/core/quic_config.h"
#include "net/third_party/quiche/src/quic/core/quic_connection.h"
#include "net/third_party/quiche/src/quic/core/quic_connection_id.h"
#include "net/third_party/quiche/src/quic/core/quic_crypto_server_stream.h"
#include "net/third_party/quiche/src/quic/core/quic_dispatcher.h"
#include "net/third_party/quiche/src/quic/core/quic_version_manager.h"
#include "net/third_party/quiche/src/quic/core/quic_versions.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_socket_address.h"
#include "net/third_party/quiche/src/quic/quartc/quartc_session.h"
#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"

namespace quic {

class QuartcDispatcher : public QuicDispatcher,
                         QuartcPacketTransport::Delegate {
 public:
  class Delegate {
   public:
    virtual ~Delegate() = default;
    virtual void OnSessionCreated(QuartcSession* session) = 0;
  };

  QuartcDispatcher(
      std::unique_ptr<QuicConfig> config,
      std::unique_ptr<QuicCryptoServerConfig> crypto_config,
      QuicVersionManager* version_manager,
      std::unique_ptr<QuicConnectionHelperInterface> helper,
      std::unique_ptr<QuicCryptoServerStreamBase::Helper> session_helper,
      std::unique_ptr<QuicAlarmFactory> alarm_factory,
      std::unique_ptr<QuartcPacketWriter> packet_writer,
      Delegate* delegate);
  ~QuartcDispatcher() override;

  std::unique_ptr<QuicSession> CreateQuicSession(
      QuicConnectionId server_connection_id,
      const QuicSocketAddress& client_address,
      quiche::QuicheStringPiece alpn,
      const ParsedQuicVersion& version) override;

  // TODO(b/124399417): Override GenerateNewServerConnectionId and request a
  // zero-length connection id when the QUIC server perspective supports it.

  // QuartcPacketTransport::Delegate overrides.
  void OnTransportCanWrite() override;
  void OnTransportReceived(const char* data, size_t data_len) override;

 private:
  // Members owned by QuartcDispatcher but not QuicDispatcher.
  std::unique_ptr<QuicConfig> owned_quic_config_;
  std::unique_ptr<QuicCryptoServerConfig> owned_crypto_config_;

  // Delegate invoked when the dispatcher creates a new session.
  Delegate* delegate_;

  // The packet writer used by this dispatcher.  Owned by the base class, but
  // the base class upcasts it to QuicPacketWriter (which prevents detaching the
  // transport delegate without a downcast).
  QuartcPacketWriter* packet_writer_;
};

}  // namespace quic

#endif  // QUICHE_QUIC_QUARTC_QUARTC_DISPATCHER_H_
