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

Side by Side Diff: net/quic/quic_socket_address_coder.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_simple_buffer_allocator_test.cc ('k') | net/quic/quic_socket_address_coder.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_SOCKET_ADDRESS_CODER_H_
6 #define NET_QUIC_QUIC_SOCKET_ADDRESS_CODER_H_
7
8 #include <stddef.h>
9 #include <stdint.h>
10
11 #include <string>
12
13 #include "base/macros.h"
14 #include "net/base/ip_endpoint.h"
15 #include "net/base/net_export.h"
16
17 namespace net {
18
19 class IPAddress;
20
21 // Serializes and parses a socket address (IP address and port), to be used in
22 // the kCADR tag in the ServerHello handshake message and the Public Reset
23 // packet.
24 class NET_EXPORT_PRIVATE QuicSocketAddressCoder {
25 public:
26 QuicSocketAddressCoder();
27 explicit QuicSocketAddressCoder(const IPEndPoint& address);
28 ~QuicSocketAddressCoder();
29
30 std::string Encode() const;
31
32 bool Decode(const char* data, size_t length);
33
34 const IPAddress& ip() const { return address_.address(); }
35
36 uint16_t port() const { return address_.port(); }
37
38 private:
39 IPEndPoint address_;
40
41 DISALLOW_COPY_AND_ASSIGN(QuicSocketAddressCoder);
42 };
43
44 } // namespace net
45
46 #endif // NET_QUIC_QUIC_SOCKET_ADDRESS_CODER_H_
OLDNEW
« no previous file with comments | « net/quic/quic_simple_buffer_allocator_test.cc ('k') | net/quic/quic_socket_address_coder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698