1 // Copyright 2024 The Chromium Authors 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_BASE_SESSION_USAGE_H_ 6 #define NET_BASE_SESSION_USAGE_H_ 7 8 namespace net { 9 10 // This type distinguishes sessions carrying traffic through the destination 11 // host from sessions carrying traffic directly to the host. Credentials such 12 // as cookies are attached to `kDestination` sessions, but not to `kProxy` 13 // sessions. This type is used in QUIC and SPDY session keys, together with a 14 // proxy chain and host-port pair, to prevent pooling such sessions together. 15 // 16 // Examples: 17 // 18 // A session with no proxies at all will have a direct proxy chain and 19 // `session_usage = kDestination`. 20 // 21 // A session to "dest" carried over one or more proxies will have those 22 // proxies in its proxy chain, "dest" in its host-port pair, and `session_usage 23 // = kDestination`. 24 // 25 // A session over "proxyA" to "proxyB" which is carrying tunneled traffic to 26 // "dest" will have "proxyA" in its proxy chain, "proxyB in 27 // its host-port pair, and `session_usage = kProxy`. 28 enum class SessionUsage { 29 // This session is used for a connection to the destination host. 30 kDestination, 31 // This session is used to proxy traffic to other destinations. 32 kProxy, 33 }; 34 35 } // namespace net 36 37 #endif // NET_BASE_SESSION_USAGE_H_ 38