| Index: net/quic/quic_server_id.cc
|
| diff --git a/net/quic/quic_server_id.cc b/net/quic/quic_server_id.cc
|
| index 89fd471c1f313efd373e6d9c79eef6ac2424dbc2..822c1b0e793d36bbfcc2bebb01c136d08aa855fc 100644
|
| --- a/net/quic/quic_server_id.cc
|
| +++ b/net/quic/quic_server_id.cc
|
| @@ -3,6 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "net/quic/quic_server_id.h"
|
| +#include "base/logging.h"
|
|
|
| #include "net/base/host_port_pair.h"
|
| #include "net/base/port_util.h"
|
| @@ -12,30 +13,20 @@ using std::string;
|
|
|
| namespace net {
|
|
|
| -QuicServerId::QuicServerId()
|
| - : is_https_(false), privacy_mode_(PRIVACY_MODE_DISABLED) {
|
| -}
|
| +QuicServerId::QuicServerId() : privacy_mode_(PRIVACY_MODE_DISABLED) {}
|
|
|
| QuicServerId::QuicServerId(const HostPortPair& host_port_pair,
|
| - bool is_https,
|
| PrivacyMode privacy_mode)
|
| : host_port_pair_(host_port_pair),
|
| - is_https_(is_https),
|
| privacy_mode_(privacy_mode) {}
|
|
|
| -QuicServerId::QuicServerId(const string& host,
|
| - uint16 port,
|
| - bool is_https)
|
| - : host_port_pair_(host, port),
|
| - is_https_(is_https),
|
| - privacy_mode_(PRIVACY_MODE_DISABLED) {}
|
| +QuicServerId::QuicServerId(const string& host, uint16 port)
|
| + : host_port_pair_(host, port), privacy_mode_(PRIVACY_MODE_DISABLED) {}
|
|
|
| QuicServerId::QuicServerId(const string& host,
|
| uint16 port,
|
| - bool is_https,
|
| PrivacyMode privacy_mode)
|
| : host_port_pair_(host, port),
|
| - is_https_(is_https),
|
| privacy_mode_(privacy_mode) {}
|
|
|
| QuicServerId::~QuicServerId() {}
|
| @@ -44,16 +35,12 @@ bool QuicServerId::operator<(const QuicServerId& other) const {
|
| if (!host_port_pair_.Equals(other.host_port_pair_)) {
|
| return host_port_pair_ < other.host_port_pair_;
|
| }
|
| - if (is_https_ != other.is_https_) {
|
| - return is_https_ < other.is_https_;
|
| - }
|
| return privacy_mode_ < other.privacy_mode_;
|
| }
|
|
|
| bool QuicServerId::operator==(const QuicServerId& other) const {
|
| - return is_https_ == other.is_https_ &&
|
| - privacy_mode_ == other.privacy_mode_ &&
|
| - host_port_pair_.Equals(other.host_port_pair_);
|
| + return privacy_mode_ == other.privacy_mode_ &&
|
| + host_port_pair_.Equals(other.host_port_pair_);
|
| }
|
|
|
| // static
|
| @@ -61,14 +48,14 @@ QuicServerId QuicServerId::FromString(const std::string& str) {
|
| GURL url(str);
|
| if (!url.is_valid())
|
| return QuicServerId();
|
| - return QuicServerId(
|
| - HostPortPair::FromURL(url), url.scheme() == "https",
|
| - url.path() == "/private" ? PRIVACY_MODE_ENABLED : PRIVACY_MODE_DISABLED);
|
| + return QuicServerId(HostPortPair::FromURL(url), url.path() == "/private"
|
| + ? PRIVACY_MODE_ENABLED
|
| + : PRIVACY_MODE_DISABLED);
|
| }
|
|
|
| string QuicServerId::ToString() const {
|
| - return (is_https_ ? "https://" : "http://") + host_port_pair_.ToString() +
|
| - (privacy_mode_ == PRIVACY_MODE_ENABLED ? "/private" : "");
|
| + return "https://" + host_port_pair_.ToString() +
|
| + (privacy_mode_ == PRIVACY_MODE_ENABLED ? "/private" : "");
|
| }
|
|
|
| } // namespace net
|
|
|