| 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 #include "net/tools/quic/test_tools/quic_test_client.h" | 5 #include "net/tools/quic/test_tools/quic_test_client.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "net/base/completion_callback.h" | 8 #include "net/base/completion_callback.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "net/cert/cert_verify_result.h" | 10 #include "net/cert/cert_verify_result.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 secure_)); | 258 secure_)); |
| 259 ssize_t ret = GetOrCreateStream()->SendRequest( | 259 ssize_t ret = GetOrCreateStream()->SendRequest( |
| 260 munged_headers.get() ? *munged_headers.get() : *message.headers(), | 260 munged_headers.get() ? *munged_headers.get() : *message.headers(), |
| 261 message.body(), | 261 message.body(), |
| 262 message.has_complete_message()); | 262 message.has_complete_message()); |
| 263 WaitForWriteToFlush(); | 263 WaitForWriteToFlush(); |
| 264 return ret; | 264 return ret; |
| 265 } | 265 } |
| 266 | 266 |
| 267 ssize_t QuicTestClient::SendData(string data, bool last_data) { | 267 ssize_t QuicTestClient::SendData(string data, bool last_data) { |
| 268 return SendData(data, last_data, nullptr); |
| 269 } |
| 270 |
| 271 ssize_t QuicTestClient::SendData(string data, |
| 272 bool last_data, |
| 273 QuicAckNotifier::DelegateInterface* delegate) { |
| 268 QuicSpdyClientStream* stream = GetOrCreateStream(); | 274 QuicSpdyClientStream* stream = GetOrCreateStream(); |
| 269 if (!stream) { return 0; } | 275 if (!stream) { return 0; } |
| 270 GetOrCreateStream()->SendBody(data, last_data); | 276 GetOrCreateStream()->SendBody(data, last_data, delegate); |
| 271 WaitForWriteToFlush(); | 277 WaitForWriteToFlush(); |
| 272 return data.length(); | 278 return data.length(); |
| 273 } | 279 } |
| 274 | 280 |
| 275 bool QuicTestClient::response_complete() const { | 281 bool QuicTestClient::response_complete() const { |
| 276 return response_complete_; | 282 return response_complete_; |
| 277 } | 283 } |
| 278 | 284 |
| 279 int QuicTestClient::response_header_size() const { | 285 int QuicTestClient::response_header_size() const { |
| 280 return response_header_size_; | 286 return response_header_size_; |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 // Set policy for headers and crypto streams. | 557 // Set policy for headers and crypto streams. |
| 552 ReliableQuicStreamPeer::SetFecPolicy( | 558 ReliableQuicStreamPeer::SetFecPolicy( |
| 553 QuicSessionPeer::GetHeadersStream(client()->session()), fec_policy); | 559 QuicSessionPeer::GetHeadersStream(client()->session()), fec_policy); |
| 554 ReliableQuicStreamPeer::SetFecPolicy(client()->session()->GetCryptoStream(), | 560 ReliableQuicStreamPeer::SetFecPolicy(client()->session()->GetCryptoStream(), |
| 555 fec_policy); | 561 fec_policy); |
| 556 } | 562 } |
| 557 | 563 |
| 558 } // namespace test | 564 } // namespace test |
| 559 } // namespace tools | 565 } // namespace tools |
| 560 } // namespace net | 566 } // namespace net |
| OLD | NEW |