#include "quiche/http2/core/http2_trace_logging.h"
#include <cstdint>
#include <memory>
#include <ostream>
#include <string>
#include <utility>
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "quiche/http2/core/spdy_protocol.h"
#include "quiche/common/http/http_header_block.h"
#include "quiche/common/platform/api/quiche_bug_tracker.h"
#include "quiche/common/platform/api/quiche_logging.h"
#include "quiche/common/quiche_callbacks.h"
#define FORMAT_ARG(arg) …
#define FORMAT_INT_ARG(arg) …
#define FORMAT_ATTR(ir, attrib) …
#define FORMAT_INT_ATTR(ir, attrib) …
namespace {
template <typename T, typename ItemLogger>
struct ContainerLogger { … };
template <typename T, typename ItemLogger>
auto LogContainer(const T& container, ItemLogger item_logger)
-> decltype(ContainerLogger<T, ItemLogger>(container, item_logger)) { … }
}
#define FORMAT_HEADER_BLOCK(ir) …
namespace http2 {
HttpHeaderBlock;
SettingsMap;
SpdyAltSvcIR;
SpdyContinuationIR;
SpdyDataIR;
SpdyGoAwayIR;
SpdyHeadersIR;
SpdyPingIR;
SpdyPriorityIR;
SpdyPushPromiseIR;
SpdyRstStreamIR;
SpdySettingsIR;
SpdyStreamId;
SpdyUnknownIR;
SpdyWindowUpdateIR;
namespace {
struct LogHeaderBlockEntry { … };
struct LogSettingsEntry { … };
struct LogAlternativeService { … };
}
Http2TraceLogger::Http2TraceLogger(SpdyFramerVisitorInterface* parent,
absl::string_view perspective,
quiche::MultiUseCallback<bool()> is_enabled,
const void* connection_id)
: … { … }
Http2TraceLogger::~Http2TraceLogger() { … }
void Http2TraceLogger::OnError(Http2DecoderAdapter::SpdyFramerError error,
std::string detailed_error) { … }
void Http2TraceLogger::OnCommonHeader(SpdyStreamId stream_id, size_t length,
uint8_t type, uint8_t flags) { … }
void Http2TraceLogger::OnDataFrameHeader(SpdyStreamId stream_id, size_t length,
bool fin) { … }
void Http2TraceLogger::OnStreamFrameData(SpdyStreamId stream_id,
const char* data, size_t len) { … }
void Http2TraceLogger::OnStreamEnd(SpdyStreamId stream_id) { … }
void Http2TraceLogger::OnStreamPadLength(SpdyStreamId stream_id, size_t value) { … }
void Http2TraceLogger::OnStreamPadding(SpdyStreamId stream_id, size_t len) { … }
spdy::SpdyHeadersHandlerInterface* Http2TraceLogger::OnHeaderFrameStart(
SpdyStreamId stream_id) { … }
void Http2TraceLogger::OnHeaderFrameEnd(SpdyStreamId stream_id) { … }
void Http2TraceLogger::OnRstStream(SpdyStreamId stream_id,
SpdyErrorCode error_code) { … }
void Http2TraceLogger::OnSettings() { … }
void Http2TraceLogger::OnSetting(SpdySettingsId id, uint32_t value) { … }
void Http2TraceLogger::OnSettingsEnd() { … }
void Http2TraceLogger::OnSettingsAck() { … }
void Http2TraceLogger::OnPing(SpdyPingId unique_id, bool is_ack) { … }
void Http2TraceLogger::OnGoAway(SpdyStreamId last_accepted_stream_id,
SpdyErrorCode error_code) { … }
bool Http2TraceLogger::OnGoAwayFrameData(const char* goaway_data, size_t len) { … }
void Http2TraceLogger::OnHeaders(SpdyStreamId stream_id, size_t payload_length,
bool has_priority, int weight,
SpdyStreamId parent_stream_id, bool exclusive,
bool fin, bool end) { … }
void Http2TraceLogger::OnWindowUpdate(SpdyStreamId stream_id,
int delta_window_size) { … }
void Http2TraceLogger::OnPushPromise(SpdyStreamId original_stream_id,
SpdyStreamId promised_stream_id,
bool end) { … }
void Http2TraceLogger::OnContinuation(SpdyStreamId stream_id,
size_t payload_length, bool end) { … }
void Http2TraceLogger::OnAltSvc(
SpdyStreamId stream_id, absl::string_view origin,
const SpdyAltSvcWireFormat::AlternativeServiceVector& altsvc_vector) { … }
void Http2TraceLogger::OnPriority(SpdyStreamId stream_id,
SpdyStreamId parent_stream_id, int weight,
bool exclusive) { … }
void Http2TraceLogger::OnPriorityUpdate(
SpdyStreamId prioritized_stream_id,
absl::string_view priority_field_value) { … }
bool Http2TraceLogger::OnUnknownFrame(SpdyStreamId stream_id,
uint8_t frame_type) { … }
void Http2TraceLogger::OnUnknownFrameStart(spdy::SpdyStreamId stream_id,
size_t length, uint8_t type,
uint8_t flags) { … }
void Http2TraceLogger::OnUnknownFramePayload(spdy::SpdyStreamId stream_id,
absl::string_view payload) { … }
void Http2TraceLogger::LogReceivedHeaders() const { … }
void Http2FrameLogger::VisitRstStream(const SpdyRstStreamIR& rst_stream) { … }
void Http2FrameLogger::VisitSettings(const SpdySettingsIR& settings) { … }
void Http2FrameLogger::VisitPing(const SpdyPingIR& ping) { … }
void Http2FrameLogger::VisitGoAway(const SpdyGoAwayIR& goaway) { … }
void Http2FrameLogger::VisitHeaders(const SpdyHeadersIR& headers) { … }
void Http2FrameLogger::VisitWindowUpdate(
const SpdyWindowUpdateIR& window_update) { … }
void Http2FrameLogger::VisitPushPromise(const SpdyPushPromiseIR& push_promise) { … }
void Http2FrameLogger::VisitContinuation(
const SpdyContinuationIR& continuation) { … }
void Http2FrameLogger::VisitAltSvc(const SpdyAltSvcIR& altsvc) { … }
void Http2FrameLogger::VisitPriority(const SpdyPriorityIR& priority) { … }
void Http2FrameLogger::VisitData(const SpdyDataIR& data) { … }
void Http2FrameLogger::VisitPriorityUpdate(
const spdy::SpdyPriorityUpdateIR& priority_update) { … }
void Http2FrameLogger::VisitAcceptCh(
const spdy::SpdyAcceptChIR& ) { … }
void Http2FrameLogger::VisitUnknown(const SpdyUnknownIR& ir) { … }
}