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

Unified Diff: webrtc/p2p/base/p2ptransportchannel.cc

Issue 2386783002: Add UMA metrics for ICE regathering reasons. (Closed)
Patch Set: Address comments Created 4 years, 2 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
Index: webrtc/p2p/base/p2ptransportchannel.cc
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc
index 3f68d6d6e078fd635e8f696b3b46ae12bae8ce67..6aeac99a75ef4ea39fdbe46a896e4251d67d713d 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -451,6 +451,19 @@ void P2PTransportChannel::MaybeStartGathering() {
gathering_state_ = kIceGatheringGathering;
SignalGatheringState(this);
}
+
+ if (!allocator_sessions_.empty()) {
+ IceRegatheringReason reason;
+ if (writable()) {
+ reason = IceRegatheringReason::ICE_RESTART_WHEN_CONNECTED;
+ } else if (IsGettingPorts()) {
+ reason = IceRegatheringReason::ICE_RESTART_WHEN_CONNECTING;
+ } else {
+ reason = IceRegatheringReason::ICE_RESTART_WHEN_DISCONNECTED;
+ }
+ allocator_->ReportIceRegatheringReason(reason);
+ }
+
// Time for a new allocator.
std::unique_ptr<PortAllocatorSession> pooled_session =
allocator_->TakePooledSession(transport_name(), component(),
@@ -473,7 +486,6 @@ void P2PTransportChannel::MaybeStartGathering() {
AddAllocatorSession(allocator_->CreateSession(
transport_name(), component(), ice_parameters_.ufrag,
ice_parameters_.pwd));
- LOG(LS_INFO) << "Start getting ports";
allocator_sessions_.back()->StartGettingPorts();
}
}

Powered by Google App Engine
This is Rietveld 408576698