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

Unified Diff: net/quic/quic_sent_packet_manager.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_sent_packet_manager.h ('k') | net/quic/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sent_packet_manager.cc
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index 242d8e748ec3000eccb68939c2358df1ed36a46d..3c387472f557d7b4de833d31808016cecf2715af 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -65,17 +65,18 @@ bool HasCryptoHandshake(const TransmissionInfo& transmission_info) {
} // namespace
-#define ENDPOINT (is_server_ ? "Server: " : " Client: ")
+#define ENDPOINT \
+ (perspective_ == Perspective::IS_SERVER ? "Server: " : "Client: ")
QuicSentPacketManager::QuicSentPacketManager(
- bool is_server,
+ Perspective perspective,
const QuicClock* clock,
QuicConnectionStats* stats,
CongestionControlType congestion_control_type,
LossDetectionType loss_type,
bool is_secure)
: unacked_packets_(),
- is_server_(is_server),
+ perspective_(perspective),
clock_(clock),
stats_(stats),
debug_delegate_(nullptr),
@@ -166,7 +167,7 @@ void QuicSentPacketManager::SetFromConfig(const QuicConfig& config) {
max(kMinSocketReceiveBuffer,
static_cast<QuicByteCount>(config.ReceivedSocketReceiveBuffer()));
}
- send_algorithm_->SetFromConfig(config, is_server_, using_pacing_);
+ send_algorithm_->SetFromConfig(config, perspective_, using_pacing_);
if (network_change_visitor_ != nullptr) {
network_change_visitor_->OnCongestionWindowChange();
@@ -195,7 +196,7 @@ void QuicSentPacketManager::SetNumOpenStreams(size_t num_streams) {
bool QuicSentPacketManager::HasClientSentConnectionOption(
const QuicConfig& config, QuicTag tag) const {
- if (is_server_) {
+ if (perspective_ == Perspective::IS_SERVER) {
if (config.HasReceivedConnectionOptions() &&
ContainsQuicTag(config.ReceivedConnectionOptions(), tag)) {
return true;
« no previous file with comments | « net/quic/quic_sent_packet_manager.h ('k') | net/quic/quic_sent_packet_manager_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698