OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/core/quic_server_id.h" | 5 #include "net/quic/core/quic_server_id.h" |
6 | 6 |
7 #include <tuple> | 7 #include <tuple> |
8 | 8 |
| 9 #include "net/quic/platform/api/quic_estimate_memory_usage.h" |
9 #include "net/quic/platform/api/quic_str_cat.h" | 10 #include "net/quic/platform/api/quic_str_cat.h" |
10 | 11 |
11 using std::string; | 12 using std::string; |
12 | 13 |
13 namespace net { | 14 namespace net { |
14 | 15 |
15 QuicServerId::QuicServerId() : privacy_mode_(PRIVACY_MODE_DISABLED) {} | 16 QuicServerId::QuicServerId() : privacy_mode_(PRIVACY_MODE_DISABLED) {} |
16 | 17 |
17 QuicServerId::QuicServerId(const HostPortPair& host_port_pair, | 18 QuicServerId::QuicServerId(const HostPortPair& host_port_pair, |
18 PrivacyMode privacy_mode) | 19 PrivacyMode privacy_mode) |
(...skipping 17 matching lines...) Expand all Loading... |
36 bool QuicServerId::operator==(const QuicServerId& other) const { | 37 bool QuicServerId::operator==(const QuicServerId& other) const { |
37 return privacy_mode_ == other.privacy_mode_ && | 38 return privacy_mode_ == other.privacy_mode_ && |
38 host_port_pair_.Equals(other.host_port_pair_); | 39 host_port_pair_.Equals(other.host_port_pair_); |
39 } | 40 } |
40 | 41 |
41 string QuicServerId::ToString() const { | 42 string QuicServerId::ToString() const { |
42 return QuicStrCat("https://", host_port_pair_.ToString(), | 43 return QuicStrCat("https://", host_port_pair_.ToString(), |
43 (privacy_mode_ == PRIVACY_MODE_ENABLED ? "/private" : "")); | 44 (privacy_mode_ == PRIVACY_MODE_ENABLED ? "/private" : "")); |
44 } | 45 } |
45 | 46 |
| 47 size_t QuicServerId::EstimateMemoryUsage() const { |
| 48 return QuicEstimateMemoryUsage(host_port_pair_); |
| 49 } |
| 50 |
46 } // namespace net | 51 } // namespace net |
OLD | NEW |