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

Unified Diff: net/quic/quic_packet_creator.cc

Issue 1009543004: Create a Perspective enum to use instead of a bool is_server to improve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NET_EXPORT_PRIVATE to fix compiler error Created 5 years, 9 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_http_stream_test.cc ('k') | net/quic/quic_packet_creator_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_creator.cc
diff --git a/net/quic/quic_packet_creator.cc b/net/quic/quic_packet_creator.cc
index 6fecaa89fcefdabed22cecd4de47c5e4cff66aa3..ac2a94e5908ebfc060206a4a67fa7e43520cc236 100644
--- a/net/quic/quic_packet_creator.cc
+++ b/net/quic/quic_packet_creator.cc
@@ -75,7 +75,7 @@ QuicPacketCreator::QuicPacketCreator(QuicConnectionId connection_id,
sequence_number_(0),
should_fec_protect_(false),
fec_group_number_(0),
- send_version_in_packet_(!framer->is_server()),
+ send_version_in_packet_(framer->perspective() == Perspective::IS_CLIENT),
max_packet_length_(kDefaultMaxPacketSize),
max_packets_per_fec_group_(kDefaultMaxPacketsPerFecGroup),
connection_id_length_(PACKET_8BYTE_CONNECTION_ID),
@@ -452,7 +452,7 @@ SerializedPacket QuicPacketCreator::SerializeFec() {
QuicEncryptedPacket* QuicPacketCreator::SerializeVersionNegotiationPacket(
const QuicVersionVector& supported_versions) {
- DCHECK(framer_->is_server());
+ DCHECK_EQ(Perspective::IS_SERVER, framer_->perspective());
QuicPacketPublicHeader header;
header.connection_id = connection_id_;
header.reset_flag = false;
« no previous file with comments | « net/quic/quic_http_stream_test.cc ('k') | net/quic/quic_packet_creator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698