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

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

Issue 192583004: QUIC - use QuicSessionKey tuple (host, port, is_https) instead of server_hostname (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use QuicSessionKey as arg and delete server_hostname as arg 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
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 #ifndef NET_QUIC_QUIC_SESSION_KEY_H_ 5 #ifndef NET_QUIC_QUIC_SESSION_KEY_H_
6 #define NET_QUIC_QUIC_SESSION_KEY_H_ 6 #define NET_QUIC_QUIC_SESSION_KEY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "net/base/host_port_pair.h" 10 #include "net/base/host_port_pair.h"
11 #include "net/base/net_export.h" 11 #include "net/base/net_export.h"
12 12
13 namespace net { 13 namespace net {
14 14
15 // The key used to identify sessions. Includes the hostname, port, and scheme. 15 // The key used to identify sessions. Includes the hostname, port, and scheme.
16 class NET_EXPORT_PRIVATE QuicSessionKey { 16 class NET_EXPORT_PRIVATE QuicSessionKey {
17 public: 17 public:
18 QuicSessionKey(); 18 QuicSessionKey();
19 QuicSessionKey(const HostPortPair& host_port_pair, bool is_https); 19 QuicSessionKey(const HostPortPair& host_port_pair, bool is_https);
20 QuicSessionKey(const std::string& host, uint16 port, bool is_https);
20 ~QuicSessionKey(); 21 ~QuicSessionKey();
21 22
22 // Needed to be an element of std::set. 23 // Needed to be an element of std::set.
23 bool operator<(const QuicSessionKey &other) const; 24 bool operator<(const QuicSessionKey &other) const;
24 bool operator==(const QuicSessionKey &other) const; 25 bool operator==(const QuicSessionKey &other) const;
25 26
26 // ToString() will convert the QuicSessionKey to "scheme:hostname:port". 27 // ToString() will convert the QuicSessionKey to "scheme:hostname:port".
27 // "scheme" would either be "http" or "https" based on |is_https|. 28 // "scheme" would either be "http" or "https" based on |is_https|.
28 std::string ToString() const; 29 std::string ToString() const;
29 30
30 const HostPortPair& host_port_pair() const { 31 const HostPortPair& host_port_pair() const {
31 return host_port_pair_; 32 return host_port_pair_;
32 } 33 }
33 34
34 bool is_https() const { return is_https_; } 35 bool is_https() const { return is_https_; }
35 36
36 private: 37 private:
37 HostPortPair host_port_pair_; 38 HostPortPair host_port_pair_;
38 bool is_https_; 39 bool is_https_;
39 }; 40 };
40 41
41 } // namespace net 42 } // namespace net
42 43
43 #endif // NET_QUIC_QUIC_SESSION_KEY_H_ 44 #endif // NET_QUIC_QUIC_SESSION_KEY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698