| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/quic/quartc/quartc_stream.h" | 5 #include "net/quic/quartc/quartc_stream.h" |
| 6 | 6 |
| 7 #include "base/threading/thread_task_runner_handle.h" | 7 #include "base/threading/thread_task_runner_handle.h" |
| 8 #include "net/quic/core/crypto/quic_random.h" | 8 #include "net/quic/core/crypto/quic_random.h" |
| 9 #include "net/quic/core/quic_session.h" | 9 #include "net/quic/core/quic_session.h" |
| 10 #include "net/quic/core/quic_simple_buffer_allocator.h" | 10 #include "net/quic/core/quic_simple_buffer_allocator.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 : QuicSession(connection, nullptr /*visitor*/, config), | 31 : QuicSession(connection, nullptr /*visitor*/, config), |
| 32 write_buffer_(write_buffer) {} | 32 write_buffer_(write_buffer) {} |
| 33 | 33 |
| 34 // Writes outgoing data from QuicStream to a string. | 34 // Writes outgoing data from QuicStream to a string. |
| 35 QuicConsumedData WritevData( | 35 QuicConsumedData WritevData( |
| 36 QuicStream* stream, | 36 QuicStream* stream, |
| 37 QuicStreamId id, | 37 QuicStreamId id, |
| 38 QuicIOVector iovector, | 38 QuicIOVector iovector, |
| 39 QuicStreamOffset offset, | 39 QuicStreamOffset offset, |
| 40 bool fin, | 40 bool fin, |
| 41 QuicAckListenerInterface* ack_notifier_delegate) override { | 41 const scoped_refptr<QuicAckListenerInterface>& /*ack_notifier_delegate*/) |
| 42 override { |
| 42 if (!writable_) { | 43 if (!writable_) { |
| 43 return QuicConsumedData(0, false); | 44 return QuicConsumedData(0, false); |
| 44 } | 45 } |
| 45 | 46 |
| 46 const char* data = reinterpret_cast<const char*>(iovector.iov->iov_base); | 47 const char* data = reinterpret_cast<const char*>(iovector.iov->iov_base); |
| 47 size_t len = iovector.total_length; | 48 size_t len = iovector.total_length; |
| 48 write_buffer_->append(data, len); | 49 write_buffer_->append(data, len); |
| 49 return QuicConsumedData(len, fin); | 50 return QuicConsumedData(len, fin); |
| 50 } | 51 } |
| 51 | 52 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 TEST_F(QuartcStreamTest, CloseStream) { | 256 TEST_F(QuartcStreamTest, CloseStream) { |
| 256 CreateReliableQuicStream(); | 257 CreateReliableQuicStream(); |
| 257 EXPECT_FALSE(mock_stream_delegate_->closed()); | 258 EXPECT_FALSE(mock_stream_delegate_->closed()); |
| 258 stream_->OnClose(); | 259 stream_->OnClose(); |
| 259 EXPECT_TRUE(mock_stream_delegate_->closed()); | 260 EXPECT_TRUE(mock_stream_delegate_->closed()); |
| 260 } | 261 } |
| 261 | 262 |
| 262 } // namespace | 263 } // namespace |
| 263 } // namespace test | 264 } // namespace test |
| 264 } // namespace net | 265 } // namespace net |
| OLD | NEW |