| Index: net/quic/quic_connection.cc
|
| diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
|
| index 5eb161842ae30c4b9e1b161aab1b9aab6e101ad6..4a99c2fea287995f69f311535a18601ce524f64b 100644
|
| --- a/net/quic/quic_connection.cc
|
| +++ b/net/quic/quic_connection.cc
|
| @@ -220,7 +220,6 @@ QuicConnection::QuicConnection(QuicConnectionId connection_id,
|
| resume_writes_alarm_(helper->CreateAlarm(new SendAlarm(this))),
|
| timeout_alarm_(helper->CreateAlarm(new TimeoutAlarm(this))),
|
| ping_alarm_(helper->CreateAlarm(new PingAlarm(this))),
|
| - debug_visitor_(NULL),
|
| packet_generator_(connection_id_, &framer_, random_generator_, this),
|
| idle_network_timeout_(
|
| QuicTime::Delta::FromSeconds(kDefaultInitialTimeoutSecs)),
|
| @@ -309,7 +308,7 @@ void QuicConnection::OnPacket() {
|
|
|
| void QuicConnection::OnPublicResetPacket(
|
| const QuicPublicResetPacket& packet) {
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnPublicResetPacket(packet);
|
| }
|
| CloseConnection(QUIC_PUBLIC_RESET, true);
|
| @@ -330,7 +329,7 @@ bool QuicConnection::OnProtocolVersionMismatch(QuicVersion received_version) {
|
| }
|
| DCHECK_NE(version(), received_version);
|
|
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnProtocolVersionMismatch(received_version);
|
| }
|
|
|
| @@ -381,7 +380,7 @@ void QuicConnection::OnVersionNegotiationPacket(
|
| CloseConnection(QUIC_INTERNAL_ERROR, false);
|
| return;
|
| }
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnVersionNegotiationPacket(packet);
|
| }
|
|
|
| @@ -429,7 +428,7 @@ void QuicConnection::OnDecryptedPacket(EncryptionLevel level) {
|
| }
|
|
|
| bool QuicConnection::OnPacketHeader(const QuicPacketHeader& header) {
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnPacketHeader(header);
|
| }
|
|
|
| @@ -512,7 +511,7 @@ void QuicConnection::OnFecProtectedPayload(StringPiece payload) {
|
|
|
| bool QuicConnection::OnStreamFrame(const QuicStreamFrame& frame) {
|
| DCHECK(connected_);
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnStreamFrame(frame);
|
| }
|
| if (frame.stream_id != kCryptoStreamId &&
|
| @@ -528,7 +527,7 @@ bool QuicConnection::OnStreamFrame(const QuicStreamFrame& frame) {
|
|
|
| bool QuicConnection::OnAckFrame(const QuicAckFrame& incoming_ack) {
|
| DCHECK(connected_);
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnAckFrame(incoming_ack);
|
| }
|
| DVLOG(1) << ENDPOINT << "OnAckFrame: " << incoming_ack;
|
| @@ -581,7 +580,7 @@ void QuicConnection::ProcessStopWaitingFrame(
|
| bool QuicConnection::OnCongestionFeedbackFrame(
|
| const QuicCongestionFeedbackFrame& feedback) {
|
| DCHECK(connected_);
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnCongestionFeedbackFrame(feedback);
|
| }
|
| last_congestion_frames_.push_back(feedback);
|
| @@ -602,7 +601,7 @@ bool QuicConnection::OnStopWaitingFrame(const QuicStopWaitingFrame& frame) {
|
| return false;
|
| }
|
|
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnStopWaitingFrame(frame);
|
| }
|
|
|
| @@ -612,7 +611,7 @@ bool QuicConnection::OnStopWaitingFrame(const QuicStopWaitingFrame& frame) {
|
|
|
| bool QuicConnection::OnPingFrame(const QuicPingFrame& frame) {
|
| DCHECK(connected_);
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnPingFrame(frame);
|
| }
|
| return true;
|
| @@ -711,7 +710,7 @@ void QuicConnection::OnFecData(const QuicFecData& fec) {
|
|
|
| bool QuicConnection::OnRstStreamFrame(const QuicRstStreamFrame& frame) {
|
| DCHECK(connected_);
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnRstStreamFrame(frame);
|
| }
|
| DVLOG(1) << ENDPOINT << "Stream reset with error "
|
| @@ -723,7 +722,7 @@ bool QuicConnection::OnRstStreamFrame(const QuicRstStreamFrame& frame) {
|
| bool QuicConnection::OnConnectionCloseFrame(
|
| const QuicConnectionCloseFrame& frame) {
|
| DCHECK(connected_);
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnConnectionCloseFrame(frame);
|
| }
|
| DVLOG(1) << ENDPOINT << "Connection " << connection_id()
|
| @@ -736,7 +735,7 @@ bool QuicConnection::OnConnectionCloseFrame(
|
|
|
| bool QuicConnection::OnGoAwayFrame(const QuicGoAwayFrame& frame) {
|
| DCHECK(connected_);
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnGoAwayFrame(frame);
|
| }
|
| DVLOG(1) << ENDPOINT << "Go away received with error "
|
| @@ -748,7 +747,7 @@ bool QuicConnection::OnGoAwayFrame(const QuicGoAwayFrame& frame) {
|
|
|
| bool QuicConnection::OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) {
|
| DCHECK(connected_);
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnWindowUpdateFrame(frame);
|
| }
|
| DVLOG(1) << ENDPOINT << "WindowUpdate received for stream: "
|
| @@ -759,7 +758,7 @@ bool QuicConnection::OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) {
|
|
|
| bool QuicConnection::OnBlockedFrame(const QuicBlockedFrame& frame) {
|
| DCHECK(connected_);
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnBlockedFrame(frame);
|
| }
|
| DVLOG(1) << ENDPOINT << "Blocked frame received for stream: "
|
| @@ -1074,7 +1073,7 @@ void QuicConnection::ProcessUdpPacket(const IPEndPoint& self_address,
|
| if (!connected_) {
|
| return;
|
| }
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnPacketReceived(self_address, peer_address, packet);
|
| }
|
| last_packet_revived_ = false;
|
| @@ -1246,7 +1245,7 @@ void QuicConnection::WritePendingRetransmissions() {
|
|
|
| DVLOG(1) << ENDPOINT << "Retransmitting " << pending.sequence_number
|
| << " as " << serialized_packet.sequence_number;
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnPacketRetransmitted(
|
| pending.sequence_number, serialized_packet.sequence_number);
|
| }
|
| @@ -1395,7 +1394,7 @@ bool QuicConnection::WritePacket(QueuedPacket packet) {
|
| if (result.error_code == ERR_IO_PENDING) {
|
| DCHECK_EQ(WRITE_STATUS_BLOCKED, result.status);
|
| }
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| // Pass the write result to the visitor.
|
| debug_visitor_->OnPacketSent(sequence_number,
|
| packet.encryption_level,
|
| @@ -1716,7 +1715,7 @@ void QuicConnection::MaybeProcessRevivedPacket() {
|
| delete group;
|
|
|
| last_packet_revived_ = true;
|
| - if (debug_visitor_) {
|
| + if (debug_visitor_.get() != NULL) {
|
| debug_visitor_->OnRevivedPacket(revived_header,
|
| StringPiece(revived_payload, len));
|
| }
|
|
|