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:
@ -712,9 +712,13 @@ void PeerConnection::RegisterUMAObserver(UMAObserver* observer) {
|
|||||||
// Send information about IPv4/IPv6 status.
|
// Send information about IPv4/IPv6 status.
|
||||||
if (uma_observer_ && port_allocator_) {
|
if (uma_observer_ && port_allocator_) {
|
||||||
if (port_allocator_->flags() & cricket::PORTALLOCATOR_ENABLE_IPV6) {
|
if (port_allocator_->flags() & cricket::PORTALLOCATOR_ENABLE_IPV6) {
|
||||||
uma_observer_->IncrementCounter(kPeerConnection_IPv6);
|
uma_observer_->IncrementEnumCounter(
|
||||||
|
kEnumCounterAddressFamily, kPeerConnection_IPv6,
|
||||||
|
kPeerConnectionAddressFamilyCounter_Max);
|
||||||
} else {
|
} else {
|
||||||
uma_observer_->IncrementCounter(kPeerConnection_IPv4);
|
uma_observer_->IncrementEnumCounter(
|
||||||
|
kEnumCounterAddressFamily, kPeerConnection_IPv4,
|
||||||
|
kPeerConnectionAddressFamilyCounter_Max);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,12 +127,6 @@ class StatsObserver : public rtc::RefCountInterface {
|
|||||||
|
|
||||||
class MetricsObserverInterface : public rtc::RefCountInterface {
|
class MetricsObserverInterface : public rtc::RefCountInterface {
|
||||||
public:
|
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|
|
// |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
|
// is the particular counter in that type. |counter_max| is the next sequence
|
||||||
|
@ -2033,18 +2033,11 @@ void WebRtcSession::ReportBestConnectionState(
|
|||||||
|
|
||||||
// Increment the counter for IP type.
|
// Increment the counter for IP type.
|
||||||
if (local.address().family() == AF_INET) {
|
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(
|
metrics_observer_->IncrementEnumCounter(
|
||||||
kEnumCounterAddressFamily, kBestConnections_IPv4,
|
kEnumCounterAddressFamily, kBestConnections_IPv4,
|
||||||
kPeerConnectionAddressFamilyCounter_Max);
|
kPeerConnectionAddressFamilyCounter_Max);
|
||||||
|
|
||||||
} else if (local.address().family() == AF_INET6) {
|
} else if (local.address().family() == AF_INET6) {
|
||||||
// TODO(guoweis): Remove this next line.
|
|
||||||
metrics_observer_->IncrementCounter(kBestConnections_IPv6);
|
|
||||||
|
|
||||||
metrics_observer_->IncrementEnumCounter(
|
metrics_observer_->IncrementEnumCounter(
|
||||||
kEnumCounterAddressFamily, kBestConnections_IPv6,
|
kEnumCounterAddressFamily, kBestConnections_IPv6,
|
||||||
kPeerConnectionAddressFamilyCounter_Max);
|
kPeerConnectionAddressFamilyCounter_Max);
|
||||||
|
Reference in New Issue
Block a user