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

Side by Side Diff: net/quic/quic_session_key.cc

Issue 185773006: Add PrivacyMode support to the QuicStreamFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_session_key.h ('k') | net/quic/quic_session_key_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/quic_session_key.h" 5 #include "net/quic/quic_session_key.h"
6 6
7 using std::string; 7 using std::string;
8 8
9 namespace net { 9 namespace net {
10 10
11 QuicSessionKey::QuicSessionKey() {} 11 QuicSessionKey::QuicSessionKey() {}
12 12
13 QuicSessionKey::QuicSessionKey(const HostPortPair& host_port_pair, 13 QuicSessionKey::QuicSessionKey(const HostPortPair& host_port_pair,
14 bool is_https) 14 bool is_https,
15 PrivacyMode privacy_mode)
15 : host_port_pair_(host_port_pair), 16 : host_port_pair_(host_port_pair),
16 is_https_(is_https) {} 17 is_https_(is_https),
18 privacy_mode_(privacy_mode) {}
17 19
18 QuicSessionKey::QuicSessionKey(const string& host, 20 QuicSessionKey::QuicSessionKey(const string& host,
19 uint16 port, 21 uint16 port,
20 bool is_https) 22 bool is_https,
23 PrivacyMode privacy_mode)
21 : host_port_pair_(host, port), 24 : host_port_pair_(host, port),
22 is_https_(is_https) {} 25 is_https_(is_https),
26 privacy_mode_(privacy_mode) {}
23 27
24 QuicSessionKey::~QuicSessionKey() {} 28 QuicSessionKey::~QuicSessionKey() {}
25 29
26 bool QuicSessionKey::operator<(const QuicSessionKey& other) const { 30 bool QuicSessionKey::operator<(const QuicSessionKey& other) const {
27 if (!host_port_pair_.Equals(other.host_port_pair_)) { 31 if (!host_port_pair_.Equals(other.host_port_pair_)) {
28 return host_port_pair_ < other.host_port_pair_; 32 return host_port_pair_ < other.host_port_pair_;
29 } 33 }
30 return is_https_ < other.is_https_; 34 if (is_https_ != other.is_https_) {
35 return is_https_ < other.is_https_;
36 }
37 return privacy_mode_ < other.privacy_mode_;
31 } 38 }
32 39
33 bool QuicSessionKey::operator==(const QuicSessionKey& other) const { 40 bool QuicSessionKey::operator==(const QuicSessionKey& other) const {
34 return is_https_ == other.is_https_ && 41 return is_https_ == other.is_https_ &&
42 privacy_mode_ == other.privacy_mode_ &&
35 host_port_pair_.Equals(other.host_port_pair_); 43 host_port_pair_.Equals(other.host_port_pair_);
36 } 44 }
37 45
38 string QuicSessionKey::ToString() const { 46 string QuicSessionKey::ToString() const {
39 return (is_https_ ? "https://" : "http://") + host_port_pair_.ToString(); 47 return (is_https_ ? "https://" : "http://") + host_port_pair_.ToString() +
48 (privacy_mode_ == kPrivacyModeEnabled ? "/private" : "");
40 } 49 }
41 50
42 } // namespace net 51 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_session_key.h ('k') | net/quic/quic_session_key_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698