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

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

Issue 605733006: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert Patch Set 3 Created 6 years, 2 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/crypto_protocol.h ('k') | net/quic/quic_config.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"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 min_rtt_ms_ = min_rtt_ms; 67 min_rtt_ms_ = min_rtt_ms;
68 } 68 }
69 69
70 int32 previous_connection_state() const { 70 int32 previous_connection_state() const {
71 return previous_connection_state_; 71 return previous_connection_state_;
72 } 72 }
73 void set_previous_connection_state(int32 previous_connection_state) { 73 void set_previous_connection_state(int32 previous_connection_state) {
74 previous_connection_state_ = previous_connection_state; 74 previous_connection_state_ = previous_connection_state;
75 } 75 }
76 76
77 int64 timestamp() const { return timestamp_; }
78 void set_timestamp(int64 timestamp) { timestamp_ = timestamp; }
79
77 private: 80 private:
78 // serving_region_ is used to decide whether or not the bandwidth estimate and 81 // serving_region_ is used to decide whether or not the bandwidth estimate and
79 // min RTT are reasonable and if they should be used. 82 // min RTT are reasonable and if they should be used.
80 // For example a group of geographically close servers may share the same 83 // For example a group of geographically close servers may share the same
81 // serving_region_ string if they are expected to have similar network 84 // serving_region_ string if they are expected to have similar network
82 // performance. 85 // performance.
83 std::string serving_region_; 86 std::string serving_region_;
84 // The server can supply a bandwidth estimate (in bytes/s) which it may re-use 87 // The server can supply a bandwidth estimate (in bytes/s) which it may re-use
85 // on receipt of a source-address token with this field set. 88 // on receipt of a source-address token with this field set.
86 int32 bandwidth_estimate_bytes_per_second_; 89 int32 bandwidth_estimate_bytes_per_second_;
87 // The maximum bandwidth seen by the client, not necessarily the latest. 90 // The maximum bandwidth seen by the client, not necessarily the latest.
88 int32 max_bandwidth_estimate_bytes_per_second_; 91 int32 max_bandwidth_estimate_bytes_per_second_;
89 // Timestamp (seconds since UNIX epoch) that indicates when the max bandwidth 92 // Timestamp (seconds since UNIX epoch) that indicates when the max bandwidth
90 // was seen by the server. 93 // was seen by the server.
91 int64 max_bandwidth_timestamp_seconds_; 94 int64 max_bandwidth_timestamp_seconds_;
92 // The min RTT seen on a previous connection can be used by the server to 95 // The min RTT seen on a previous connection can be used by the server to
93 // inform initial connection parameters for new connections. 96 // inform initial connection parameters for new connections.
94 int32 min_rtt_ms_; 97 int32 min_rtt_ms_;
95 // Encodes the PreviousConnectionState enum. 98 // Encodes the PreviousConnectionState enum.
96 int32 previous_connection_state_; 99 int32 previous_connection_state_;
100 // UNIX timestamp when this bandwidth estimate was created.
101 int64 timestamp_;
97 }; 102 };
98 103
99 // TODO(rtenneti): sync with server more rationally. 104 // TODO(rtenneti): sync with server more rationally.
100 // A SourceAddressToken is serialised, encrypted and sent to clients so that 105 // A SourceAddressToken is serialised, encrypted and sent to clients so that
101 // they can prove ownership of an IP address. 106 // they can prove ownership of an IP address.
102 class NET_EXPORT_PRIVATE SourceAddressToken { 107 class NET_EXPORT_PRIVATE SourceAddressToken {
103 public: 108 public:
104 SourceAddressToken(); 109 SourceAddressToken();
105 ~SourceAddressToken(); 110 ~SourceAddressToken();
106 111
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // The server can provide estimated network parameters to be used for 146 // The server can provide estimated network parameters to be used for
142 // initial parameter selection in future connections. 147 // initial parameter selection in future connections.
143 CachedNetworkParameters cached_network_parameters_; 148 CachedNetworkParameters cached_network_parameters_;
144 149
145 DISALLOW_COPY_AND_ASSIGN(SourceAddressToken); 150 DISALLOW_COPY_AND_ASSIGN(SourceAddressToken);
146 }; 151 };
147 152
148 } // namespace net 153 } // namespace net
149 154
150 #endif // NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_ 155 #endif // NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
OLDNEW
« no previous file with comments | « net/quic/crypto/crypto_protocol.h ('k') | net/quic/quic_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698