summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_session_key.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/quic/quic_session_key.cc')
-rw-r--r--net/quic/quic_session_key.cc21
1 files changed, 15 insertions, 6 deletions
diff --git a/net/quic/quic_session_key.cc b/net/quic/quic_session_key.cc
index 385a1de..8ffd524 100644
--- a/net/quic/quic_session_key.cc
+++ b/net/quic/quic_session_key.cc
@@ -11,15 +11,19 @@ namespace net {
QuicSessionKey::QuicSessionKey() {}
QuicSessionKey::QuicSessionKey(const HostPortPair& host_port_pair,
- bool is_https)
+ bool is_https,
+ PrivacyMode privacy_mode)
: host_port_pair_(host_port_pair),
- is_https_(is_https) {}
+ is_https_(is_https),
+ privacy_mode_(privacy_mode) {}
QuicSessionKey::QuicSessionKey(const string& host,
uint16 port,
- bool is_https)
+ bool is_https,
+ PrivacyMode privacy_mode)
: host_port_pair_(host, port),
- is_https_(is_https) {}
+ is_https_(is_https),
+ privacy_mode_(privacy_mode) {}
QuicSessionKey::~QuicSessionKey() {}
@@ -27,16 +31,21 @@ bool QuicSessionKey::operator<(const QuicSessionKey& other) const {
if (!host_port_pair_.Equals(other.host_port_pair_)) {
return host_port_pair_ < other.host_port_pair_;
}
- return is_https_ < other.is_https_;
+ if (is_https_ != other.is_https_) {
+ return is_https_ < other.is_https_;
+ }
+ return privacy_mode_ < other.privacy_mode_;
}
bool QuicSessionKey::operator==(const QuicSessionKey& other) const {
return is_https_ == other.is_https_ &&
+ privacy_mode_ == other.privacy_mode_ &&
host_port_pair_.Equals(other.host_port_pair_);
}
string QuicSessionKey::ToString() const {
- return (is_https_ ? "https://" : "http://") + host_port_pair_.ToString();
+ return (is_https_ ? "https://" : "http://") + host_port_pair_.ToString() +
+ (privacy_mode_ == kPrivacyModeEnabled ? "/private" : "");
}
} // namespace net