Commit af79e730 authored by Steve Anton's avatar Steve Anton Committed by Commit Bot

Report SdpSemanticRequested in Chromium PeerConnection

This moves the reporting for the SdpSemanticRequested UMA metric
to the PeerConnection handler directly and removes the usage of
the SdpSemantic::kDefault WebRTC value.

Bug: 811683
Change-Id: Icecd551e40fb174eb21a5bd48943d5f8b522dd42
Reviewed-on: https://chromium-review.googlesource.com/944248
Commit-Queue: Steve Anton <steveanton@chromium.org>
Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Reviewed-by: default avatarHarald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550306}
parent 0da5a0c8
......@@ -260,8 +260,6 @@ void GetNativeRtcConfiguration(
switch (blink_config.sdp_semantics) {
case blink::WebRTCSdpSemantics::kDefault:
webrtc_config->sdp_semantics = webrtc::SdpSemantics::kDefault;
break;
case blink::WebRTCSdpSemantics::kPlanB:
webrtc_config->sdp_semantics = webrtc::SdpSemantics::kPlanB;
break;
......@@ -748,12 +746,6 @@ class PeerConnectionUMAObserver : public webrtc::UMAObserver {
static_cast<webrtc::KeyExchangeProtocolType>(counter),
webrtc::kEnumCounterKeyProtocolMax);
break;
case webrtc::kEnumCounterSdpSemanticRequested:
UMA_HISTOGRAM_ENUMERATION(
"WebRTC.PeerConnection.SdpSemanticRequested",
static_cast<webrtc::SdpSemanticRequested>(counter),
webrtc::kSdpSemanticRequestMax);
break;
case webrtc::kEnumCounterSdpSemanticNegotiated:
UMA_HISTOGRAM_ENUMERATION(
"WebRTC.PeerConnection.SdpSemanticNegotiated",
......@@ -930,6 +922,27 @@ size_t GetRemoteStreamUsageCount(
return usage_count;
}
enum SdpSemanticRequested {
kSdpSemanticRequestedDefault,
kSdpSemanticRequestedPlanB,
kSdpSemanticRequestedUnifiedPlan,
kSdpSemanticRequestedMax
};
SdpSemanticRequested GetSdpSemanticRequested(
blink::WebRTCSdpSemantics sdp_semantics) {
switch (sdp_semantics) {
case blink::WebRTCSdpSemantics::kDefault:
return kSdpSemanticRequestedDefault;
case blink::WebRTCSdpSemantics::kPlanB:
return kSdpSemanticRequestedPlanB;
case blink::WebRTCSdpSemantics::kUnifiedPlan:
return kSdpSemanticRequestedUnifiedPlan;
}
NOTREACHED();
return kSdpSemanticRequestedDefault;
}
} // namespace
// Implementation of LocalRTCStatsRequest.
......@@ -1354,6 +1367,12 @@ bool RTCPeerConnectionHandler::Initialize(
uma_observer_ = new rtc::RefCountedObject<PeerConnectionUMAObserver>();
native_peer_connection_->RegisterUMAObserver(uma_observer_.get());
UMA_HISTOGRAM_ENUMERATION(
"WebRTC.PeerConnection.SdpSemanticRequested",
GetSdpSemanticRequested(server_configuration.sdp_semantics),
kSdpSemanticRequestedMax);
return true;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment