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

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

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc Created 4 years, 4 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
« no previous file with comments | « net/quic/quic_sent_packet_manager_test.cc ('k') | net/quic/quic_server_id.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_QUIC_QUIC_SERVER_ID_H_
6 #define NET_QUIC_QUIC_SERVER_ID_H_
7
8 #include <stdint.h>
9
10 #include <string>
11
12 #include "net/base/host_port_pair.h"
13 #include "net/base/net_export.h"
14 #include "net/base/privacy_mode.h"
15
16 namespace net {
17
18 // The id used to identify sessions. Includes the hostname, port, scheme and
19 // privacy_mode.
20 class NET_EXPORT_PRIVATE QuicServerId {
21 public:
22 QuicServerId();
23 QuicServerId(const HostPortPair& host_port_pair, PrivacyMode privacy_mode);
24 QuicServerId(const std::string& host, uint16_t port);
25 QuicServerId(const std::string& host,
26 uint16_t port,
27 PrivacyMode privacy_mode);
28 ~QuicServerId();
29
30 // Needed to be an element of std::set.
31 bool operator<(const QuicServerId& other) const;
32 bool operator==(const QuicServerId& other) const;
33
34 // Creates a QuicServerId from a string formatted in same manner as
35 // ToString().
36 static QuicServerId FromString(const std::string& str);
37
38 // ToString() will convert the QuicServerId to "scheme:hostname:port" or
39 // "scheme:hostname:port/private". "scheme" will be "https".
40 std::string ToString() const;
41
42 // Used in Chromium, but not in the server.
43 const HostPortPair& host_port_pair() const { return host_port_pair_; }
44
45 const std::string& host() const { return host_port_pair_.host(); }
46
47 uint16_t port() const { return host_port_pair_.port(); }
48
49 PrivacyMode privacy_mode() const { return privacy_mode_; }
50
51 private:
52 HostPortPair host_port_pair_;
53 PrivacyMode privacy_mode_;
54 };
55
56 } // namespace net
57
58 #endif // NET_QUIC_QUIC_SERVER_ID_H_
OLDNEW
« no previous file with comments | « net/quic/quic_sent_packet_manager_test.cc ('k') | net/quic/quic_server_id.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698