| 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/quic/core/quic_connection.h" | 5 #include "net/quic/core/quic_connection.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 } | 378 } |
| 379 | 379 |
| 380 const vector<QuicConnectionCloseFrame>& connection_close_frames() const { | 380 const vector<QuicConnectionCloseFrame>& connection_close_frames() const { |
| 381 return framer_.connection_close_frames(); | 381 return framer_.connection_close_frames(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 const vector<QuicRstStreamFrame>& rst_stream_frames() const { | 384 const vector<QuicRstStreamFrame>& rst_stream_frames() const { |
| 385 return framer_.rst_stream_frames(); | 385 return framer_.rst_stream_frames(); |
| 386 } | 386 } |
| 387 | 387 |
| 388 const vector<QuicStreamFrame*>& stream_frames() const { | 388 const vector<std::unique_ptr<QuicStreamFrame>>& stream_frames() const { |
| 389 return framer_.stream_frames(); | 389 return framer_.stream_frames(); |
| 390 } | 390 } |
| 391 | 391 |
| 392 const vector<QuicPingFrame>& ping_frames() const { | 392 const vector<QuicPingFrame>& ping_frames() const { |
| 393 return framer_.ping_frames(); | 393 return framer_.ping_frames(); |
| 394 } | 394 } |
| 395 | 395 |
| 396 size_t last_packet_size() { return last_packet_size_; } | 396 size_t last_packet_size() { return last_packet_size_; } |
| 397 | 397 |
| 398 const QuicVersionNegotiationPacket* version_negotiation_packet() { | 398 const QuicVersionNegotiationPacket* version_negotiation_packet() { |
| (...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1898 iov[1].iov_len = 2; | 1898 iov[1].iov_len = 2; |
| 1899 connection_.SendStreamData(1, QuicIOVector(iov, 2, 4), 0, !kFin, nullptr); | 1899 connection_.SendStreamData(1, QuicIOVector(iov, 2, 4), 0, !kFin, nullptr); |
| 1900 | 1900 |
| 1901 EXPECT_EQ(0u, connection_.NumQueuedPackets()); | 1901 EXPECT_EQ(0u, connection_.NumQueuedPackets()); |
| 1902 EXPECT_FALSE(connection_.HasQueuedData()); | 1902 EXPECT_FALSE(connection_.HasQueuedData()); |
| 1903 | 1903 |
| 1904 // Parse the last packet and ensure multiple iovector blocks have | 1904 // Parse the last packet and ensure multiple iovector blocks have |
| 1905 // been packed into a single stream frame from one stream. | 1905 // been packed into a single stream frame from one stream. |
| 1906 EXPECT_EQ(1u, writer_->frame_count()); | 1906 EXPECT_EQ(1u, writer_->frame_count()); |
| 1907 EXPECT_EQ(1u, writer_->stream_frames().size()); | 1907 EXPECT_EQ(1u, writer_->stream_frames().size()); |
| 1908 QuicStreamFrame* frame = writer_->stream_frames()[0]; | 1908 QuicStreamFrame* frame = writer_->stream_frames()[0].get(); |
| 1909 EXPECT_EQ(1u, frame->stream_id); | 1909 EXPECT_EQ(1u, frame->stream_id); |
| 1910 EXPECT_EQ("ABCD", StringPiece(frame->data_buffer, frame->data_length)); | 1910 EXPECT_EQ("ABCD", StringPiece(frame->data_buffer, frame->data_length)); |
| 1911 } | 1911 } |
| 1912 | 1912 |
| 1913 TEST_P(QuicConnectionTest, FramePackingSendvQueued) { | 1913 TEST_P(QuicConnectionTest, FramePackingSendvQueued) { |
| 1914 // Try to send two stream frames in 1 packet by using writev. | 1914 // Try to send two stream frames in 1 packet by using writev. |
| 1915 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)); | 1915 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)); |
| 1916 | 1916 |
| 1917 BlockOnNextWrite(); | 1917 BlockOnNextWrite(); |
| 1918 char data[] = "ABCD"; | 1918 char data[] = "ABCD"; |
| (...skipping 3360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5279 connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr); | 5279 connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr); |
| 5280 EXPECT_EQ(1u, writer_->frame_count()); | 5280 EXPECT_EQ(1u, writer_->frame_count()); |
| 5281 EXPECT_FALSE(writer_->connection_close_frames().empty()); | 5281 EXPECT_FALSE(writer_->connection_close_frames().empty()); |
| 5282 // Ack frame is not bundled in connection close packet. | 5282 // Ack frame is not bundled in connection close packet. |
| 5283 EXPECT_TRUE(writer_->ack_frames().empty()); | 5283 EXPECT_TRUE(writer_->ack_frames().empty()); |
| 5284 } | 5284 } |
| 5285 | 5285 |
| 5286 } // namespace | 5286 } // namespace |
| 5287 } // namespace test | 5287 } // namespace test |
| 5288 } // namespace net | 5288 } // namespace net |
| OLD | NEW |