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

Unified Diff: net/quic/quic_connection.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_client_session_test.cc ('k') | net/quic/quic_connection.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection.h
diff --git a/net/quic/quic_connection.h b/net/quic/quic_connection.h
index 789a7e52e0ed80bbf24295a48bd65bac32c25200..48742fce16de931277cc2fb68ad23da45c4dfcdb 100644
--- a/net/quic/quic_connection.h
+++ b/net/quic/quic_connection.h
@@ -247,7 +247,7 @@ class NET_EXPORT_PRIVATE QuicConnection
QuicConnectionHelperInterface* helper,
const PacketWriterFactory& writer_factory,
bool owns_writer,
- bool is_server,
+ Perspective perspective,
bool is_secure,
const QuicVersionVector& supported_versions);
~QuicConnection() override;
@@ -404,7 +404,7 @@ class NET_EXPORT_PRIVATE QuicConnection
// Must only be called on client connections.
const QuicVersionVector& server_supported_versions() const {
- DCHECK(!is_server_);
+ DCHECK_EQ(Perspective::IS_CLIENT, perspective_);
return server_supported_versions_;
}
@@ -487,7 +487,7 @@ class NET_EXPORT_PRIVATE QuicConnection
const QuicDecrypter* decrypter() const;
const QuicDecrypter* alternative_decrypter() const;
- bool is_server() const { return is_server_; }
+ Perspective perspective() const { return perspective_; }
// Allow easy overriding of truncated connection IDs.
void set_can_truncate_connection_ids(bool can) {
@@ -804,8 +804,8 @@ class NET_EXPORT_PRIVATE QuicConnection
// The state of connection in version negotiation finite state machine.
QuicVersionNegotiationState version_negotiation_state_;
- // Tracks if the connection was created by the server.
- bool is_server_;
+ // Tracks if the connection was created by the server or the client.
+ Perspective perspective_;
// True by default. False if we've received or sent an explicit connection
// close.
« no previous file with comments | « net/quic/quic_client_session_test.cc ('k') | net/quic/quic_connection.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698