1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_SPDY_SPDY_SESSION_KEY_H_
6 #define NET_SPDY_SPDY_SESSION_KEY_H_
8 #include "net/base/privacy_mode.h"
9 #include "net/proxy/proxy_server.h"
13 // SpdySessionKey is used as unique index for SpdySessionPool.
14 class NET_EXPORT_PRIVATE SpdySessionKey
{
17 SpdySessionKey(const HostPortPair
& host_port_pair
,
18 const ProxyServer
& proxy_server
,
19 PrivacyMode privacy_mode
);
21 // Temporary hack for implicit copy constructor
22 SpdySessionKey(const HostPortProxyPair
& host_port_proxy_pair
,
23 PrivacyMode privacy_mode
);
27 // Comparator function so this can be placed in a std::map.
28 bool operator<(const SpdySessionKey
& other
) const;
30 // Equality test of contents. (Probably another violation of style guide).
31 bool Equals(const SpdySessionKey
& other
) const;
33 const HostPortProxyPair
& host_port_proxy_pair() const {
34 return host_port_proxy_pair_
;
37 const HostPortPair
& host_port_pair() const {
38 return host_port_proxy_pair_
.first
;
41 const ProxyServer
& proxy_server() const {
42 return host_port_proxy_pair_
.second
;
45 PrivacyMode
privacy_mode() const {
50 HostPortProxyPair host_port_proxy_pair_
;
51 // If enabled, then session cannot be tracked by the server.
52 PrivacyMode privacy_mode_
;
57 #endif // NET_SPDY_SPDY_SESSION_KEY_H_