| 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/quic_connection.h" | 5 #include "net/quic/quic_connection.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 bool has_pending_frames) { | 453 bool has_pending_frames) { |
| 454 RetransmittableFrames* retransmittable_frames = | 454 RetransmittableFrames* retransmittable_frames = |
| 455 retransmittable == HAS_RETRANSMITTABLE_DATA | 455 retransmittable == HAS_RETRANSMITTABLE_DATA |
| 456 ? new RetransmittableFrames() | 456 ? new RetransmittableFrames() |
| 457 : nullptr; | 457 : nullptr; |
| 458 char buffer[kMaxPacketSize]; | 458 char buffer[kMaxPacketSize]; |
| 459 size_t encrypted_length = | 459 size_t encrypted_length = |
| 460 QuicConnectionPeer::GetFramer(this)->EncryptPayload( | 460 QuicConnectionPeer::GetFramer(this)->EncryptPayload( |
| 461 ENCRYPTION_NONE, packet_number, *packet, buffer, kMaxPacketSize); | 461 ENCRYPTION_NONE, packet_number, *packet, buffer, kMaxPacketSize); |
| 462 delete packet; | 462 delete packet; |
| 463 OnSerializedPacket(SerializedPacket( | 463 SerializedPacket serialized_packet( |
| 464 packet_number, PACKET_6BYTE_PACKET_NUMBER, buffer, encrypted_length, | 464 packet_number, PACKET_6BYTE_PACKET_NUMBER, buffer, encrypted_length, |
| 465 false, entropy_hash, retransmittable_frames, has_ack, | 465 false, entropy_hash, retransmittable_frames, has_ack, |
| 466 has_pending_frames, ENCRYPTION_NONE)); | 466 has_pending_frames, ENCRYPTION_NONE); |
| 467 OnSerializedPacket(&serialized_packet); |
| 467 } | 468 } |
| 468 | 469 |
| 469 QuicConsumedData SendStreamDataWithString( | 470 QuicConsumedData SendStreamDataWithString( |
| 470 QuicStreamId id, | 471 QuicStreamId id, |
| 471 StringPiece data, | 472 StringPiece data, |
| 472 QuicStreamOffset offset, | 473 QuicStreamOffset offset, |
| 473 bool fin, | 474 bool fin, |
| 474 QuicAckListenerInterface* listener) { | 475 QuicAckListenerInterface* listener) { |
| 475 return SendStreamDataWithStringHelper(id, data, offset, fin, | 476 return SendStreamDataWithStringHelper(id, data, offset, fin, |
| 476 MAY_FEC_PROTECT, listener); | 477 MAY_FEC_PROTECT, listener); |
| (...skipping 5038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5515 EXPECT_CALL(visitor_, | 5516 EXPECT_CALL(visitor_, |
| 5516 OnConnectionClosed(QUIC_UNENCRYPTED_STREAM_DATA, false)); | 5517 OnConnectionClosed(QUIC_UNENCRYPTED_STREAM_DATA, false)); |
| 5517 EXPECT_DFATAL(connection_.SendStreamDataWithString(3, "", 0, kFin, nullptr), | 5518 EXPECT_DFATAL(connection_.SendStreamDataWithString(3, "", 0, kFin, nullptr), |
| 5518 "Cannot send stream data without encryption."); | 5519 "Cannot send stream data without encryption."); |
| 5519 EXPECT_FALSE(connection_.connected()); | 5520 EXPECT_FALSE(connection_.connected()); |
| 5520 } | 5521 } |
| 5521 | 5522 |
| 5522 } // namespace | 5523 } // namespace |
| 5523 } // namespace test | 5524 } // namespace test |
| 5524 } // namespace net | 5525 } // namespace net |
| OLD | NEW |