Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1321)

Unified Diff: net/quic/quic_protocol.h

Issue 1399893005: relnote: Inline all frames smaller than a pointer into QuicFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Avoid_redundant_recvmmsg_104327020
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_packet_generator.cc ('k') | net/quic/quic_protocol.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_protocol.h
diff --git a/net/quic/quic_protocol.h b/net/quic/quic_protocol.h
index eb80b7d39b710df8184ede173fcf97aa370d4132..b524aa40c429a46ea0878459669cc2837a92dfe6 100644
--- a/net/quic/quic_protocol.h
+++ b/net/quic/quic_protocol.h
@@ -690,13 +690,11 @@ enum QuicVersionNegotiationState {
typedef QuicPacketPublicHeader QuicVersionNegotiationPacket;
// A padding frame contains no payload.
-struct NET_EXPORT_PRIVATE QuicPaddingFrame {
-};
+struct NET_EXPORT_PRIVATE QuicPaddingFrame {};
// A ping frame contains no payload, though it is retransmittable,
// and ACK'd just like other normal frames.
-struct NET_EXPORT_PRIVATE QuicPingFrame {
-};
+struct NET_EXPORT_PRIVATE QuicPingFrame {};
// A path MTU discovery frame contains no payload and is serialized as a ping
// frame.
@@ -999,39 +997,43 @@ enum EncryptionLevel {
struct NET_EXPORT_PRIVATE QuicFrame {
QuicFrame();
- explicit QuicFrame(QuicPaddingFrame* padding_frame);
+ explicit QuicFrame(QuicPaddingFrame padding_frame);
+ explicit QuicFrame(QuicMtuDiscoveryFrame frame);
+ explicit QuicFrame(QuicPingFrame frame);
+ explicit QuicFrame(QuicBlockedFrame frame);
+
explicit QuicFrame(QuicStreamFrame* stream_frame);
explicit QuicFrame(QuicAckFrame* frame);
- explicit QuicFrame(QuicMtuDiscoveryFrame* frame);
-
explicit QuicFrame(QuicRstStreamFrame* frame);
explicit QuicFrame(QuicConnectionCloseFrame* frame);
explicit QuicFrame(QuicStopWaitingFrame* frame);
- explicit QuicFrame(QuicPingFrame* frame);
explicit QuicFrame(QuicGoAwayFrame* frame);
explicit QuicFrame(QuicWindowUpdateFrame* frame);
- explicit QuicFrame(QuicBlockedFrame* frame);
NET_EXPORT_PRIVATE friend std::ostream& operator<<(
std::ostream& os, const QuicFrame& frame);
QuicFrameType type;
union {
- QuicPaddingFrame* padding_frame;
+ // Frames smaller than a pointer are inline.
+ QuicPaddingFrame padding_frame;
+ QuicMtuDiscoveryFrame mtu_discovery_frame;
+ QuicPingFrame ping_frame;
+ QuicBlockedFrame blocked_frame;
+
+ // Frames larger than a pointer.
QuicStreamFrame* stream_frame;
QuicAckFrame* ack_frame;
- QuicMtuDiscoveryFrame* mtu_discovery_frame;
-
QuicStopWaitingFrame* stop_waiting_frame;
-
- QuicPingFrame* ping_frame;
QuicRstStreamFrame* rst_stream_frame;
QuicConnectionCloseFrame* connection_close_frame;
QuicGoAwayFrame* goaway_frame;
QuicWindowUpdateFrame* window_update_frame;
- QuicBlockedFrame* blocked_frame;
};
};
+// QuicFrameType consumes 8 bytes with padding.
+static_assert(sizeof(QuicFrame) <= 16,
+ "Frames larger than 8 bytes should be referenced by pointer.");
typedef std::vector<QuicFrame> QuicFrames;
« no previous file with comments | « net/quic/quic_packet_generator.cc ('k') | net/quic/quic_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698