| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 // A base class for the toy client, which connects to a specified port and sends | 5 // A base class for the toy client, which connects to a specified port and sends |
| 6 // QUIC request to that endpoint. | 6 // QUIC request to that endpoint. |
| 7 | 7 |
| 8 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_BASE_H_ | 8 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_BASE_H_ |
| 9 #define NET_TOOLS_QUIC_QUIC_CLIENT_BASE_H_ | 9 #define NET_TOOLS_QUIC_QUIC_CLIENT_BASE_H_ |
| 10 | 10 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // Returns the next server-designated ConnectionId from the cached config for | 163 // Returns the next server-designated ConnectionId from the cached config for |
| 164 // |server_id_|, if it exists. Otherwise, returns 0. | 164 // |server_id_|, if it exists. Otherwise, returns 0. |
| 165 QuicConnectionId GetNextServerDesignatedConnectionId(); | 165 QuicConnectionId GetNextServerDesignatedConnectionId(); |
| 166 | 166 |
| 167 // Generates a new, random connection ID (as opposed to a server-designated | 167 // Generates a new, random connection ID (as opposed to a server-designated |
| 168 // connection ID). | 168 // connection ID). |
| 169 virtual QuicConnectionId GenerateNewConnectionId(); | 169 virtual QuicConnectionId GenerateNewConnectionId(); |
| 170 | 170 |
| 171 QuicConnectionHelperInterface* helper() { return helper_.get(); } | 171 QuicConnectionHelperInterface* helper() { return helper_.get(); } |
| 172 | 172 |
| 173 void set_num_sent_client_hellos(int num_sent_client_hellos) { |
| 174 num_sent_client_hellos_ = num_sent_client_hellos; |
| 175 } |
| 176 |
| 177 void set_num_stateless_rejects_received(int num_stateless_rejects_received) { |
| 178 num_stateless_rejects_received_ = num_stateless_rejects_received; |
| 179 } |
| 180 |
| 173 private: | 181 private: |
| 174 // |server_id_| is a tuple (hostname, port, is_https) of the server. | 182 // |server_id_| is a tuple (hostname, port, is_https) of the server. |
| 175 QuicServerId server_id_; | 183 QuicServerId server_id_; |
| 176 | 184 |
| 177 // config_ and crypto_config_ contain configuration and cached state about | 185 // config_ and crypto_config_ contain configuration and cached state about |
| 178 // servers. | 186 // servers. |
| 179 QuicConfig config_; | 187 QuicConfig config_; |
| 180 QuicCryptoClientConfig crypto_config_; | 188 QuicCryptoClientConfig crypto_config_; |
| 181 | 189 |
| 182 // Helper to be used by created connections. Needs to outlive |session_|. | 190 // Helper to be used by created connections. Needs to outlive |session_|. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 bool connected_or_attempting_connect_; | 230 bool connected_or_attempting_connect_; |
| 223 | 231 |
| 224 QuicClientPushPromiseIndex push_promise_index_; | 232 QuicClientPushPromiseIndex push_promise_index_; |
| 225 | 233 |
| 226 DISALLOW_COPY_AND_ASSIGN(QuicClientBase); | 234 DISALLOW_COPY_AND_ASSIGN(QuicClientBase); |
| 227 }; | 235 }; |
| 228 | 236 |
| 229 } // namespace net | 237 } // namespace net |
| 230 | 238 |
| 231 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_BASE_H_ | 239 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_BASE_H_ |
| OLD | NEW |