| 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_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ | 5 #ifndef NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ |
| 6 #define NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ | 6 #define NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 // cert_common_name returns the common name value of the server's certificate, | 101 // cert_common_name returns the common name value of the server's certificate, |
| 102 // or the empty string if no certificate was presented. | 102 // or the empty string if no certificate was presented. |
| 103 const string& cert_common_name() const; | 103 const string& cert_common_name() const; |
| 104 | 104 |
| 105 const string& response_body() {return response_;} | 105 const string& response_body() {return response_;} |
| 106 bool connected() const; | 106 bool connected() const; |
| 107 | 107 |
| 108 void set_auto_reconnect(bool reconnect) { auto_reconnect_ = reconnect; } | 108 void set_auto_reconnect(bool reconnect) { auto_reconnect_ = reconnect; } |
| 109 | 109 |
| 110 void set_priority(QuicPriority priority) { priority_ = priority; } |
| 111 |
| 110 private: | 112 private: |
| 111 void Initialize(IPEndPoint address, const string& hostname, bool secure); | 113 void Initialize(IPEndPoint address, const string& hostname, bool secure); |
| 112 | 114 |
| 113 IPEndPoint server_address_; | 115 IPEndPoint server_address_; |
| 114 IPEndPoint client_address_; | 116 IPEndPoint client_address_; |
| 115 scoped_ptr<QuicClient> client_; // The actual client | 117 scoped_ptr<QuicClient> client_; // The actual client |
| 116 QuicReliableClientStream* stream_; | 118 QuicReliableClientStream* stream_; |
| 117 | 119 |
| 118 QuicRstStreamErrorCode stream_error_; | 120 QuicRstStreamErrorCode stream_error_; |
| 119 | 121 |
| 120 BalsaHeaders headers_; | 122 BalsaHeaders headers_; |
| 123 QuicPriority priority_; |
| 124 |
| 121 string response_; | 125 string response_; |
| 122 uint64 bytes_read_; | 126 uint64 bytes_read_; |
| 123 uint64 bytes_written_; | 127 uint64 bytes_written_; |
| 124 // True if the client has never connected before. The client will | 128 // True if the client has never connected before. The client will |
| 125 // auto-connect exactly once before sending data. If something causes a | 129 // auto-connect exactly once before sending data. If something causes a |
| 126 // connection reset, it will not automatically reconnect. | 130 // connection reset, it will not automatically reconnect. |
| 127 bool never_connected_; | 131 bool never_connected_; |
| 128 bool secure_; | 132 bool secure_; |
| 129 // If true, the client will always reconnect if necessary before creating a | 133 // If true, the client will always reconnect if necessary before creating a |
| 130 // stream. | 134 // stream. |
| 131 bool auto_reconnect_; | 135 bool auto_reconnect_; |
| 132 | 136 |
| 133 // proof_verifier_ points to a RecordingProofVerifier that is owned by | 137 // proof_verifier_ points to a RecordingProofVerifier that is owned by |
| 134 // client_. | 138 // client_. |
| 135 ProofVerifier* proof_verifier_; | 139 ProofVerifier* proof_verifier_; |
| 136 }; | 140 }; |
| 137 | 141 |
| 138 } // namespace test | 142 } // namespace test |
| 139 | 143 |
| 140 } // namespace tools | 144 } // namespace tools |
| 141 } // namespace net | 145 } // namespace net |
| 142 | 146 |
| 143 #endif // NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ | 147 #endif // NET_QUIC_TEST_TOOLS_QUIC_CLIENT_H_ |
| OLD | NEW |