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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 // Process the pooled session's existing candidates/ports, if they exist. 463 // Process the pooled session's existing candidates/ports, if they exist.
464 OnCandidatesReady(raw_pooled_session, 464 OnCandidatesReady(raw_pooled_session,
465 raw_pooled_session->ReadyCandidates()); 465 raw_pooled_session->ReadyCandidates());
466 for (PortInterface* port : allocator_sessions_.back()->ReadyPorts()) { 466 for (PortInterface* port : allocator_sessions_.back()->ReadyPorts()) {
467 OnPortReady(raw_pooled_session, port); 467 OnPortReady(raw_pooled_session, port);
468 } 468 }
469 if (allocator_sessions_.back()->CandidatesAllocationDone()) { 469 if (allocator_sessions_.back()->CandidatesAllocationDone()) {
470 OnCandidatesAllocationDone(raw_pooled_session); 470 OnCandidatesAllocationDone(raw_pooled_session);
471 } 471 }
472 } else { 472 } else {
473 if (!allocator_sessions_.empty()) {
474 IceRegatheringReason reason;
475 if (writable()) {
476 reason = IceRegatheringReason::ICE_RESTART_WHEN_CONNECTED;
477 } else if (IsGettingPorts()) {
478 reason = IceRegatheringReason::ICE_RESTART_WHEN_CONNECTING;
479 } else {
480 reason = IceRegatheringReason::ICE_RESTART_WHEN_DISCONNECTED;
481 }
482 PortAllocatorSession* session = allocator_session();
483 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.
484 }
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.
473 AddAllocatorSession(allocator_->CreateSession( 485 AddAllocatorSession(allocator_->CreateSession(
474 transport_name(), component(), ice_parameters_.ufrag, 486 transport_name(), component(), ice_parameters_.ufrag,
475 ice_parameters_.pwd)); 487 ice_parameters_.pwd));
476 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
477 allocator_sessions_.back()->StartGettingPorts(); 488 allocator_sessions_.back()->StartGettingPorts();
478 } 489 }
479 } 490 }
480 } 491 }
481 492
482 // A new port is available, attempt to make connections for it 493 // A new port is available, attempt to make connections for it
483 void P2PTransportChannel::OnPortReady(PortAllocatorSession *session, 494 void P2PTransportChannel::OnPortReady(PortAllocatorSession *session,
484 PortInterface* port) { 495 PortInterface* port) {
485 ASSERT(network_thread_ == rtc::Thread::Current()); 496 ASSERT(network_thread_ == rtc::Thread::Current());
486 497
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1967 1978
1968 // During the initial state when nothing has been pinged yet, return the first 1979 // During the initial state when nothing has been pinged yet, return the first
1969 // one in the ordered |connections_|. 1980 // one in the ordered |connections_|.
1970 return *(std::find_if(connections_.begin(), connections_.end(), 1981 return *(std::find_if(connections_.begin(), connections_.end(),
1971 [conn1, conn2](Connection* conn) { 1982 [conn1, conn2](Connection* conn) {
1972 return conn == conn1 || conn == conn2; 1983 return conn == conn1 || conn == conn2;
1973 })); 1984 }));
1974 } 1985 }
1975 1986
1976 } // namespace cricket 1987 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698