| OLD | NEW | 
|     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> |     7 #include <string> | 
|     8 #include <utility> |     8 #include <utility> | 
|     9 #include <vector> |     9 #include <vector> | 
|    10  |    10  | 
|    11 #include "base/command_line.h" |    11 #include "base/command_line.h" | 
|    12 #include "base/lazy_instance.h" |    12 #include "base/lazy_instance.h" | 
|    13 #include "base/location.h" |    13 #include "base/location.h" | 
|    14 #include "base/logging.h" |    14 #include "base/logging.h" | 
|    15 #include "base/memory/scoped_ptr.h" |    15 #include "base/memory/scoped_ptr.h" | 
|    16 #include "base/metrics/histogram.h" |    16 #include "base/metrics/histogram.h" | 
 |    17 #include "base/metrics/sparse_histogram.h" | 
|    17 #include "base/stl_util.h" |    18 #include "base/stl_util.h" | 
|    18 #include "base/strings/utf_string_conversions.h" |    19 #include "base/strings/utf_string_conversions.h" | 
|    19 #include "base/thread_task_runner_handle.h" |    20 #include "base/thread_task_runner_handle.h" | 
|    20 #include "base/trace_event/trace_event.h" |    21 #include "base/trace_event/trace_event.h" | 
|    21 #include "content/public/common/content_switches.h" |    22 #include "content/public/common/content_switches.h" | 
|    22 #include "content/renderer/media/media_stream_track.h" |    23 #include "content/renderer/media/media_stream_track.h" | 
|    23 #include "content/renderer/media/peer_connection_tracker.h" |    24 #include "content/renderer/media/peer_connection_tracker.h" | 
|    24 #include "content/renderer/media/remote_media_stream_impl.h" |    25 #include "content/renderer/media/remote_media_stream_impl.h" | 
|    25 #include "content/renderer/media/rtc_data_channel_handler.h" |    26 #include "content/renderer/media/rtc_data_channel_handler.h" | 
|    26 #include "content/renderer/media/rtc_dtmf_sender_handler.h" |    27 #include "content/renderer/media/rtc_dtmf_sender_handler.h" | 
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   545         UMA_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.CandidatePairType_TCP", |   546         UMA_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.CandidatePairType_TCP", | 
|   546                                   counter, counter_max); |   547                                   counter, counter_max); | 
|   547         break; |   548         break; | 
|   548       default: |   549       default: | 
|   549         // The default clause is expected to reach when new enum types are |   550         // The default clause is expected to reach when new enum types are | 
|   550         // added. |   551         // added. | 
|   551         break; |   552         break; | 
|   552     } |   553     } | 
|   553   } |   554   } | 
|   554  |   555  | 
 |   556   void IncrementSparseEnumCounter( | 
 |   557       webrtc::PeerConnectionEnumCounterType counter_type, | 
 |   558       int counter) override { | 
 |   559     switch (counter_type) { | 
 |   560       case webrtc::kEnumCounterAudioSrtpCipher: | 
 |   561         UMA_HISTOGRAM_SPARSE_SLOWLY( | 
 |   562             "WebRTC.PeerConnection.SrtpCryptoSuite.Audio", counter); | 
 |   563         break; | 
 |   564       case webrtc::kEnumCounterAudioSslCipher: | 
 |   565         UMA_HISTOGRAM_SPARSE_SLOWLY( | 
 |   566             "WebRTC.PeerConnection.SslCipherSuite.Audio", counter); | 
 |   567         break; | 
 |   568       case webrtc::kEnumCounterVideoSrtpCipher: | 
 |   569         UMA_HISTOGRAM_SPARSE_SLOWLY( | 
 |   570             "WebRTC.PeerConnection.SrtpCryptoSuite.Video", counter); | 
 |   571         break; | 
 |   572       case webrtc::kEnumCounterVideoSslCipher: | 
 |   573         UMA_HISTOGRAM_SPARSE_SLOWLY( | 
 |   574             "WebRTC.PeerConnection.SslCipherSuite.Video", counter); | 
 |   575         break; | 
 |   576       case webrtc::kEnumCounterDataSrtpCipher: | 
 |   577         UMA_HISTOGRAM_SPARSE_SLOWLY( | 
 |   578             "WebRTC.PeerConnection.SrtpCryptoSuite.Data", counter); | 
 |   579         break; | 
 |   580       case webrtc::kEnumCounterDataSslCipher: | 
 |   581         UMA_HISTOGRAM_SPARSE_SLOWLY("WebRTC.PeerConnection.SslCipherSuite.Data", | 
 |   582                                     counter); | 
 |   583         break; | 
 |   584       default: | 
 |   585         // The default clause is expected to reach when new enum types are | 
 |   586         // added. | 
 |   587         break; | 
 |   588     } | 
 |   589   } | 
 |   590  | 
|   555   void AddHistogramSample(webrtc::PeerConnectionUMAMetricsName type, |   591   void AddHistogramSample(webrtc::PeerConnectionUMAMetricsName type, | 
|   556                           int value) override { |   592                           int value) override { | 
|   557     // Runs on libjingle's signaling thread. |   593     // Runs on libjingle's signaling thread. | 
|   558     switch (type) { |   594     switch (type) { | 
|   559       case webrtc::kTimeToConnect: |   595       case webrtc::kTimeToConnect: | 
|   560         UMA_HISTOGRAM_MEDIUM_TIMES( |   596         UMA_HISTOGRAM_MEDIUM_TIMES( | 
|   561             "WebRTC.PeerConnection.TimeToConnect", |   597             "WebRTC.PeerConnection.TimeToConnect", | 
|   562             base::TimeDelta::FromMilliseconds(value)); |   598             base::TimeDelta::FromMilliseconds(value)); | 
|   563         break; |   599         break; | 
|   564       case webrtc::kNetworkInterfaces_IPv4: |   600       case webrtc::kNetworkInterfaces_IPv4: | 
| (...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1628 } |  1664 } | 
|  1629  |  1665  | 
|  1630 void RTCPeerConnectionHandler::ResetUMAStats() { |  1666 void RTCPeerConnectionHandler::ResetUMAStats() { | 
|  1631   DCHECK(thread_checker_.CalledOnValidThread()); |  1667   DCHECK(thread_checker_.CalledOnValidThread()); | 
|  1632   num_local_candidates_ipv6_ = 0; |  1668   num_local_candidates_ipv6_ = 0; | 
|  1633   num_local_candidates_ipv4_ = 0; |  1669   num_local_candidates_ipv4_ = 0; | 
|  1634   ice_connection_checking_start_ = base::TimeTicks(); |  1670   ice_connection_checking_start_ = base::TimeTicks(); | 
|  1635   memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); |  1671   memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); | 
|  1636 } |  1672 } | 
|  1637 }  // namespace content |  1673 }  // namespace content | 
| OLD | NEW |