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}
diff --git a/talk/app/webrtc/peerconnection.cc b/talk/app/webrtc/peerconnection.cc
index c147aef..41df847 100644
--- a/talk/app/webrtc/peerconnection.cc
+++ b/talk/app/webrtc/peerconnection.cc
@@ -712,9 +712,13 @@
// 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 a3af0e7..ca85338 100644
--- a/talk/app/webrtc/peerconnectioninterface.h
+++ b/talk/app/webrtc/peerconnectioninterface.h
@@ -127,12 +127,6 @@
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 838ad93..9102e78 100644
--- a/talk/app/webrtc/webrtcsession.cc
+++ b/talk/app/webrtc/webrtcsession.cc
@@ -2033,18 +2033,11 @@
// 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);