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

Side by Side Diff: net/quic/crypto/source_address_token.h

Issue 497553004: Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase with TOT Created 6 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/crypto/quic_crypto_server_config_test.cc ('k') | net/quic/quic_connection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_ 5 #ifndef NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
6 #define NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_ 6 #define NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/strings/string_piece.h" 11 #include "base/strings/string_piece.h"
12 #include "net/base/net_export.h"
12 13
13 namespace net { 14 namespace net {
14 15
15 // TODO(rtenneti): sync with server more rationally. 16 // TODO(rtenneti): sync with server more rationally.
16 // CachedNetworkParameters contains data that can be used to choose appropriate 17 // CachedNetworkParameters contains data that can be used to choose appropriate
17 // connection parameters (initial RTT, initial CWND, etc.) in new connections. 18 // connection parameters (initial RTT, initial CWND, etc.) in new connections.
18 class CachedNetworkParameters { 19 class NET_EXPORT_PRIVATE CachedNetworkParameters {
19 public: 20 public:
20 // Describes the state of the connection during which the supplied network 21 // Describes the state of the connection during which the supplied network
21 // parameters were calculated. 22 // parameters were calculated.
22 enum PreviousConnectionState { 23 enum PreviousConnectionState {
23 SLOW_START = 0, 24 SLOW_START = 0,
24 CONGESTION_AVOIDANCE = 1, 25 CONGESTION_AVOIDANCE = 1,
25 }; 26 };
26 27
27 CachedNetworkParameters(); 28 CachedNetworkParameters();
28 ~CachedNetworkParameters(); 29 ~CachedNetworkParameters();
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // The min RTT seen on a previous connection can be used by the server to 92 // The min RTT seen on a previous connection can be used by the server to
92 // inform initial connection parameters for new connections. 93 // inform initial connection parameters for new connections.
93 int32 min_rtt_ms_; 94 int32 min_rtt_ms_;
94 // Encodes the PreviousConnectionState enum. 95 // Encodes the PreviousConnectionState enum.
95 int32 previous_connection_state_; 96 int32 previous_connection_state_;
96 }; 97 };
97 98
98 // TODO(rtenneti): sync with server more rationally. 99 // TODO(rtenneti): sync with server more rationally.
99 // A SourceAddressToken is serialised, encrypted and sent to clients so that 100 // A SourceAddressToken is serialised, encrypted and sent to clients so that
100 // they can prove ownership of an IP address. 101 // they can prove ownership of an IP address.
101 class SourceAddressToken { 102 class NET_EXPORT_PRIVATE SourceAddressToken {
102 public: 103 public:
103 SourceAddressToken(); 104 SourceAddressToken();
104 ~SourceAddressToken(); 105 ~SourceAddressToken();
105 106
106 std::string SerializeAsString() const; 107 std::string SerializeAsString() const;
107 108
108 bool ParseFromArray(const char* plaintext, size_t plaintext_length); 109 bool ParseFromArray(const char* plaintext, size_t plaintext_length);
109 110
110 std::string ip() const { 111 std::string ip() const {
111 return ip_; 112 return ip_;
(...skipping 28 matching lines...) Expand all
140 // The server can provide estimated network parameters to be used for 141 // The server can provide estimated network parameters to be used for
141 // initial parameter selection in future connections. 142 // initial parameter selection in future connections.
142 CachedNetworkParameters cached_network_parameters_; 143 CachedNetworkParameters cached_network_parameters_;
143 144
144 DISALLOW_COPY_AND_ASSIGN(SourceAddressToken); 145 DISALLOW_COPY_AND_ASSIGN(SourceAddressToken);
145 }; 146 };
146 147
147 } // namespace net 148 } // namespace net
148 149
149 #endif // NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_ 150 #endif // NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
OLDNEW
« no previous file with comments | « net/quic/crypto/quic_crypto_server_config_test.cc ('k') | net/quic/quic_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698