chromium/net/third_party/quiche/src/quiche/quic/core/qpack/qpack_encoder.cc

// Copyright (c) 2018 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 "quiche/quic/core/qpack/qpack_encoder.h"

#include <algorithm>
#include <string>
#include <utility>

#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/qpack/qpack_index_conversions.h"
#include "quiche/quic/core/qpack/qpack_instruction_encoder.h"
#include "quiche/quic/core/qpack/qpack_required_insert_count.h"
#include "quiche/quic/core/qpack/value_splitting_header_list.h"
#include "quiche/quic/platform/api/quic_flag_utils.h"
#include "quiche/quic/platform/api/quic_flags.h"
#include "quiche/quic/platform/api/quic_logging.h"

namespace quic {

namespace {

// Fraction to calculate draining index.  The oldest |kDrainingFraction| entries
// will not be referenced in header blocks.  A new entry (duplicate or literal
// with name reference) will be added to the dynamic table instead.  This allows
// the number of references to the draining entry to go to zero faster, so that
// it can be evicted.  See
// https://rfc-editor.org/rfc/rfc9204.html#section-2.1.1.1.
// TODO(bnc): Fine tune.
const float kDrainingFraction =;

}  // anonymous namespace

QpackEncoder::QpackEncoder(
    DecoderStreamErrorDelegate* decoder_stream_error_delegate,
    HuffmanEncoding huffman_encoding, CookieCrumbling cookie_crumbling)
    :{}

QpackEncoder::~QpackEncoder() {}

// static
QpackEncoder::Representation QpackEncoder::EncodeIndexedHeaderField(
    bool is_static, uint64_t index,
    QpackBlockingManager::IndexSet* referred_indices) {}

// static
QpackEncoder::Representation
QpackEncoder::EncodeLiteralHeaderFieldWithNameReference(
    bool is_static, uint64_t index, absl::string_view value,
    QpackBlockingManager::IndexSet* referred_indices) {}

// static
QpackEncoder::Representation QpackEncoder::EncodeLiteralHeaderField(
    absl::string_view name, absl::string_view value) {}

QpackEncoder::Representations QpackEncoder::FirstPassEncode(
    QuicStreamId stream_id, const quiche::HttpHeaderBlock& header_list,
    QpackBlockingManager::IndexSet* referred_indices,
    QuicByteCount* encoder_stream_sent_byte_count) {}

std::string QpackEncoder::SecondPassEncode(
    QpackEncoder::Representations representations,
    uint64_t required_insert_count) const {}

std::string QpackEncoder::EncodeHeaderList(
    QuicStreamId stream_id, const quiche::HttpHeaderBlock& header_list,
    QuicByteCount* encoder_stream_sent_byte_count) {}

bool QpackEncoder::SetMaximumDynamicTableCapacity(
    uint64_t maximum_dynamic_table_capacity) {}

void QpackEncoder::SetDynamicTableCapacity(uint64_t dynamic_table_capacity) {}

bool QpackEncoder::SetMaximumBlockedStreams(uint64_t maximum_blocked_streams) {}

void QpackEncoder::OnInsertCountIncrement(uint64_t increment) {}

void QpackEncoder::OnHeaderAcknowledgement(QuicStreamId stream_id) {}

void QpackEncoder::OnStreamCancellation(QuicStreamId stream_id) {}

void QpackEncoder::OnErrorDetected(QuicErrorCode error_code,
                                   absl::string_view error_message) {}

}  // namespace quic