OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef NET_SPDY_SPDY_SESSION_KEY_H_ | |
6 #define NET_SPDY_SPDY_SESSION_KEY_H_ | |
7 | |
8 #include "net/base/net_export.h" | |
9 #include "net/base/privacy_mode.h" | |
10 #include "net/proxy/proxy_server.h" | |
11 | |
12 namespace net { | |
13 | |
14 // SpdySessionKey is used as unique index for SpdySessionPool. | |
15 class NET_EXPORT_PRIVATE SpdySessionKey { | |
16 public: | |
17 SpdySessionKey(); | |
18 SpdySessionKey(const HostPortPair& host_port_pair, | |
19 const ProxyServer& proxy_server, | |
20 PrivacyMode privacy_mode); | |
21 | |
22 // Temporary hack for implicit copy constructor | |
23 SpdySessionKey(const HostPortProxyPair& host_port_proxy_pair, | |
24 PrivacyMode privacy_mode); | |
25 | |
26 SpdySessionKey(const SpdySessionKey& other); | |
27 | |
28 ~SpdySessionKey(); | |
29 | |
30 // Comparator function so this can be placed in a std::map. | |
31 bool operator<(const SpdySessionKey& other) const; | |
32 | |
33 // Equality test of contents. (Probably another violation of style guide). | |
34 bool Equals(const SpdySessionKey& other) const; | |
35 | |
36 const HostPortProxyPair& host_port_proxy_pair() const { | |
37 return host_port_proxy_pair_; | |
38 } | |
39 | |
40 const HostPortPair& host_port_pair() const { | |
41 return host_port_proxy_pair_.first; | |
42 } | |
43 | |
44 const ProxyServer& proxy_server() const { | |
45 return host_port_proxy_pair_.second; | |
46 } | |
47 | |
48 PrivacyMode privacy_mode() const { | |
49 return privacy_mode_; | |
50 } | |
51 | |
52 // Returns the estimate of dynamically allocated memory in bytes. | |
53 size_t EstimateMemoryUsage() const; | |
54 | |
55 private: | |
56 HostPortProxyPair host_port_proxy_pair_; | |
57 // If enabled, then session cannot be tracked by the server. | |
58 PrivacyMode privacy_mode_; | |
59 }; | |
60 | |
61 } // namespace net | |
62 | |
63 #endif // NET_SPDY_SPDY_SESSION_KEY_H_ | |
OLD | NEW |