| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 toy client, which connects to a specified port and sends QUIC | 5 // A toy client, which connects to a specified port and sends QUIC |
| 6 // request to that endpoint. | 6 // request to that endpoint. |
| 7 | 7 |
| 8 #ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_ | 8 #ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_ |
| 9 #define NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_ | 9 #define NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_ |
| 10 | 10 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 177 } |
| 178 | 178 |
| 179 QuicConfig* config() { return &config_; } | 179 QuicConfig* config() { return &config_; } |
| 180 | 180 |
| 181 void set_store_response(bool val) { store_response_ = val; } | 181 void set_store_response(bool val) { store_response_ = val; } |
| 182 | 182 |
| 183 size_t latest_response_code() const; | 183 size_t latest_response_code() const; |
| 184 const std::string& latest_response_headers() const; | 184 const std::string& latest_response_headers() const; |
| 185 const std::string& latest_response_body() const; | 185 const std::string& latest_response_body() const; |
| 186 | 186 |
| 187 // Change the initial maximum packet size of the connection. Has to be called |
| 188 // before Connect()/StartConnect() in order to have any effect. |
| 189 void set_initial_max_packet_length(QuicByteCount initial_max_packet_length) { |
| 190 initial_max_packet_length_ = initial_max_packet_length; |
| 191 } |
| 192 |
| 187 protected: | 193 protected: |
| 188 virtual QuicConnectionId GenerateConnectionId(); | 194 virtual QuicConnectionId GenerateConnectionId(); |
| 189 virtual QuicConnectionHelper* CreateQuicConnectionHelper(); | 195 virtual QuicConnectionHelper* CreateQuicConnectionHelper(); |
| 190 virtual QuicPacketWriter* CreateQuicPacketWriter(); | 196 virtual QuicPacketWriter* CreateQuicPacketWriter(); |
| 191 | 197 |
| 192 virtual QuicClientSession* CreateQuicClientSession( | 198 virtual QuicClientSession* CreateQuicClientSession( |
| 193 const QuicConfig& config, | 199 const QuicConfig& config, |
| 194 QuicConnection* connection, | 200 QuicConnection* connection, |
| 195 const QuicServerId& server_id, | 201 const QuicServerId& server_id, |
| 196 QuicCryptoClientConfig* crypto_config); | 202 QuicCryptoClientConfig* crypto_config); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 | 284 |
| 279 // If true, store the latest response code, headers, and body. | 285 // If true, store the latest response code, headers, and body. |
| 280 bool store_response_; | 286 bool store_response_; |
| 281 // HTTP response code from most recent response. | 287 // HTTP response code from most recent response. |
| 282 size_t latest_response_code_; | 288 size_t latest_response_code_; |
| 283 // HTTP headers from most recent response. | 289 // HTTP headers from most recent response. |
| 284 std::string latest_response_headers_; | 290 std::string latest_response_headers_; |
| 285 // Body of most recent response. | 291 // Body of most recent response. |
| 286 std::string latest_response_body_; | 292 std::string latest_response_body_; |
| 287 | 293 |
| 294 // The initial value of maximum packet size of the connection. If set to |
| 295 // zero, the default is used. |
| 296 QuicByteCount initial_max_packet_length_; |
| 297 |
| 288 // The log used for the sockets. | 298 // The log used for the sockets. |
| 289 NetLog net_log_; | 299 NetLog net_log_; |
| 290 | 300 |
| 291 scoped_ptr<QuicPacketReader> packet_reader_; | 301 scoped_ptr<QuicPacketReader> packet_reader_; |
| 292 | 302 |
| 293 base::WeakPtrFactory<QuicSimpleClient> weak_factory_; | 303 base::WeakPtrFactory<QuicSimpleClient> weak_factory_; |
| 294 | 304 |
| 295 DISALLOW_COPY_AND_ASSIGN(QuicSimpleClient); | 305 DISALLOW_COPY_AND_ASSIGN(QuicSimpleClient); |
| 296 }; | 306 }; |
| 297 | 307 |
| 298 } // namespace tools | 308 } // namespace tools |
| 299 } // namespace net | 309 } // namespace net |
| 300 | 310 |
| 301 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_ | 311 #endif // NET_TOOLS_QUIC_QUIC_SIMPLE_CLIENT_H_ |
| OLD | NEW |