Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(535)

Unified Diff: net/quic/core/quic_connection_test.cc

Issue 2580393003: Replace QuicAckListenerInterface* with scoped_refptr<QuicAckListenerInterface>. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/quic_connection.cc ('k') | net/quic/core/quic_headers_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_connection_test.cc
diff --git a/net/quic/core/quic_connection_test.cc b/net/quic/core/quic_connection_test.cc
index aa7f049c61332a897a5b1e45265c64ecf094cf92..d14365cad2b0af876217f1167ea46c14439ec87d 100644
--- a/net/quic/core/quic_connection_test.cc
+++ b/net/quic/core/quic_connection_test.cc
@@ -516,7 +516,7 @@ class TestConnection : public QuicConnection {
StringPiece data,
QuicStreamOffset offset,
bool fin,
- QuicAckListenerInterface* listener) {
+ const scoped_refptr<QuicAckListenerInterface>& listener) {
if (id != kCryptoStreamId && this->encryption_level() == ENCRYPTION_NONE) {
this->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
}
@@ -4616,7 +4616,7 @@ TEST_P(QuicConnectionTest, AckNotifierTriggerCallback) {
EXPECT_CALL(*listener, OnPacketAcked(_, _)).Times(1);
// Send some data, which will register the listener to be notified.
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, listener.get());
+ connection_.SendStreamDataWithString(1, "foo", 0, !kFin, listener);
// Process an ACK from the server which should trigger the callback.
EXPECT_CALL(*send_algorithm_, OnCongestionEvent(true, _, _, _, _));
@@ -4633,7 +4633,7 @@ TEST_P(QuicConnectionTest, AckNotifierFailToTriggerCallback) {
// Send some data, which will register the listener to be notified. This will
// not be ACKed and so the listener should never be called.
- connection_.SendStreamDataWithString(1, "foo", 0, !kFin, listener.get());
+ connection_.SendStreamDataWithString(1, "foo", 0, !kFin, listener);
// Send some other data which we will ACK.
connection_.SendStreamDataWithString(1, "foo", 0, !kFin, nullptr);
@@ -4661,7 +4661,7 @@ TEST_P(QuicConnectionTest, AckNotifierCallbackAfterRetransmission) {
// Send four packets, and register to be notified on ACK of packet 2.
connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
- connection_.SendStreamDataWithString(3, "bar", 0, !kFin, listener.get());
+ connection_.SendStreamDataWithString(3, "bar", 0, !kFin, listener);
connection_.SendStreamDataWithString(3, "baz", 0, !kFin, nullptr);
connection_.SendStreamDataWithString(3, "qux", 0, !kFin, nullptr);
@@ -4695,7 +4695,7 @@ TEST_P(QuicConnectionTest, AckNotifierCallbackForAckAfterRTO) {
QuicTime default_retransmission_time =
clock_.ApproximateNow() + DefaultRetransmissionTime();
- connection_.SendStreamDataWithString(3, "foo", 0, !kFin, listener.get());
+ connection_.SendStreamDataWithString(3, "foo", 0, !kFin, listener);
EXPECT_EQ(1u, stop_waiting()->least_unacked);
EXPECT_EQ(1u, writer_->header().packet_number);
@@ -4732,7 +4732,7 @@ TEST_P(QuicConnectionTest, AckNotifierCallbackForAckOfNackedPacket) {
// Send four packets, and register to be notified on ACK of packet 2.
connection_.SendStreamDataWithString(3, "foo", 0, !kFin, nullptr);
- connection_.SendStreamDataWithString(3, "bar", 0, !kFin, listener.get());
+ connection_.SendStreamDataWithString(3, "bar", 0, !kFin, listener);
connection_.SendStreamDataWithString(3, "baz", 0, !kFin, nullptr);
connection_.SendStreamDataWithString(3, "qux", 0, !kFin, nullptr);
@@ -4827,7 +4827,7 @@ TEST_P(QuicConnectionTest, NoDataNoFin) {
// Regression test for b/18594622
scoped_refptr<MockAckListener> listener(new MockAckListener);
EXPECT_QUIC_BUG(
- connection_.SendStreamDataWithString(3, "", 0, !kFin, listener.get()),
+ connection_.SendStreamDataWithString(3, "", 0, !kFin, listener),
"Attempt to send empty stream frame");
}
« no previous file with comments | « net/quic/core/quic_connection.cc ('k') | net/quic/core/quic_headers_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698