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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 void SendRequestsAndWaitForResponse(const std::vector<std::string>& url_list); | 126 void SendRequestsAndWaitForResponse(const std::vector<std::string>& url_list); |
127 | 127 |
128 // Returns a newly created QuicSpdyClientStream, owned by the | 128 // Returns a newly created QuicSpdyClientStream, owned by the |
129 // QuicSimpleClient. | 129 // QuicSimpleClient. |
130 virtual QuicSpdyClientStream* CreateClientStream(); | 130 virtual QuicSpdyClientStream* CreateClientStream(); |
131 | 131 |
132 // Wait for events until the stream with the given ID is closed. | 132 // Wait for events until the stream with the given ID is closed. |
133 void WaitForStreamToClose(QuicStreamId id); | 133 void WaitForStreamToClose(QuicStreamId id); |
134 | 134 |
135 // Wait for events until the handshake is confirmed. | 135 // Wait for events until the handshake is confirmed. |
136 void WaitForCryptoHandshakeConfirmed(); | 136 // Returns true if the crypto handshake succeeds, false otherwise. |
| 137 bool WaitForCryptoHandshakeConfirmed() WARN_UNUSED_RESULT; |
137 | 138 |
138 // Wait up to 50ms, and handle any events which occur. | 139 // Wait up to 50ms, and handle any events which occur. |
139 // Returns true if there are any outstanding requests. | 140 // Returns true if there are any outstanding requests. |
140 bool WaitForEvents(); | 141 bool WaitForEvents(); |
141 | 142 |
142 // Migrate to a new socket during an active connection. | 143 // Migrate to a new socket during an active connection. |
143 bool MigrateSocket(const QuicIpAddress& new_host); | 144 bool MigrateSocket(const QuicIpAddress& new_host); |
144 | 145 |
145 QuicClientSession* session() { return session_.get(); } | 146 QuicClientSession* session() { return session_.get(); } |
146 | 147 |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 std::vector<std::unique_ptr<QuicDataToResend>> data_to_resend_on_connect_; | 477 std::vector<std::unique_ptr<QuicDataToResend>> data_to_resend_on_connect_; |
477 | 478 |
478 std::unique_ptr<ClientQuicDataToResend> push_promise_data_to_resend_; | 479 std::unique_ptr<ClientQuicDataToResend> push_promise_data_to_resend_; |
479 | 480 |
480 DISALLOW_COPY_AND_ASSIGN(QuicClientBase); | 481 DISALLOW_COPY_AND_ASSIGN(QuicClientBase); |
481 }; | 482 }; |
482 | 483 |
483 } // namespace net | 484 } // namespace net |
484 | 485 |
485 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_BASE_H_ | 486 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_BASE_H_ |
OLD | NEW |