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}
This commit is contained in:
Guo-wei Shieh
2015-09-03 17:12:07 -07:00
parent 9743d076ac
commit dfbe679ded
3 changed files with 6 additions and 15 deletions

View File

@ -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);
}
}
}

View File

@ -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

View File

@ -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);