Refactor Http2Dispatcher (et al.) to prepare for --shinkansen_trace_logging. This CL introduces several hooks in Http2Dispatcher for determining whether to trace log and for creating trace loggers. The idea is to override these hooks in VtlClientDispatcher and VtlBackendDispatcher to use shinkansen_trace_logging (created in cl/344470308, installed in cl/344470585). This CL adds analogous hooks for test classes. The hooks need to generalize the trace logger type to an interface, so the destructor of the SpdyFrameVisitor interface needed to be public. This CL also brings some logging from Http2WriteQueue and Http2DataFrameBuilder back to Http2Dispatcher, in order to consolidate and simplify trace logging. PiperOrigin-RevId: 345259520 Change-Id: Ib0f02bca2a88c8353bbeb2621fcfbf901a677342
diff --git a/spdy/core/spdy_protocol.h b/spdy/core/spdy_protocol.h index a2b9c4d..44a00e3 100644 --- a/spdy/core/spdy_protocol.h +++ b/spdy/core/spdy_protocol.h
@@ -1013,6 +1013,11 @@ // method of this class will be called. class QUICHE_EXPORT_PRIVATE SpdyFrameVisitor { public: + SpdyFrameVisitor() {} + SpdyFrameVisitor(const SpdyFrameVisitor&) = delete; + SpdyFrameVisitor& operator=(const SpdyFrameVisitor&) = delete; + virtual ~SpdyFrameVisitor() {} + virtual void VisitRstStream(const SpdyRstStreamIR& rst_stream) = 0; virtual void VisitSettings(const SpdySettingsIR& settings) = 0; virtual void VisitPing(const SpdyPingIR& ping) = 0; @@ -1027,12 +1032,6 @@ virtual void VisitUnknown(const SpdyUnknownIR& /*unknown*/) { // TODO(birenroy): make abstract. } - - protected: - SpdyFrameVisitor() {} - SpdyFrameVisitor(const SpdyFrameVisitor&) = delete; - SpdyFrameVisitor& operator=(const SpdyFrameVisitor&) = delete; - virtual ~SpdyFrameVisitor() {} }; // Optionally, and in addition to SpdyFramerVisitorInterface, a class supporting