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

Side by Side Diff: content/renderer/media/rtc_peer_connection_handler.cc

Issue 2776853002: Make UMA_HISTOGRAM_ENUMERATION work with scoped enums. (Closed)
Patch Set: iOS, Windows, and CrOS compile fixes Created 3 years, 9 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/rtc_peer_connection_handler.h" 5 #include "content/renderer/media/rtc_peer_connection_handler.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 770
771 class PeerConnectionUMAObserver : public webrtc::UMAObserver { 771 class PeerConnectionUMAObserver : public webrtc::UMAObserver {
772 public: 772 public:
773 PeerConnectionUMAObserver() {} 773 PeerConnectionUMAObserver() {}
774 ~PeerConnectionUMAObserver() override {} 774 ~PeerConnectionUMAObserver() override {}
775 void IncrementEnumCounter(webrtc::PeerConnectionEnumCounterType counter_type, 775 void IncrementEnumCounter(webrtc::PeerConnectionEnumCounterType counter_type,
776 int counter, 776 int counter,
777 int counter_max) override { 777 int counter_max) override {
778 switch (counter_type) { 778 switch (counter_type) {
779 case webrtc::kEnumCounterAddressFamily: 779 case webrtc::kEnumCounterAddressFamily:
780 UMA_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.IPMetrics", counter, 780 UMA_HISTOGRAM_EXACT_LINEAR("WebRTC.PeerConnection.IPMetrics", counter,
781 counter_max); 781 counter_max);
782 break; 782 break;
783 case webrtc::kEnumCounterIceCandidatePairTypeUdp: 783 case webrtc::kEnumCounterIceCandidatePairTypeUdp:
784 UMA_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.CandidatePairType_UDP", 784 UMA_HISTOGRAM_EXACT_LINEAR(
785 counter, counter_max); 785 "WebRTC.PeerConnection.CandidatePairType_UDP", counter,
786 counter_max);
786 break; 787 break;
787 case webrtc::kEnumCounterIceCandidatePairTypeTcp: 788 case webrtc::kEnumCounterIceCandidatePairTypeTcp:
788 UMA_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.CandidatePairType_TCP", 789 UMA_HISTOGRAM_EXACT_LINEAR(
789 counter, counter_max); 790 "WebRTC.PeerConnection.CandidatePairType_TCP", counter,
791 counter_max);
790 break; 792 break;
791 case webrtc::kEnumCounterDtlsHandshakeError: 793 case webrtc::kEnumCounterDtlsHandshakeError:
792 UMA_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.DtlsHandshakeError", 794 UMA_HISTOGRAM_EXACT_LINEAR("WebRTC.PeerConnection.DtlsHandshakeError",
793 counter, counter_max); 795 counter, counter_max);
794 break; 796 break;
795 case webrtc::kEnumCounterIceRestart: 797 case webrtc::kEnumCounterIceRestart:
796 UMA_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.IceRestartState", 798 UMA_HISTOGRAM_EXACT_LINEAR("WebRTC.PeerConnection.IceRestartState",
797 counter, counter_max); 799 counter, counter_max);
798 break; 800 break;
799 case webrtc::kEnumCounterIceRegathering: 801 case webrtc::kEnumCounterIceRegathering:
800 UMA_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.IceRegatheringReason", 802 UMA_HISTOGRAM_EXACT_LINEAR("WebRTC.PeerConnection.IceRegatheringReason",
801 counter, counter_max); 803 counter, counter_max);
802 break; 804 break;
803 default: 805 default:
804 // The default clause is expected to reach when new enum types are 806 // The default clause is expected to reach when new enum types are
805 // added. 807 // added.
806 break; 808 break;
807 } 809 }
808 } 810 }
809 811
810 void IncrementSparseEnumCounter( 812 void IncrementSparseEnumCounter(
811 webrtc::PeerConnectionEnumCounterType counter_type, 813 webrtc::PeerConnectionEnumCounterType counter_type,
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
2005 } 2007 }
2006 2008
2007 void RTCPeerConnectionHandler::ResetUMAStats() { 2009 void RTCPeerConnectionHandler::ResetUMAStats() {
2008 DCHECK(thread_checker_.CalledOnValidThread()); 2010 DCHECK(thread_checker_.CalledOnValidThread());
2009 num_local_candidates_ipv6_ = 0; 2011 num_local_candidates_ipv6_ = 0;
2010 num_local_candidates_ipv4_ = 0; 2012 num_local_candidates_ipv4_ = 0;
2011 ice_connection_checking_start_ = base::TimeTicks(); 2013 ice_connection_checking_start_ = base::TimeTicks();
2012 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); 2014 memset(ice_state_seen_, 0, sizeof(ice_state_seen_));
2013 } 2015 }
2014 } // namespace content 2016 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698