| 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 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ | 5 #ifndef NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ |
| 6 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ | 6 #define NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 10 |
| 8 #include <string> | 11 #include <string> |
| 9 | 12 |
| 10 #include "base/basictypes.h" | 13 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 12 #include "net/base/ip_endpoint.h" | 15 #include "net/base/ip_endpoint.h" |
| 13 #include "net/quic/proto/cached_network_parameters.pb.h" | 16 #include "net/quic/proto/cached_network_parameters.pb.h" |
| 14 #include "net/quic/quic_framer.h" | 17 #include "net/quic/quic_framer.h" |
| 15 #include "net/quic/quic_packet_creator.h" | 18 #include "net/quic/quic_packet_creator.h" |
| 16 #include "net/quic/quic_protocol.h" | 19 #include "net/quic/quic_protocol.h" |
| 17 #include "net/tools/balsa/balsa_frame.h" | 20 #include "net/tools/balsa/balsa_frame.h" |
| 18 #include "net/tools/epoll_server/epoll_server.h" | 21 #include "net/tools/epoll_server/epoll_server.h" |
| 19 #include "net/tools/quic/quic_client.h" | 22 #include "net/tools/quic/quic_client.h" |
| 20 #include "net/tools/quic/test_tools/simple_client.h" | 23 #include "net/tools/quic/test_tools/simple_client.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 void ResetConnection() override; | 106 void ResetConnection() override; |
| 104 void Disconnect() override; | 107 void Disconnect() override; |
| 105 IPEndPoint local_address() const override; | 108 IPEndPoint local_address() const override; |
| 106 void ClearPerRequestState() override; | 109 void ClearPerRequestState() override; |
| 107 void WaitForResponseForMs(int timeout_ms) override; | 110 void WaitForResponseForMs(int timeout_ms) override; |
| 108 void WaitForInitialResponseForMs(int timeout_ms) override; | 111 void WaitForInitialResponseForMs(int timeout_ms) override; |
| 109 ssize_t Send(const void* buffer, size_t size) override; | 112 ssize_t Send(const void* buffer, size_t size) override; |
| 110 bool response_complete() const override; | 113 bool response_complete() const override; |
| 111 bool response_headers_complete() const override; | 114 bool response_headers_complete() const override; |
| 112 const BalsaHeaders* response_headers() const override; | 115 const BalsaHeaders* response_headers() const override; |
| 113 int64 response_size() const override; | 116 int64_t response_size() const override; |
| 114 int response_header_size() const override; | 117 int response_header_size() const override; |
| 115 int64 response_body_size() const override; | 118 int64_t response_body_size() const override; |
| 116 size_t bytes_read() const override; | 119 size_t bytes_read() const override; |
| 117 size_t bytes_written() const override; | 120 size_t bytes_written() const override; |
| 118 bool buffer_body() const override; | 121 bool buffer_body() const override; |
| 119 void set_buffer_body(bool buffer_body) override; | 122 void set_buffer_body(bool buffer_body) override; |
| 120 bool ServerInLameDuckMode() const override; | 123 bool ServerInLameDuckMode() const override; |
| 121 const std::string& response_body() override; | 124 const std::string& response_body() override; |
| 122 bool connected() const override; | 125 bool connected() const override; |
| 123 // These functions are all unimplemented functions from SimpleClient, and log | 126 // These functions are all unimplemented functions from SimpleClient, and log |
| 124 // DFATAL if called by users of SimpleClient. | 127 // DFATAL if called by users of SimpleClient. |
| 125 ssize_t SendAndWaitForResponse(const void* buffer, size_t size) override; | 128 ssize_t SendAndWaitForResponse(const void* buffer, size_t size) override; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 231 |
| 229 bool response_complete_; | 232 bool response_complete_; |
| 230 bool response_headers_complete_; | 233 bool response_headers_complete_; |
| 231 mutable BalsaHeaders headers_; | 234 mutable BalsaHeaders headers_; |
| 232 | 235 |
| 233 // Parsed response trailers (if present), copied from the stream in OnClose. | 236 // Parsed response trailers (if present), copied from the stream in OnClose. |
| 234 SpdyHeaderBlock response_trailers_; | 237 SpdyHeaderBlock response_trailers_; |
| 235 | 238 |
| 236 SpdyPriority priority_; | 239 SpdyPriority priority_; |
| 237 std::string response_; | 240 std::string response_; |
| 238 uint64 bytes_read_; | 241 uint64_t bytes_read_; |
| 239 uint64 bytes_written_; | 242 uint64_t bytes_written_; |
| 240 // The number of uncompressed HTTP header bytes received. | 243 // The number of uncompressed HTTP header bytes received. |
| 241 int response_header_size_; | 244 int response_header_size_; |
| 242 // The number of HTTP body bytes received. | 245 // The number of HTTP body bytes received. |
| 243 int64 response_body_size_; | 246 int64_t response_body_size_; |
| 244 // True if we tried to connect already since the last call to Disconnect(). | 247 // True if we tried to connect already since the last call to Disconnect(). |
| 245 bool connect_attempted_; | 248 bool connect_attempted_; |
| 246 // The client will auto-connect exactly once before sending data. If | 249 // The client will auto-connect exactly once before sending data. If |
| 247 // something causes a connection reset, it will not automatically reconnect | 250 // something causes a connection reset, it will not automatically reconnect |
| 248 // unless auto_reconnect_ is true. | 251 // unless auto_reconnect_ is true. |
| 249 bool auto_reconnect_; | 252 bool auto_reconnect_; |
| 250 // Should we buffer the response body? Defaults to true. | 253 // Should we buffer the response body? Defaults to true. |
| 251 bool buffer_body_; | 254 bool buffer_body_; |
| 252 // FEC policy for data sent by this client. | 255 // FEC policy for data sent by this client. |
| 253 FecPolicy fec_policy_; | 256 FecPolicy fec_policy_; |
| 254 // When true allows the sending of a request to continue while the response is | 257 // When true allows the sending of a request to continue while the response is |
| 255 // arriving. | 258 // arriving. |
| 256 bool allow_bidirectional_data_; | 259 bool allow_bidirectional_data_; |
| 257 | 260 |
| 258 DISALLOW_COPY_AND_ASSIGN(QuicTestClient); | 261 DISALLOW_COPY_AND_ASSIGN(QuicTestClient); |
| 259 }; | 262 }; |
| 260 | 263 |
| 261 } // namespace test | 264 } // namespace test |
| 262 | 265 |
| 263 } // namespace tools | 266 } // namespace tools |
| 264 } // namespace net | 267 } // namespace net |
| 265 | 268 |
| 266 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ | 269 #endif // NET_TOOLS_QUIC_TEST_TOOLS_QUIC_TEST_CLIENT_H_ |
| OLD | NEW |