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

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

Issue 2386783002: Add UMA metrics for ICE regathering reasons. (Closed)
Patch Set: . 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..0e891777795846a2ffd72c9d1c6346b9c4ee798f 100644
--- a/webrtc/p2p/base/p2ptransportchannel.cc
+++ b/webrtc/p2p/base/p2ptransportchannel.cc
@@ -470,10 +470,21 @@ void P2PTransportChannel::MaybeStartGathering() {
OnCandidatesAllocationDone(raw_pooled_session);
}
} else {
+ 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;
+ }
+ PortAllocatorSession* session = allocator_session();
+ session->SignalIceRegatheringReason(session, reason);
Taylor Brandstetter 2016/10/03 20:33:34 Calling another class's signal breaks encapsulatio
honghaiz3 2016/10/04 01:03:54 We can, but it would require some wiring of the po
Taylor Brandstetter 2016/10/04 02:42:32 I think that's the right thing to do. We'll need t
honghaiz3 2016/10/05 05:01:53 Done.
+ }
Taylor Brandstetter 2016/10/03 20:33:34 I think this should be outside the if/else block,
honghaiz3 2016/10/04 01:03:54 Done.
AddAllocatorSession(allocator_->CreateSession(
transport_name(), component(), ice_parameters_.ufrag,
ice_parameters_.pwd));
- LOG(LS_INFO) << "Start getting ports";
Taylor Brandstetter 2016/10/03 20:33:34 Why remove this log statement? Is there another on
honghaiz3 2016/10/04 01:03:54 I moved it to StartGettingPorts(). It is better to
allocator_sessions_.back()->StartGettingPorts();
}
}

Powered by Google App Engine
This is Rietveld 408576698