chromium/third_party/grpc/src/src/core/ext/transport/chttp2/transport/hpack_encoder.cc

//
//
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//

#include <grpc/support/port_platform.h>

#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"

#include <algorithm>
#include <cstdint>

#include <grpc/slice.h>
#include <grpc/slice_buffer.h>
#include <grpc/support/log.h>

#include "src/core/ext/transport/chttp2/transport/bin_encoder.h"
#include "src/core/ext/transport/chttp2/transport/frame.h"
#include "src/core/ext/transport/chttp2/transport/hpack_constants.h"
#include "src/core/ext/transport/chttp2/transport/hpack_encoder_table.h"
#include "src/core/ext/transport/chttp2/transport/http_trace.h"
#include "src/core/ext/transport/chttp2/transport/varint.h"
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/surface/validate_metadata.h"
#include "src/core/lib/transport/timeout_encoding.h"

namespace grpc_core {

namespace {

constexpr size_t kDataFrameHeaderSize =;

}  // namespace

// fills p (which is expected to be kDataFrameHeaderSize bytes long)
// with a data frame header
static void FillHeader(uint8_t* p, uint8_t type, uint32_t id, size_t len,
                       uint8_t flags) {}

void HPackCompressor::Frame(const EncodeHeaderOptions& options,
                            SliceBuffer& raw, grpc_slice_buffer* output) {}

void HPackCompressor::Encoder::EmitIndexed(uint32_t elem_index) {}

struct WireValue {};

static WireValue GetWireValue(Slice value, bool true_binary_enabled,
                              bool is_bin_hdr) {}

struct DefinitelyInterned {};
struct UnsureIfInterned {};

class BinaryStringValue {};

class NonBinaryStringValue {};

class StringKey {};

void HPackCompressor::Encoder::EmitLitHdrWithNonBinaryStringKeyIncIdx(
    Slice key_slice, Slice value_slice) {}

void HPackCompressor::Encoder::EmitLitHdrWithBinaryStringKeyNotIdx(
    Slice key_slice, Slice value_slice) {}

void HPackCompressor::Encoder::EmitLitHdrWithBinaryStringKeyIncIdx(
    Slice key_slice, Slice value_slice) {}

void HPackCompressor::Encoder::EmitLitHdrWithBinaryStringKeyNotIdx(
    uint32_t key_index, Slice value_slice) {}

void HPackCompressor::Encoder::EmitLitHdrWithNonBinaryStringKeyNotIdx(
    Slice key_slice, Slice value_slice) {}

void HPackCompressor::Encoder::AdvertiseTableSizeChange() {}

void HPackCompressor::SliceIndex::EmitTo(absl::string_view key,
                                         const Slice& value, Encoder* encoder) {}

void HPackCompressor::Encoder::Encode(const Slice& key, const Slice& value) {}

void HPackCompressor::Encoder::Encode(HttpPathMetadata, const Slice& value) {}

void HPackCompressor::Encoder::Encode(HttpAuthorityMetadata,
                                      const Slice& value) {}

void HPackCompressor::Encoder::Encode(TeMetadata, TeMetadata::ValueType value) {}

void HPackCompressor::Encoder::Encode(ContentTypeMetadata,
                                      ContentTypeMetadata::ValueType value) {}

void HPackCompressor::Encoder::Encode(HttpSchemeMetadata,
                                      HttpSchemeMetadata::ValueType value) {}

void HPackCompressor::Encoder::Encode(GrpcTraceBinMetadata,
                                      const Slice& slice) {}

void HPackCompressor::Encoder::Encode(GrpcTagsBinMetadata, const Slice& slice) {}

void HPackCompressor::Encoder::Encode(HttpStatusMetadata, uint32_t status) {}

void HPackCompressor::Encoder::Encode(HttpMethodMetadata,
                                      HttpMethodMetadata::ValueType method) {}

void HPackCompressor::Encoder::EncodeAlwaysIndexed(uint32_t* index,
                                                   absl::string_view key,
                                                   Slice value,
                                                   size_t transport_length) {}

void HPackCompressor::Encoder::EncodeIndexedKeyWithBinaryValue(
    uint32_t* index, absl::string_view key, Slice value) {}

void HPackCompressor::Encoder::EncodeRepeatingSliceValue(
    const absl::string_view& key, const Slice& slice, uint32_t* index,
    size_t max_compression_size) {}

void HPackCompressor::Encoder::Encode(GrpcTimeoutMetadata, Timestamp deadline) {}

void HPackCompressor::Encoder::Encode(UserAgentMetadata, const Slice& slice) {}

void HPackCompressor::Encoder::Encode(GrpcStatusMetadata,
                                      grpc_status_code status) {}

void HPackCompressor::Encoder::Encode(GrpcEncodingMetadata,
                                      grpc_compression_algorithm value) {}

void HPackCompressor::Encoder::Encode(GrpcAcceptEncodingMetadata,
                                      CompressionAlgorithmSet value) {}

void HPackCompressor::SetMaxUsableSize(uint32_t max_table_size) {}

void HPackCompressor::SetMaxTableSize(uint32_t max_table_size) {}

HPackCompressor::Encoder::Encoder(HPackCompressor* compressor,
                                  bool use_true_binary_metadata,
                                  SliceBuffer& output)
    :{}

}  // namespace grpc_core