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

Unified Diff: net/quic/quic_framer.h

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_flow_controller_test.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer.h
diff --git a/net/quic/quic_framer.h b/net/quic/quic_framer.h
index 3cfaa88d37201bd1dfd5892b4752b9a4eb4d3d54..34744d91b031ad881908a3321292474cdb5249a8 100644
--- a/net/quic/quic_framer.h
+++ b/net/quic/quic_framer.h
@@ -67,8 +67,8 @@ class NET_EXPORT_PRIVATE QuicFramerVisitorInterface {
// Called if an error is detected in the QUIC protocol.
virtual void OnError(QuicFramer* framer) = 0;
- // Called only when |is_server_| is true and the the framer gets a packet with
- // version flag true and the version on the packet doesn't match
+ // Called only when |perspective_| is IS_SERVER and the the framer gets a
+ // packet with version flag true and the version on the packet doesn't match
// |quic_version_|. The visitor should return true after it updates the
// version of the |framer_| to |received_version| or false to stop processing
// this packet.
@@ -83,8 +83,8 @@ class NET_EXPORT_PRIVATE QuicFramerVisitorInterface {
virtual void OnPublicResetPacket(
const QuicPublicResetPacket& packet) = 0;
- // Called only when |is_server_| is false and a version negotiation packet has
- // been parsed.
+ // Called only when |perspective_| is IS_CLIENT and a version negotiation
+ // packet has been parsed.
virtual void OnVersionNegotiationPacket(
const QuicVersionNegotiationPacket& packet) = 0;
@@ -187,7 +187,7 @@ class NET_EXPORT_PRIVATE QuicFramer {
// version in |supported_versions|.
QuicFramer(const QuicVersionVector& supported_versions,
QuicTime creation_time,
- bool is_server);
+ Perspective perspective);
virtual ~QuicFramer();
@@ -370,7 +370,7 @@ class NET_EXPORT_PRIVATE QuicFramer {
void set_validate_flags(bool value) { validate_flags_ = value; }
- bool is_server() const { return is_server_; }
+ Perspective perspective() const { return perspective_; }
static QuicPacketEntropyHash GetPacketEntropyHash(
const QuicPacketHeader& header);
@@ -529,7 +529,7 @@ class NET_EXPORT_PRIVATE QuicFramer {
scoped_ptr<QuicEncrypter> encrypter_[NUM_ENCRYPTION_LEVELS];
// Tracks if the framer is being used by the entity that received the
// connection or the entity that initiated it.
- bool is_server_;
+ Perspective perspective_;
// If false, skip validation that the public flags are set to legal values.
bool validate_flags_;
// The time this framer was created. Time written to the wire will be
« no previous file with comments | « net/quic/quic_flow_controller_test.cc ('k') | net/quic/quic_framer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698