• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_DEVICE_BOUND_SESSIONS_SESSION_KEY_H_
6 #define NET_DEVICE_BOUND_SESSIONS_SESSION_KEY_H_
7 
8 #include "base/types/strong_alias.h"
9 #include "net/base/schemeful_site.h"
10 
11 namespace net::device_bound_sessions {
12 
13 // Unique identifier for a `Session`.
14 struct NET_EXPORT SessionKey {
15   using Id = base::StrongAlias<class IdTag, std::string>;
16 
17   SessionKey();
18   SessionKey(SchemefulSite site, Id id);
19   ~SessionKey();
20 
21   SessionKey(const SessionKey&);
22   SessionKey& operator=(const SessionKey&);
23 
24   SessionKey(SessionKey&&);
25   SessionKey& operator=(SessionKey&&);
26 
27   SchemefulSite site;
28   Id id;
29 
30   bool operator==(const SessionKey& other) const;
31   bool operator<(const SessionKey& other) const;
32 };
33 
34 }  // namespace net::device_bound_sessions
35 
36 #endif  // NET_DEVICE_BOUND_SESSIONS_SESSION_KEY_H_
37