From d069aaee0b3affb6004d8cf3a276c32e248a2a3d Mon Sep 17 00:00:00 2001 From: rjshade Date: Fri, 11 Mar 2016 12:42:17 -0800 Subject: Landing Recent QUIC changes until 2016-03-07 19:39 UTC Up to, and including internal change 116570346 Add a new QUIC Ack Decimation mode that is reordering tolerant. Protected by FLAG_quic_ack_decimation2. Merge internal change: 115853846 https://codereview.chromium.org/1777293002/ Deprecating FLAG_quic_batch_writes Merge internal change: 115880164 https://codereview.chromium.org/1780913002/ Deprecate FLAG_quic_validate_stk_without_scid Merge internal change: 115885351 https://codereview.chromium.org/1780923002/ Deprecate FLAG_quic_use_new_tcp_sender Merge internal change: 115890504 https://codereview.chromium.org/1785663003/ Deprecate FLAG_quic_use_new_idle_timeout Merge internal change: 115904466 https://codereview.chromium.org/1785693003/ Deprecate FLAG_quic_block_unencrypted_writes Merge internal change: 115909446 https://codereview.chromium.org/1784643006/ Clang formatting net/quic. Merge internal change: 115992556 https://codereview.chromium.org/1780783003/ Optionally defer responding to a QUIC ACK until all ACK processing has completed for an EpollServer iteration. Guarded by FLAG_quic_connection_defer_ack_response Merge internal change: 114770052 https://codereview.chromium.org/1782053003/ Deprecate FLAG_require_strike_register_or_server_nonce Merge internal change: 115891009 https://codereview.chromium.org/1785613005/ Add a boolean use_stateless_rejects_if_peer_supported argument to the QuicCryptoServerStream constructor instead of consulting FLAG_enable_quic_stateless_reject_support directly. No behavior change expected. Merge internal change: 115844136 https://codereview.chromium.org/1783713003/ Remove FEC from send path. Merge internal change: 115997404 https://codereview.chromium.org/1784903003/ Remove FEC code from receive path. Drop received FEC packet. Merge internal change: 116134765 https://codereview.chromium.org/1782143003/ Only cancel QUIC alarms if they have been set. Protected behind FLAG_quic_only_cancel_set_alarms Merge internal change: 116142833 https://codereview.chromium.org/1781073002/ Call QuicAlarm::IsSet instead of looking at deadline_ directly, rename some variables for readability. Merge internal change: 116146641 https://codereview.chromium.org/1778243005/ Add whether QUIC's unencrypted stream data was received or about to be sent in the error log. Logging only change. Merge internal change: 116152506 https://codereview.chromium.org/1782193002/ Temporarily store the raw QUIC packet in QuicConnection. Merge internal change: 116180343 https://codereview.chromium.org/1779313002/ Deprecate FLAG_quic_no_unencrypted_fec. Merge internal change: 116244697 https://codereview.chromium.org/1780573006/ Make ShouldCreateOutgoingDynamicStream a virtual method. Merge internal change: 116249386 https://codereview.chromium.org/1784933003/ Correctly handle EINTR during sendmsg in QuicSocketUtils::WritePacket. Merge internal change: 116261116 https://codereview.chromium.org/1780323002/ Simplify QUIC's encryption path now that FEC is gone. Protected by FLAG_quic_inplace_encryption. Merge internal change: 116266391 https://codereview.chromium.org/1785513003/ Remove the force param from QuicPacketGenerator::SetMaxPacketLength because path MTU packets should not be sent if the MTU cannot be changed. Not flag protected. Merge internal change: 116273065 https://codereview.chromium.org/1781043004/ Remove lastest_revived_packet from QuicAckFrame since FEC is gone. No functional change expected. Wire format is not changed yet. Merge internal change: 116411121 https://codereview.chromium.org/1787443002/ Remove is_fec_packet from TransmissionInfo and SerializedPacket. No functional change. Merge internal change: 116555910 https://codereview.chromium.org/1785853002/ Remove FEC related connection options and update FEC related comment in code base. Merge internal change: 116566297 https://codereview.chromium.org/1785863002/ Switch "const StringPiece&" to just "StringPiece" in QUIC code. No functional change. Not flag protected. Merge internal change: 116570346 https://codereview.chromium.org/1787453002/ Add a QuicCompressedCertsCache instance to QuicDispatcher, plumbing to QuicServerSessionBase but not used. No behavior change. Merge internal change: 116277134 https://codereview.chromium.org/1783783003/ Add more detailed logging to QUIC's ack validation. No functional change. Merge internal change: 116277228 https://codereview.chromium.org/1784963002/ Remove max_packet_length from QuicPacketGenerator, because it is no longer necessary with FEC gone. Not flag protected. Merge internal change: 116387934 https://codereview.chromium.org/1777423002/ Add QuicCompressedCertsCache* to QuicCrytoServerStream plumbed from QuicServerSessionBase. No behavior change. Merge internal change: 116388439 https://codereview.chromium.org/1782743005/ Remove unused return value from QuicAlarm::Delegate::OnAlarm. No behavior change, not protected. The only place in the codebase that returns something other than QuicTime::Zero() is the DelayAlarm in PacketDroppingTestWriter. I've the implementation of OnAlarm in there to set the alarm directly to the new time, rather than relying on the return value. Merge internal change: 116389752 https://codereview.chromium.org/1779883005/ Add a QUIC ScopedPacketBundler to send an ack when the ack alarm goes off. No functional change. Not flag protected. Merge internal change: 116391846 https://codereview.chromium.org/1786493003/ OnStreamEnd is now called instead of the sentinel call of OnStreamFrameData(stream_id, nullptr, 0, true). Protected by the flag FLAGS_spdy_on_stream_end. Merge internal change: 116272960 https://codereview.chromium.org/1777163003/ R=rch@chromium.org BUG= Review URL: https://codereview.chromium.org/1781123002 Cr-Commit-Position: refs/heads/master@{#380718} --- net/quic/test_tools/crypto_test_utils.cc | 5 ++- net/quic/test_tools/mock_quic_dispatcher.cc | 5 +-- net/quic/test_tools/quic_connection_peer.cc | 18 ++------- net/quic/test_tools/quic_connection_peer.h | 10 ++--- net/quic/test_tools/quic_packet_creator_peer.cc | 50 +----------------------- net/quic/test_tools/quic_packet_creator_peer.h | 13 ------ net/quic/test_tools/quic_test_utils.cc | 48 +++++++++++++---------- net/quic/test_tools/quic_test_utils.h | 38 +++++++----------- net/quic/test_tools/reliable_quic_stream_peer.cc | 6 --- net/quic/test_tools/reliable_quic_stream_peer.h | 2 - net/quic/test_tools/simple_quic_framer.cc | 13 ------ net/quic/test_tools/simple_quic_framer.h | 1 - 12 files changed, 55 insertions(+), 154 deletions(-) (limited to 'net/quic/test_tools') diff --git a/net/quic/test_tools/crypto_test_utils.cc b/net/quic/test_tools/crypto_test_utils.cc index 4d18cca..bb5f36b 100644 --- a/net/quic/test_tools/crypto_test_utils.cc +++ b/net/quic/test_tools/crypto_test_utils.cc @@ -136,11 +136,14 @@ int CryptoTestUtils::HandshakeWithFakeServer( QuicCryptoServerConfig crypto_config(QuicCryptoServerConfig::TESTING, QuicRandom::GetInstance(), ProofSourceForTesting()); + QuicCompressedCertsCache compressed_certs_cache( + QuicCompressedCertsCache::kQuicCompressedCertsCacheSize); SetupCryptoServerConfigForTest(server_conn->clock(), server_conn->random_generator(), &config, &crypto_config, options); - TestQuicSpdyServerSession server_session(server_conn, config, &crypto_config); + TestQuicSpdyServerSession server_session(server_conn, config, &crypto_config, + &compressed_certs_cache); // The client's handshake must have been started already. CHECK_NE(0u, client_conn->encrypted_packets_.size()); diff --git a/net/quic/test_tools/mock_quic_dispatcher.cc b/net/quic/test_tools/mock_quic_dispatcher.cc index 66b940b..a313651 100644 --- a/net/quic/test_tools/mock_quic_dispatcher.cc +++ b/net/quic/test_tools/mock_quic_dispatcher.cc @@ -13,10 +13,7 @@ MockQuicDispatcher::MockQuicDispatcher( const QuicConfig& config, const QuicCryptoServerConfig* crypto_config, QuicConnectionHelperInterface* helper) - : QuicDispatcher(config, - crypto_config, - QuicSupportedVersions(), - helper) {} + : QuicDispatcher(config, crypto_config, QuicSupportedVersions(), helper) {} MockQuicDispatcher::~MockQuicDispatcher() {} diff --git a/net/quic/test_tools/quic_connection_peer.cc b/net/quic/test_tools/quic_connection_peer.cc index f171bff..8f16fc8d 100644 --- a/net/quic/test_tools/quic_connection_peer.cc +++ b/net/quic/test_tools/quic_connection_peer.cc @@ -6,7 +6,6 @@ #include "base/stl_util.h" #include "net/quic/congestion_control/send_algorithm_interface.h" -#include "net/quic/quic_connection.h" #include "net/quic/quic_packet_writer.h" #include "net/quic/quic_received_packet_manager.h" #include "net/quic/test_tools/quic_framer_peer.h" @@ -151,13 +150,6 @@ QuicFramer* QuicConnectionPeer::GetFramer(QuicConnection* connection) { } // static -QuicFecGroup* QuicConnectionPeer::GetFecGroup(QuicConnection* connection, - int fec_group) { - connection->last_header_.fec_group = fec_group; - return connection->GetFecGroup(); -} - -// static QuicAlarm* QuicConnectionPeer::GetAckAlarm(QuicConnection* connection) { return connection->ack_alarm_.get(); } @@ -168,11 +160,6 @@ QuicAlarm* QuicConnectionPeer::GetPingAlarm(QuicConnection* connection) { } // static -QuicAlarm* QuicConnectionPeer::GetFecAlarm(QuicConnection* connection) { - return connection->fec_alarm_.get(); -} - -// static QuicAlarm* QuicConnectionPeer::GetResumeWritesAlarm( QuicConnection* connection) { return connection->resume_writes_alarm_.get(); @@ -268,8 +255,9 @@ void QuicConnectionPeer::SetNextMtuProbeAt(QuicConnection* connection, } // static -void QuicConnectionPeer::EnableAckDecimation(QuicConnection* connection) { - connection->ack_decimation_enabled_ = true; +void QuicConnectionPeer::SetAckMode(QuicConnection* connection, + QuicConnection::AckMode ack_mode) { + connection->ack_mode_ = ack_mode; } } // namespace test diff --git a/net/quic/test_tools/quic_connection_peer.h b/net/quic/test_tools/quic_connection_peer.h index 524eb15..d547dc4 100644 --- a/net/quic/test_tools/quic_connection_peer.h +++ b/net/quic/test_tools/quic_connection_peer.h @@ -7,6 +7,7 @@ #include "base/macros.h" #include "net/base/ip_endpoint.h" +#include "net/quic/quic_connection.h" #include "net/quic/quic_connection_stats.h" #include "net/quic/quic_protocol.h" @@ -15,11 +16,9 @@ namespace net { struct QuicAckFrame; struct QuicPacketHeader; class QuicAlarm; -class QuicConnection; class QuicConnectionHelperInterface; class QuicConnectionVisitorInterface; class QuicEncryptedPacket; -class QuicFecGroup; class QuicFramer; class QuicPacketCreator; class QuicPacketGenerator; @@ -88,12 +87,8 @@ class QuicConnectionPeer { static QuicFramer* GetFramer(QuicConnection* connection); - // Set last_header_->fec_group = fec_group and return connection->GetFecGroup - static QuicFecGroup* GetFecGroup(QuicConnection* connection, int fec_group); - static QuicAlarm* GetAckAlarm(QuicConnection* connection); static QuicAlarm* GetPingAlarm(QuicConnection* connection); - static QuicAlarm* GetFecAlarm(QuicConnection* connection); static QuicAlarm* GetResumeWritesAlarm(QuicConnection* connection); static QuicAlarm* GetRetransmissionAlarm(QuicConnection* connection); static QuicAlarm* GetSendAlarm(QuicConnection* connection); @@ -122,7 +117,8 @@ class QuicConnectionPeer { QuicPacketCount packets); static void SetNextMtuProbeAt(QuicConnection* connection, QuicPacketNumber number); - static void EnableAckDecimation(QuicConnection* connection); + static void SetAckMode(QuicConnection* connection, + QuicConnection::AckMode ack_mode); private: DISALLOW_COPY_AND_ASSIGN(QuicConnectionPeer); diff --git a/net/quic/test_tools/quic_packet_creator_peer.cc b/net/quic/test_tools/quic_packet_creator_peer.cc index 6ec2a72..83b783c 100644 --- a/net/quic/test_tools/quic_packet_creator_peer.cc +++ b/net/quic/test_tools/quic_packet_creator_peer.cc @@ -65,10 +65,8 @@ void QuicPacketCreatorPeer::SetPacketNumber(QuicPacketCreator* creator, // static void QuicPacketCreatorPeer::FillPacketHeader(QuicPacketCreator* creator, - QuicFecGroupNumber fec_group, - bool fec_flag, QuicPacketHeader* header) { - creator->FillPacketHeader(fec_group, fec_flag, header); + creator->FillPacketHeader(header); } // static @@ -83,35 +81,6 @@ size_t QuicPacketCreatorPeer::CreateStreamFrame(QuicPacketCreator* creator, } // static -bool QuicPacketCreatorPeer::IsFecProtected(QuicPacketCreator* creator) { - return creator->fec_protect_; -} - -// static -bool QuicPacketCreatorPeer::IsFecEnabled(QuicPacketCreator* creator) { - return creator->max_packets_per_fec_group_ > 0; -} - -// static -void QuicPacketCreatorPeer::StartFecProtectingPackets( - QuicPacketCreator* creator) { - creator->StartFecProtectingPackets(); -} - -// static -void QuicPacketCreatorPeer::StopFecProtectingPackets( - QuicPacketCreator* creator) { - creator->StopFecProtectingPackets(); -} - -// static -void QuicPacketCreatorPeer::SerializeFec(QuicPacketCreator* creator, - char* buffer, - size_t buffer_len) { - creator->SerializeFec(buffer, buffer_len); -} - -// static SerializedPacket QuicPacketCreatorPeer::SerializeAllFrames( QuicPacketCreator* creator, const QuicFrames& frames, @@ -132,23 +101,6 @@ SerializedPacket QuicPacketCreatorPeer::SerializeAllFrames( } // static -void QuicPacketCreatorPeer::ResetFecGroup(QuicPacketCreator* creator) { - creator->ResetFecGroup(); -} - -// static -QuicTime::Delta QuicPacketCreatorPeer::GetFecTimeout( - QuicPacketCreator* creator) { - return creator->fec_timeout_; -} - -// static -float QuicPacketCreatorPeer::GetRttMultiplierForFecTimeout( - QuicPacketCreator* creator) { - return creator->rtt_multiplier_for_fec_timeout_; -} - -// static EncryptionLevel QuicPacketCreatorPeer::GetEncryptionLevel( QuicPacketCreator* creator) { return creator->packet_.encryption_level; diff --git a/net/quic/test_tools/quic_packet_creator_peer.h b/net/quic/test_tools/quic_packet_creator_peer.h index cc17ca9..6849c1f 100644 --- a/net/quic/test_tools/quic_packet_creator_peer.h +++ b/net/quic/test_tools/quic_packet_creator_peer.h @@ -36,8 +36,6 @@ class QuicPacketCreatorPeer { QuicPacketCreator* creator); static void SetPacketNumber(QuicPacketCreator* creator, QuicPacketNumber s); static void FillPacketHeader(QuicPacketCreator* creator, - QuicFecGroupNumber fec_group, - bool fec_flag, QuicPacketHeader* header); static size_t CreateStreamFrame(QuicPacketCreator* creator, QuicStreamId id, @@ -46,21 +44,10 @@ class QuicPacketCreatorPeer { QuicStreamOffset offset, bool fin, QuicFrame* frame); - static bool IsFecProtected(QuicPacketCreator* creator); - static bool IsFecEnabled(QuicPacketCreator* creator); - static void StartFecProtectingPackets(QuicPacketCreator* creator); - static void StopFecProtectingPackets(QuicPacketCreator* creator); - static void SerializeFec(QuicPacketCreator* creator, - char* buffer, - size_t buffer_len); static SerializedPacket SerializeAllFrames(QuicPacketCreator* creator, const QuicFrames& frames, char* buffer, size_t buffer_len); - static void ResetFecGroup(QuicPacketCreator* creator); - static QuicTime::Delta GetFecTimeout(QuicPacketCreator* creator); - // TODO(rtenneti): Delete this code after the 0.25 RTT FEC experiment. - static float GetRttMultiplierForFecTimeout(QuicPacketCreator* creator); static EncryptionLevel GetEncryptionLevel(QuicPacketCreator* creator); static QuicPathId GetCurrentPath(QuicPacketCreator* creator); diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc index 9911757..1041569 100644 --- a/net/quic/test_tools/quic_test_utils.cc +++ b/net/quic/test_tools/quic_test_utils.cc @@ -61,7 +61,7 @@ QuicPacket* BuildUnsizedDataPacket(QuicFramer* framer, bool last_frame = i == frames.size() - 1; const size_t frame_size = framer->GetSerializedFrameLength( frames[i], max_plaintext_size - packet_size, first_frame, last_frame, - header.is_in_fec_group, header.public_header.packet_number_length); + header.public_header.packet_number_length); DCHECK(frame_size); packet_size += frame_size; } @@ -309,7 +309,7 @@ MockQuicSpdySession::MockQuicSpdySession(QuicConnection* connection) : QuicSpdySession(connection, DefaultQuicConfig()) { crypto_stream_.reset(new QuicCryptoStream(this)); Initialize(); - ON_CALL(*this, WritevData(_, _, _, _, _, _)) + ON_CALL(*this, WritevData(_, _, _, _, _)) .WillByDefault(testing::Return(QuicConsumedData(0, false))); } @@ -321,7 +321,6 @@ QuicConsumedData MockQuicSpdySession::ConsumeAllData( const QuicIOVector& data, QuicStreamOffset /*offset*/, bool fin, - FecProtection /*fec_protection*/, QuicAckListenerInterface* /*ack_notifier_delegate*/) { return QuicConsumedData(data.total_length, fin); } @@ -329,8 +328,13 @@ QuicConsumedData MockQuicSpdySession::ConsumeAllData( TestQuicSpdyServerSession::TestQuicSpdyServerSession( QuicConnection* connection, const QuicConfig& config, - const QuicCryptoServerConfig* crypto_config) - : QuicServerSessionBase(config, connection, &visitor_, crypto_config) { + const QuicCryptoServerConfig* crypto_config, + QuicCompressedCertsCache* compressed_certs_cache) + : QuicServerSessionBase(config, + connection, + &visitor_, + crypto_config, + compressed_certs_cache) { Initialize(); } @@ -338,8 +342,11 @@ TestQuicSpdyServerSession::~TestQuicSpdyServerSession() {} QuicCryptoServerStreamBase* TestQuicSpdyServerSession::CreateQuicCryptoServerStream( - const QuicCryptoServerConfig* crypto_config) { - return new QuicCryptoServerStream(crypto_config, this); + const QuicCryptoServerConfig* crypto_config, + QuicCompressedCertsCache* compressed_certs_cache) { + return new QuicCryptoServerStream(crypto_config, compressed_certs_cache, + FLAGS_enable_quic_stateless_reject_support, + this); } QuicCryptoServerStream* TestQuicSpdyServerSession::GetCryptoStream() { @@ -672,20 +679,18 @@ size_t GetPacketLengthForOneStream(QuicVersion version, bool include_path_id, QuicConnectionIdLength connection_id_length, QuicPacketNumberLength packet_number_length, - InFecGroup is_in_fec_group, size_t* payload_length) { *payload_length = 1; const size_t stream_length = NullEncrypter().GetCiphertextSize(*payload_length) + QuicPacketCreator::StreamFramePacketOverhead( PACKET_8BYTE_CONNECTION_ID, include_version, include_path_id, - packet_number_length, 0u, is_in_fec_group); + packet_number_length, 0u); const size_t ack_length = NullEncrypter().GetCiphertextSize( QuicFramer::GetMinAckFrameSize(PACKET_1BYTE_PACKET_NUMBER)) + GetPacketHeaderSize(connection_id_length, include_version, - include_path_id, packet_number_length, - is_in_fec_group); + include_path_id, packet_number_length); if (stream_length < ack_length) { *payload_length = 1 + ack_length - stream_length; } @@ -693,7 +698,7 @@ size_t GetPacketLengthForOneStream(QuicVersion version, return NullEncrypter().GetCiphertextSize(*payload_length) + QuicPacketCreator::StreamFramePacketOverhead( connection_id_length, include_version, include_path_id, - packet_number_length, 0u, is_in_fec_group); + packet_number_length, 0u); } TestEntropyCalculator::TestEntropyCalculator() {} @@ -766,13 +771,15 @@ void CreateClientSessionForTest(QuicServerId server_id, (*client_connection)->AdvanceTime(connection_start_time); } -void CreateServerSessionForTest(QuicServerId server_id, - QuicTime::Delta connection_start_time, - QuicVersionVector supported_versions, - MockConnectionHelper* helper, - QuicCryptoServerConfig* server_crypto_config, - PacketSavingConnection** server_connection, - TestQuicSpdyServerSession** server_session) { +void CreateServerSessionForTest( + QuicServerId server_id, + QuicTime::Delta connection_start_time, + QuicVersionVector supported_versions, + MockConnectionHelper* helper, + QuicCryptoServerConfig* server_crypto_config, + QuicCompressedCertsCache* compressed_certs_cache, + PacketSavingConnection** server_connection, + TestQuicSpdyServerSession** server_session) { CHECK(server_crypto_config); CHECK(server_connection); CHECK(server_session); @@ -783,7 +790,8 @@ void CreateServerSessionForTest(QuicServerId server_id, *server_connection = new PacketSavingConnection( helper, Perspective::IS_SERVER, supported_versions); *server_session = new TestQuicSpdyServerSession( - *server_connection, DefaultQuicConfig(), server_crypto_config); + *server_connection, DefaultQuicConfig(), server_crypto_config, + compressed_certs_cache); // We advance the clock initially because the default time is zero and the // strike register worries that we've just overflowed a uint32_t time. diff --git a/net/quic/test_tools/quic_test_utils.h b/net/quic/test_tools/quic_test_utils.h index e669b0c..276490b 100644 --- a/net/quic/test_tools/quic_test_utils.h +++ b/net/quic/test_tools/quic_test_utils.h @@ -142,7 +142,6 @@ size_t GetPacketLengthForOneStream(QuicVersion version, bool include_path_id, QuicConnectionIdLength connection_id_length, QuicPacketNumberLength packet_number_length, - InFecGroup is_in_fec_group, size_t* payload_length); // Returns QuicConfig set to default values. @@ -221,7 +220,6 @@ class MockFramerVisitor : public QuicFramerVisitorInterface { MOCK_METHOD1(OnPublicResetPacket, void(const QuicPublicResetPacket& header)); MOCK_METHOD1(OnVersionNegotiationPacket, void(const QuicVersionNegotiationPacket& packet)); - MOCK_METHOD0(OnRevivedPacket, void()); // The constructor sets this up to return true by default. MOCK_METHOD1(OnUnauthenticatedHeader, bool(const QuicPacketHeader& header)); // The constructor sets this up to return true by default. @@ -229,12 +227,10 @@ class MockFramerVisitor : public QuicFramerVisitorInterface { bool(const QuicPacketPublicHeader& header)); MOCK_METHOD1(OnDecryptedPacket, void(EncryptionLevel level)); MOCK_METHOD1(OnPacketHeader, bool(const QuicPacketHeader& header)); - MOCK_METHOD1(OnFecProtectedPayload, void(base::StringPiece payload)); MOCK_METHOD1(OnStreamFrame, bool(const QuicStreamFrame& frame)); MOCK_METHOD1(OnAckFrame, bool(const QuicAckFrame& frame)); MOCK_METHOD1(OnStopWaitingFrame, bool(const QuicStopWaitingFrame& frame)); MOCK_METHOD1(OnPingFrame, bool(const QuicPingFrame& frame)); - MOCK_METHOD1(OnFecData, void(StringPiece redundancy)); MOCK_METHOD1(OnRstStreamFrame, bool(const QuicRstStreamFrame& frame)); MOCK_METHOD1(OnConnectionCloseFrame, bool(const QuicConnectionCloseFrame& frame)); @@ -257,19 +253,16 @@ class NoOpFramerVisitor : public QuicFramerVisitorInterface { void OnPublicResetPacket(const QuicPublicResetPacket& packet) override {} void OnVersionNegotiationPacket( const QuicVersionNegotiationPacket& packet) override {} - void OnRevivedPacket() override {} bool OnProtocolVersionMismatch(QuicVersion version) override; bool OnUnauthenticatedHeader(const QuicPacketHeader& header) override; bool OnUnauthenticatedPublicHeader( const QuicPacketPublicHeader& header) override; void OnDecryptedPacket(EncryptionLevel level) override {} bool OnPacketHeader(const QuicPacketHeader& header) override; - void OnFecProtectedPayload(base::StringPiece payload) override {} bool OnStreamFrame(const QuicStreamFrame& frame) override; bool OnAckFrame(const QuicAckFrame& frame) override; bool OnStopWaitingFrame(const QuicStopWaitingFrame& frame) override; bool OnPingFrame(const QuicPingFrame& frame) override; - void OnFecData(StringPiece redundancy) override {} bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override; bool OnConnectionCloseFrame(const QuicConnectionCloseFrame& frame) override; bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override; @@ -461,13 +454,13 @@ class MockQuicSpdySession : public QuicSpdySession { MOCK_METHOD1(CreateIncomingDynamicStream, QuicSpdyStream*(QuicStreamId id)); MOCK_METHOD1(CreateOutgoingDynamicStream, QuicSpdyStream*(SpdyPriority priority)); - MOCK_METHOD6(WritevData, + MOCK_METHOD5(WritevData, QuicConsumedData(QuicStreamId id, QuicIOVector data, QuicStreamOffset offset, bool fin, - FecProtection fec_protection, QuicAckListenerInterface*)); + MOCK_METHOD3(SendRstStream, void(QuicStreamId stream_id, QuicRstStreamErrorCode error, @@ -503,7 +496,6 @@ class MockQuicSpdySession : public QuicSpdySession { const QuicIOVector& data, QuicStreamOffset offset, bool fin, - FecProtection fec_protection, QuicAckListenerInterface* ack_notifier_delegate); private: @@ -516,14 +508,16 @@ class TestQuicSpdyServerSession : public QuicServerSessionBase { public: TestQuicSpdyServerSession(QuicConnection* connection, const QuicConfig& config, - const QuicCryptoServerConfig* crypto_config); + const QuicCryptoServerConfig* crypto_config, + QuicCompressedCertsCache* compressed_certs_cache); ~TestQuicSpdyServerSession() override; MOCK_METHOD1(CreateIncomingDynamicStream, QuicSpdyStream*(QuicStreamId id)); MOCK_METHOD1(CreateOutgoingDynamicStream, QuicSpdyStream*(SpdyPriority priority)); QuicCryptoServerStreamBase* CreateQuicCryptoServerStream( - const QuicCryptoServerConfig* crypto_config) override; + const QuicCryptoServerConfig* crypto_config, + QuicCompressedCertsCache* compressed_certs_cache) override; QuicCryptoServerStream* GetCryptoStream() override; @@ -742,9 +736,6 @@ class MockQuicConnectionDebugVisitor : public QuicConnectionDebugVisitor { MOCK_METHOD1(OnVersionNegotiationPacket, void(const QuicVersionNegotiationPacket&)); - - MOCK_METHOD2(OnRevivedPacket, - void(const QuicPacketHeader&, StringPiece payload)); }; class MockReceivedPacketManager : public QuicReceivedPacketManager { @@ -756,7 +747,6 @@ class MockReceivedPacketManager : public QuicReceivedPacketManager { void(QuicByteCount bytes, const QuicPacketHeader& header, QuicTime receipt_time)); - MOCK_METHOD1(RecordPacketRevived, void(QuicPacketNumber packet_number)); MOCK_METHOD1(IsMissing, bool(QuicPacketNumber packet_number)); MOCK_METHOD1(IsAwaitingPacket, bool(QuicPacketNumber packet_number)); MOCK_METHOD1(UpdatePacketInformationSentByPeer, @@ -805,13 +795,15 @@ void CreateClientSessionForTest(QuicServerId server_id, // server_session. // server_session: Pointer reference for the newly created server // session. The new object will be owned by the caller. -void CreateServerSessionForTest(QuicServerId server_id, - QuicTime::Delta connection_start_time, - QuicVersionVector supported_versions, - MockConnectionHelper* helper, - QuicCryptoServerConfig* crypto_server_config, - PacketSavingConnection** server_connection, - TestQuicSpdyServerSession** server_session); +void CreateServerSessionForTest( + QuicServerId server_id, + QuicTime::Delta connection_start_time, + QuicVersionVector supported_versions, + MockConnectionHelper* helper, + QuicCryptoServerConfig* crypto_server_config, + QuicCompressedCertsCache* compressed_certs_cache, + PacketSavingConnection** server_connection, + TestQuicSpdyServerSession** server_session); // Helper to generate client side stream ids, generalizes // kClientDataStreamId1 etc. above. diff --git a/net/quic/test_tools/reliable_quic_stream_peer.cc b/net/quic/test_tools/reliable_quic_stream_peer.cc index 97a7278..2b419bf 100644 --- a/net/quic/test_tools/reliable_quic_stream_peer.cc +++ b/net/quic/test_tools/reliable_quic_stream_peer.cc @@ -79,12 +79,6 @@ uint32_t ReliableQuicStreamPeer::SizeOfQueuedData(ReliableQuicStream* stream) { } // static -void ReliableQuicStreamPeer::SetFecPolicy(ReliableQuicStream* stream, - FecPolicy fec_policy) { - stream->set_fec_policy(fec_policy); -} - -// static bool ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( ReliableQuicStream* stream) { return stream->stream_contributes_to_connection_flow_control_; diff --git a/net/quic/test_tools/reliable_quic_stream_peer.h b/net/quic/test_tools/reliable_quic_stream_peer.h index db172da..04bbe7b 100644 --- a/net/quic/test_tools/reliable_quic_stream_peer.h +++ b/net/quic/test_tools/reliable_quic_stream_peer.h @@ -35,8 +35,6 @@ class ReliableQuicStreamPeer { static uint32_t SizeOfQueuedData(ReliableQuicStream* stream); - static void SetFecPolicy(ReliableQuicStream* stream, FecPolicy fec_policy); - static bool StreamContributesToConnectionFlowControl( ReliableQuicStream* stream); diff --git a/net/quic/test_tools/simple_quic_framer.cc b/net/quic/test_tools/simple_quic_framer.cc index 977a367..dd0e0cb 100644 --- a/net/quic/test_tools/simple_quic_framer.cc +++ b/net/quic/test_tools/simple_quic_framer.cc @@ -37,7 +37,6 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface { const QuicVersionNegotiationPacket& packet) override { version_negotiation_packet_.reset(new QuicVersionNegotiationPacket(packet)); } - void OnRevivedPacket() override {} bool OnUnauthenticatedPublicHeader( const QuicPacketPublicHeader& header) override { @@ -53,8 +52,6 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface { return true; } - void OnFecProtectedPayload(StringPiece payload) override {} - bool OnStreamFrame(const QuicStreamFrame& frame) override { // Save a copy of the data so it is valid after the packet is processed. string* string_data = new string(); @@ -82,10 +79,6 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface { return true; } - void OnFecData(StringPiece redundancy) override { - fec_redundancy_ = redundancy.as_string(); - } - bool OnRstStreamFrame(const QuicRstStreamFrame& frame) override { rst_stream_frames_.push_back(frame); return true; @@ -136,7 +129,6 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface { return stop_waiting_frames_; } const vector& ping_frames() const { return ping_frames_; } - StringPiece fec_data() const { return fec_redundancy_; } const QuicVersionNegotiationPacket* version_negotiation_packet() const { return version_negotiation_packet_.get(); } @@ -147,7 +139,6 @@ class SimpleFramerVisitor : public QuicFramerVisitorInterface { QuicPacketHeader header_; scoped_ptr version_negotiation_packet_; scoped_ptr public_reset_packet_; - string fec_redundancy_; vector ack_frames_; vector stop_waiting_frames_; vector ping_frames_; @@ -187,10 +178,6 @@ const QuicPacketHeader& SimpleQuicFramer::header() const { return visitor_->header(); } -StringPiece SimpleQuicFramer::fec_data() const { - return visitor_->fec_data(); -} - const QuicVersionNegotiationPacket* SimpleQuicFramer::version_negotiation_packet() const { return visitor_->version_negotiation_packet(); diff --git a/net/quic/test_tools/simple_quic_framer.h b/net/quic/test_tools/simple_quic_framer.h index c476550..f09db61 100644 --- a/net/quic/test_tools/simple_quic_framer.h +++ b/net/quic/test_tools/simple_quic_framer.h @@ -46,7 +46,6 @@ class SimpleQuicFramer { const std::vector& goaway_frames() const; const std::vector& rst_stream_frames() const; const std::vector& stream_frames() const; - base::StringPiece fec_data() const; const QuicVersionNegotiationPacket* version_negotiation_packet() const; QuicFramer* framer(); -- cgit v1.1