From dfbe679dedfa7048c4951138d192c07d65e268cc Mon Sep 17 00:00:00 2001 From: Guo-wei Shieh Date: Thu, 3 Sep 2015 17:12:07 -0700 Subject: [PATCH] Cleanup: Remove duplicated functions IncrementCounter has been replaced by IncrementEnumCounter. Since the code has been rolled into Chromium, time to clean this up. R=pthatcher@chromium.org TBR=pthatcher@webrtc.org BUG= Review URL: https://codereview.webrtc.org/1312763013 . Cr-Commit-Position: refs/heads/master@{#9852} --- talk/app/webrtc/peerconnection.cc | 8 ++++++-- talk/app/webrtc/peerconnectioninterface.h | 6 ------ talk/app/webrtc/webrtcsession.cc | 7 ------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/talk/app/webrtc/peerconnection.cc b/talk/app/webrtc/peerconnection.cc index c147aef565..41df847cd6 100644 --- a/talk/app/webrtc/peerconnection.cc +++ b/talk/app/webrtc/peerconnection.cc @@ -712,9 +712,13 @@ void PeerConnection::RegisterUMAObserver(UMAObserver* observer) { // Send information about IPv4/IPv6 status. if (uma_observer_ && port_allocator_) { if (port_allocator_->flags() & cricket::PORTALLOCATOR_ENABLE_IPV6) { - uma_observer_->IncrementCounter(kPeerConnection_IPv6); + uma_observer_->IncrementEnumCounter( + kEnumCounterAddressFamily, kPeerConnection_IPv6, + kPeerConnectionAddressFamilyCounter_Max); } else { - uma_observer_->IncrementCounter(kPeerConnection_IPv4); + uma_observer_->IncrementEnumCounter( + kEnumCounterAddressFamily, kPeerConnection_IPv4, + kPeerConnectionAddressFamilyCounter_Max); } } } diff --git a/talk/app/webrtc/peerconnectioninterface.h b/talk/app/webrtc/peerconnectioninterface.h index a3af0e715c..ca853385e6 100644 --- a/talk/app/webrtc/peerconnectioninterface.h +++ b/talk/app/webrtc/peerconnectioninterface.h @@ -127,12 +127,6 @@ class StatsObserver : public rtc::RefCountInterface { class MetricsObserverInterface : public rtc::RefCountInterface { public: - // TODO(guoweis): Remove this function once IncrementEnumCounter gets into - // chromium. IncrementCounter only deals with one type of enumeration counter, - // i.e. PeerConnectionAddressFamilyCounter. Instead of creating a function for - // each enum type, IncrementEnumCounter is generalized with the enum type - // parameter. - virtual void IncrementCounter(PeerConnectionAddressFamilyCounter type) {} // |type| is the type of the enum counter to be incremented. |counter| // is the particular counter in that type. |counter_max| is the next sequence diff --git a/talk/app/webrtc/webrtcsession.cc b/talk/app/webrtc/webrtcsession.cc index 838ad93af1..9102e78eea 100644 --- a/talk/app/webrtc/webrtcsession.cc +++ b/talk/app/webrtc/webrtcsession.cc @@ -2033,18 +2033,11 @@ void WebRtcSession::ReportBestConnectionState( // Increment the counter for IP type. if (local.address().family() == AF_INET) { - // TODO(guoweis): Remove this next line once IncrementEnumCounter - // implemented for PeerConnectionMetrics. - metrics_observer_->IncrementCounter(kBestConnections_IPv4); - metrics_observer_->IncrementEnumCounter( kEnumCounterAddressFamily, kBestConnections_IPv4, kPeerConnectionAddressFamilyCounter_Max); } else if (local.address().family() == AF_INET6) { - // TODO(guoweis): Remove this next line. - metrics_observer_->IncrementCounter(kBestConnections_IPv6); - metrics_observer_->IncrementEnumCounter( kEnumCounterAddressFamily, kBestConnections_IPv6, kPeerConnectionAddressFamilyCounter_Max);