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

Unified Diff: net/quic/quic_connection_test.cc

Issue 961173003: QuicConnection no longer owns the debug visitor. No behavior change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Cleanup_QUIC_TransmissionInfo_86734009
Patch Set: Fixed leaky ptr Created 5 years, 10 months 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/quic_connection.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_connection_test.cc
diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
index 57c55ce320dfea4dba6a0c70ba6f186a15e5ed8c..66910a854ea3c1c9b700acffae11657f3f1d2f2d 100644
--- a/net/quic/quic_connection_test.cc
+++ b/net/quic/quic_connection_test.cc
@@ -6,6 +6,7 @@
#include "base/basictypes.h"
#include "base/bind.h"
+#include "base/memory/scoped_ptr.h"
#include "base/stl_util.h"
#include "net/base/net_errors.h"
#include "net/quic/congestion_control/loss_detection_interface.h"
@@ -2530,9 +2531,9 @@ TEST_P(QuicConnectionTest, ReviveMissingPacketWithVaryingSeqNumLengths) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
// Set up a debug visitor to the connection.
- FecQuicConnectionDebugVisitor* fec_visitor =
- new FecQuicConnectionDebugVisitor();
- connection_.set_debug_visitor(fec_visitor);
+ scoped_ptr<FecQuicConnectionDebugVisitor> fec_visitor(
+ new FecQuicConnectionDebugVisitor());
+ connection_.set_debug_visitor(fec_visitor.get());
QuicPacketSequenceNumber fec_packet = 0;
QuicSequenceNumberLength lengths[] = {PACKET_6BYTE_SEQUENCE_NUMBER,
@@ -2558,9 +2559,9 @@ TEST_P(QuicConnectionTest, ReviveMissingPacketWithVaryingConnectionIdLengths) {
EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
// Set up a debug visitor to the connection.
- FecQuicConnectionDebugVisitor* fec_visitor =
- new FecQuicConnectionDebugVisitor();
- connection_.set_debug_visitor(fec_visitor);
+ scoped_ptr<FecQuicConnectionDebugVisitor> fec_visitor(
+ new FecQuicConnectionDebugVisitor());
+ connection_.set_debug_visitor(fec_visitor.get());
QuicPacketSequenceNumber fec_packet = 0;
QuicConnectionIdLength lengths[] = {PACKET_8BYTE_CONNECTION_ID,
@@ -4368,9 +4369,9 @@ class MockQuicConnectionDebugVisitor
TEST_P(QuicConnectionTest, OnPacketHeaderDebugVisitor) {
QuicPacketHeader header;
- MockQuicConnectionDebugVisitor* debug_visitor =
- new MockQuicConnectionDebugVisitor();
- connection_.set_debug_visitor(debug_visitor);
+ scoped_ptr<MockQuicConnectionDebugVisitor> debug_visitor(
+ new MockQuicConnectionDebugVisitor());
+ connection_.set_debug_visitor(debug_visitor.get());
EXPECT_CALL(*debug_visitor, OnPacketHeader(Ref(header))).Times(1);
connection_.OnPacketHeader(header);
}
« no previous file with comments | « net/quic/quic_connection.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698