| 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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 } | 394 } |
| 395 | 395 |
| 396 size_t QuicTestClient::bytes_read() const { | 396 size_t QuicTestClient::bytes_read() const { |
| 397 return bytes_read_; | 397 return bytes_read_; |
| 398 } | 398 } |
| 399 | 399 |
| 400 size_t QuicTestClient::bytes_written() const { | 400 size_t QuicTestClient::bytes_written() const { |
| 401 return bytes_written_; | 401 return bytes_written_; |
| 402 } | 402 } |
| 403 | 403 |
| 404 void QuicTestClient::OnClose(ReliableQuicStream* stream) { | 404 void QuicTestClient::OnClose(QuicDataStream* stream) { |
| 405 if (stream_ != stream) { | 405 if (stream_ != stream) { |
| 406 return; | 406 return; |
| 407 } | 407 } |
| 408 if (buffer_body()) { | 408 if (buffer_body()) { |
| 409 // TODO(fnk): The stream still buffers the whole thing. Fix that. | 409 // TODO(fnk): The stream still buffers the whole thing. Fix that. |
| 410 response_ = stream_->data(); | 410 response_ = stream_->data(); |
| 411 } | 411 } |
| 412 response_complete_ = true; | 412 response_complete_ = true; |
| 413 response_headers_complete_ = stream_->headers_decompressed(); | 413 response_headers_complete_ = stream_->headers_decompressed(); |
| 414 headers_.CopyFrom(stream_->headers()); | 414 headers_.CopyFrom(stream_->headers()); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 431 | 431 |
| 432 void QuicTestClient::WaitForWriteToFlush() { | 432 void QuicTestClient::WaitForWriteToFlush() { |
| 433 while (connected() && client()->session()->HasQueuedData()) { | 433 while (connected() && client()->session()->HasQueuedData()) { |
| 434 client_->WaitForEvents(); | 434 client_->WaitForEvents(); |
| 435 } | 435 } |
| 436 } | 436 } |
| 437 | 437 |
| 438 } // namespace test | 438 } // namespace test |
| 439 } // namespace tools | 439 } // namespace tools |
| 440 } // namespace net | 440 } // namespace net |
| OLD | NEW |