diff --git a/p2p/base/connection.cc b/p2p/base/connection.cc index 25a4d012a9..b0097b569b 100644 --- a/p2p/base/connection.cc +++ b/p2p/base/connection.cc @@ -309,7 +309,6 @@ Connection::Connection(rtc::WeakPtr port, last_ping_received_(0), last_data_received_(0), last_ping_response_received_(0), - reported_(false), state_(IceCandidatePairState::WAITING), time_created_ms_(rtc::TimeMillis()), field_trials_(&kDefaultFieldTrials), @@ -901,16 +900,6 @@ void Connection::PrintPingsSinceLastResponse(std::string* s, size_t max) { *s = oss.str(); } -bool Connection::reported() const { - RTC_DCHECK_RUN_ON(network_thread_); - return reported_; -} - -void Connection::set_reported(bool reported) { - RTC_DCHECK_RUN_ON(network_thread_); - reported_ = reported; -} - bool Connection::selected() const { RTC_DCHECK_RUN_ON(network_thread_); return selected_; @@ -1486,7 +1475,6 @@ ConnectionInfo Connection::stats() { stats_.receiving = receiving_; stats_.writable = write_state_ == STATE_WRITABLE; stats_.timeout = write_state_ == STATE_WRITE_TIMEOUT; - stats_.new_connection = !reported_; stats_.rtt = rtt_; stats_.key = this; stats_.state = state_; diff --git a/p2p/base/connection.h b/p2p/base/connection.h index 8d22da2188..3e8cffbfda 100644 --- a/p2p/base/connection.h +++ b/p2p/base/connection.h @@ -243,9 +243,6 @@ class Connection : public CandidatePairInterface { // Prints pings_since_last_response_ into a string. void PrintPingsSinceLastResponse(std::string* pings, size_t max); - bool reported() const; - void set_reported(bool reported); - // `set_selected` is only used for logging in ToString above. The flag is // set true by P2PTransportChannel for its selected candidate pair. // TODO(tommi): Remove `selected()` once not referenced downstream. @@ -436,7 +433,6 @@ class Connection : public CandidatePairInterface { absl::optional unwritable_min_checks_ RTC_GUARDED_BY(network_thread_); absl::optional inactive_timeout_ RTC_GUARDED_BY(network_thread_); - bool reported_ RTC_GUARDED_BY(network_thread_); IceCandidatePairState state_ RTC_GUARDED_BY(network_thread_); // Time duration to switch from receiving to not receiving. absl::optional receiving_timeout_ RTC_GUARDED_BY(network_thread_); diff --git a/p2p/base/connection_info.cc b/p2p/base/connection_info.cc index d0cd3239f1..363d32954e 100644 --- a/p2p/base/connection_info.cc +++ b/p2p/base/connection_info.cc @@ -17,7 +17,6 @@ ConnectionInfo::ConnectionInfo() writable(false), receiving(false), timeout(false), - new_connection(false), rtt(0), sent_discarded_bytes(0), sent_total_bytes(0), diff --git a/p2p/base/connection_info.h b/p2p/base/connection_info.h index 1117595481..a30b636d86 100644 --- a/p2p/base/connection_info.h +++ b/p2p/base/connection_info.h @@ -39,7 +39,6 @@ struct ConnectionInfo { bool writable; // Has this connection received a STUN response? bool receiving; // Has this connection received anything? bool timeout; // Has this connection timed out? - bool new_connection; // Is this a newly created connection? size_t rtt; // The STUN RTT for this connection. size_t sent_discarded_bytes; // Number of outgoing bytes discarded due to // socket errors. diff --git a/p2p/base/p2p_transport_channel.cc b/p2p/base/p2p_transport_channel.cc index 47163e4e33..d62fa227f7 100644 --- a/p2p/base/p2p_transport_channel.cc +++ b/p2p/base/p2p_transport_channel.cc @@ -1653,7 +1653,6 @@ bool P2PTransportChannel::GetStats(IceTransportStats* ice_transport_stats) { stats.remote_candidate = SanitizeRemoteCandidate(stats.remote_candidate); stats.best_connection = (selected_connection_ == connection); ice_transport_stats->connection_infos.push_back(std::move(stats)); - connection->set_reported(true); } ice_transport_stats->selected_candidate_pair_changes = diff --git a/p2p/base/p2p_transport_channel_unittest.cc b/p2p/base/p2p_transport_channel_unittest.cc index 2a1e993766..aaa5f6ba87 100644 --- a/p2p/base/p2p_transport_channel_unittest.cc +++ b/p2p/base/p2p_transport_channel_unittest.cc @@ -1367,7 +1367,6 @@ TEST_F(P2PTransportChannelTest, GetStats) { } } ASSERT_TRUE(best_conn_info != nullptr); - EXPECT_TRUE(best_conn_info->new_connection); EXPECT_TRUE(best_conn_info->receiving); EXPECT_TRUE(best_conn_info->writable); EXPECT_FALSE(best_conn_info->timeout); @@ -1418,7 +1417,6 @@ TEST_F(P2PTransportChannelTest, GetStatsSwitchConnection) { } } ASSERT_TRUE(best_conn_info != nullptr); - EXPECT_TRUE(best_conn_info->new_connection); EXPECT_TRUE(best_conn_info->receiving); EXPECT_TRUE(best_conn_info->writable); EXPECT_FALSE(best_conn_info->timeout);