From 66cadcc6b924f027afb60a9b5932d4af3dc6a1d5 Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Tue, 19 Jun 2018 16:47:43 +0200 Subject: [PATCH] Replace rtc::Optional with absl::optional in pc This is a no-op change because rtc::Optional is an alias to absl::optional This CL generated by running script with parameter 'pc' find $@ -type f \( -name \*.h -o -name \*.cc \) \ -exec sed -i 's|rtc::Optional|absl::optional|g' {} \+ \ -exec sed -i 's|rtc::nullopt|absl::nullopt|g' {} \+ \ -exec sed -i 's|#include "api/optional.h"|#include "absl/types/optional.h"|' {} \+ find $@ -type f -name BUILD.gn \ -exec sed -r -i 's|"[\./api]*:optional"|"//third_party/abseil-cpp/absl/types:optional"|' {} \+; git cl format Bug: webrtc:9078 Change-Id: Ide3b9eb32df7f25991f898ac58fcb119c9f8ae12 Reviewed-on: https://webrtc-review.googlesource.com/84181 Reviewed-by: Per Kjellander Commit-Queue: Danil Chapovalov Cr-Commit-Position: refs/heads/master@{#23669} --- pc/BUILD.gn | 6 +-- pc/channel.cc | 2 +- pc/channel.h | 2 +- pc/channel_unittest.cc | 10 ++-- pc/dtlssrtptransport.h | 4 +- pc/jsepsessiondescription.cc | 10 ++-- pc/jseptransport.cc | 12 ++--- pc/jseptransport.h | 16 +++--- pc/jseptransport_unittest.cc | 6 +-- pc/jseptransportcontroller.cc | 6 +-- pc/jseptransportcontroller.h | 10 ++-- pc/jseptransportcontroller_unittest.cc | 2 +- pc/localaudiosource_unittest.cc | 2 +- pc/mediasession.cc | 2 +- pc/peerconnection.cc | 66 +++++++++++------------ pc/peerconnection.h | 16 +++--- pc/peerconnection_datachannel_unittest.cc | 4 +- pc/peerconnection_ice_unittest.cc | 2 +- pc/peerconnection_jsep_unittest.cc | 24 ++++----- pc/peerconnection_rtp_unittest.cc | 4 +- pc/peerconnectionendtoend_unittest.cc | 20 +++---- pc/peerconnectioninterface_unittest.cc | 2 +- pc/peerconnectioninternal.h | 4 +- pc/rtcstatscollector.h | 6 +-- pc/rtcstatscollector_unittest.cc | 6 +-- pc/rtpreceiver.h | 4 +- pc/rtpsender.h | 4 +- pc/rtpsenderreceiver_unittest.cc | 2 +- pc/rtptransceiver.cc | 6 +-- pc/rtptransceiver.h | 20 +++---- pc/rtptransport.cc | 6 +-- pc/rtptransport.h | 2 +- pc/rtptransport_unittest.cc | 10 ++-- pc/rtptransportinternal.h | 2 +- pc/srtpfilter.cc | 4 +- pc/srtpfilter.h | 10 ++-- pc/srtptransport.cc | 2 +- pc/srtptransport.h | 10 ++-- pc/test/fakepeerconnectionbase.h | 8 +-- pc/test/fakepeerconnectionforstats.h | 4 +- pc/test/fakertccertificategenerator.h | 2 +- pc/test/fakesctptransport.h | 4 +- pc/test/mockpeerconnectionobservers.h | 2 +- pc/trackmediainfomap.cc | 6 +-- pc/trackmediainfomap.h | 6 +-- pc/trackmediainfomap_unittest.cc | 2 +- pc/videocapturertracksource.cc | 2 +- pc/videocapturertracksource.h | 6 ++- pc/videocapturertracksource_unittest.cc | 11 ++-- pc/videotracksource.h | 4 +- pc/webrtcsdp.cc | 2 +- pc/webrtcsessiondescriptionfactory.cc | 2 +- 52 files changed, 196 insertions(+), 191 deletions(-) diff --git a/pc/BUILD.gn b/pc/BUILD.gn index 704b459c6f..405c2a522a 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -68,7 +68,6 @@ rtc_static_library("rtc_pc_base") { "../api:array_view", "../api:call_api", "../api:libjingle_peerconnection_api", - "../api:optional", "../api:ortc_api", "../api/video:video_frame", "../call:rtp_interfaces", @@ -86,6 +85,7 @@ rtc_static_library("rtc_pc_base") { "../rtc_base:rtc_task_queue", "../rtc_base:stringutils", "../system_wrappers:metrics_api", + "//third_party/abseil-cpp/absl/types:optional", ] if (rtc_build_libsrtp) { @@ -193,7 +193,6 @@ rtc_static_library("peerconnection") { "../api:call_api", "../api:fec_controller_api", "../api:libjingle_peerconnection_api", - "../api:optional", "../api:rtc_stats_api", "../api/video:video_frame", "../api/video_codecs:video_codecs_api", @@ -215,6 +214,7 @@ rtc_static_library("peerconnection") { "../stats", "../system_wrappers", "../system_wrappers:field_trial_api", + "//third_party/abseil-cpp/absl/types:optional", ] } @@ -506,7 +506,6 @@ if (rtc_include_tests) { "../api:callfactory_api", "../api:fakemetricsobserver", "../api:libjingle_peerconnection_test_api", - "../api:optional", "../api:rtc_stats_api", "../api/audio_codecs:audio_codecs_api", "../api/audio_codecs:builtin_audio_decoder_factory", @@ -538,6 +537,7 @@ if (rtc_include_tests) { "../system_wrappers:runtime_enabled_features_default", "../test:audio_codec_mocks", "../test:test_support", + "//third_party/abseil-cpp/absl/types:optional", ] if (is_android) { diff --git a/pc/channel.cc b/pc/channel.cc index 8ee2ba5996..713cd39945 100644 --- a/pc/channel.cc +++ b/pc/channel.cc @@ -363,7 +363,7 @@ void BaseChannel::OnWritableState(bool writable) { } void BaseChannel::OnNetworkRouteChanged( - rtc::Optional network_route) { + absl::optional network_route) { RTC_DCHECK(network_thread_->IsCurrent()); rtc::NetworkRoute new_route; if (network_route) { diff --git a/pc/channel.h b/pc/channel.h index 6dd2709f5c..35be5c5d2e 100644 --- a/pc/channel.h +++ b/pc/channel.h @@ -218,7 +218,7 @@ class BaseChannel : public rtc::MessageHandler, // From RtpTransportInternal void OnWritableState(bool writable); - void OnNetworkRouteChanged(rtc::Optional network_route); + void OnNetworkRouteChanged(absl::optional network_route); bool PacketIsRtcp(const rtc::PacketTransportInternal* transport, const char* data, diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc index f8548264c0..29d2bd7229 100644 --- a/pc/channel_unittest.cc +++ b/pc/channel_unittest.cc @@ -863,7 +863,7 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { // The transport channel becomes disconnected. fake_rtp_dtls_transport1_->ice_transport()->SignalNetworkRouteChanged( - rtc::Optional(network_route)); + absl::optional(network_route)); }); WaitForThreads(); EXPECT_EQ(1, media_channel1->num_network_route_changes()); @@ -880,7 +880,7 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { // The transport channel becomes connected. fake_rtp_dtls_transport1_->ice_transport()->SignalNetworkRouteChanged( - rtc::Optional(network_route)); + absl::optional(network_route)); }); WaitForThreads(); EXPECT_EQ(1, media_channel1->num_network_route_changes()); @@ -1348,7 +1348,7 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { return channel1_->SetRemoteContent(&content, SdpType::kOffer, NULL); } - webrtc::RtpParameters BitrateLimitedParameters(rtc::Optional limit) { + webrtc::RtpParameters BitrateLimitedParameters(absl::optional limit) { webrtc::RtpParameters parameters; webrtc::RtpEncodingParameters encoding; encoding.max_bitrate_bps = std::move(limit); @@ -1357,7 +1357,7 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { } void VerifyMaxBitrate(const webrtc::RtpParameters& parameters, - rtc::Optional expected_bitrate) { + absl::optional expected_bitrate) { EXPECT_EQ(1UL, parameters.encodings.size()); EXPECT_EQ(expected_bitrate, parameters.encodings[0].max_bitrate_bps); } @@ -1368,7 +1368,7 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { SdpType::kOffer, NULL)); EXPECT_EQ(media_channel1_->max_bps(), -1); VerifyMaxBitrate(media_channel1_->GetRtpSendParameters(kSsrc1), - rtc::nullopt); + absl::nullopt); } // Test that when a channel gets new RtpTransport with a call to diff --git a/pc/dtlssrtptransport.h b/pc/dtlssrtptransport.h index a2d7aadf67..498f02e917 100644 --- a/pc/dtlssrtptransport.h +++ b/pc/dtlssrtptransport.h @@ -88,8 +88,8 @@ class DtlsSrtpTransport : public SrtpTransport { cricket::DtlsTransportInternal* rtcp_dtls_transport_ = nullptr; // The encrypted header extension IDs. - rtc::Optional> send_extension_ids_; - rtc::Optional> recv_extension_ids_; + absl::optional> send_extension_ids_; + absl::optional> recv_extension_ids_; bool active_reset_srtp_params_ = false; }; diff --git a/pc/jsepsessiondescription.cc b/pc/jsepsessiondescription.cc index ecd2ee2160..f52faf1ad8 100644 --- a/pc/jsepsessiondescription.cc +++ b/pc/jsepsessiondescription.cc @@ -112,7 +112,7 @@ const char* SdpTypeToString(SdpType type) { return ""; } -rtc::Optional SdpTypeFromString(const std::string& type_str) { +absl::optional SdpTypeFromString(const std::string& type_str) { if (type_str == SessionDescriptionInterface::kOffer) { return SdpType::kOffer; } else if (type_str == SessionDescriptionInterface::kPrAnswer) { @@ -120,14 +120,14 @@ rtc::Optional SdpTypeFromString(const std::string& type_str) { } else if (type_str == SessionDescriptionInterface::kAnswer) { return SdpType::kAnswer; } else { - return rtc::nullopt; + return absl::nullopt; } } // TODO(steveanton): Remove this default implementation once Chromium has been // updated. SdpType SessionDescriptionInterface::GetType() const { - rtc::Optional maybe_type = SdpTypeFromString(type()); + absl::optional maybe_type = SdpTypeFromString(type()); if (maybe_type) { return *maybe_type; } else { @@ -142,7 +142,7 @@ SdpType SessionDescriptionInterface::GetType() const { SessionDescriptionInterface* CreateSessionDescription(const std::string& type, const std::string& sdp, SdpParseError* error) { - rtc::Optional maybe_type = SdpTypeFromString(type); + absl::optional maybe_type = SdpTypeFromString(type); if (!maybe_type) { return nullptr; } @@ -170,7 +170,7 @@ std::unique_ptr CreateSessionDescription( JsepSessionDescription::JsepSessionDescription(SdpType type) : type_(type) {} JsepSessionDescription::JsepSessionDescription(const std::string& type) { - rtc::Optional maybe_type = SdpTypeFromString(type); + absl::optional maybe_type = SdpTypeFromString(type); if (maybe_type) { type_ = *maybe_type; } else { diff --git a/pc/jseptransport.cc b/pc/jseptransport.cc index adce4af14b..bea5d30258 100644 --- a/pc/jseptransport.cc +++ b/pc/jseptransport.cc @@ -284,14 +284,14 @@ void JsepTransport::SetNeedsIceRestartFlag() { } } -rtc::Optional JsepTransport::GetDtlsRole() const { +absl::optional JsepTransport::GetDtlsRole() const { RTC_DCHECK(rtp_dtls_transport_); rtc::SSLRole dtls_role; if (!rtp_dtls_transport_->GetDtlsRole(&dtls_role)) { - return rtc::Optional(); + return absl::optional(); } - return rtc::Optional(dtls_role); + return absl::optional(dtls_role); } bool JsepTransport::GetStats(TransportStats* stats) { @@ -357,7 +357,7 @@ void JsepTransport::SetRemoteIceParameters( webrtc::RTCError JsepTransport::SetNegotiatedDtlsParameters( DtlsTransportInternal* dtls_transport, - rtc::Optional dtls_role, + absl::optional dtls_role, rtc::SSLFingerprint* remote_fingerprint) { RTC_DCHECK(dtls_transport); // Set SSL role. Role must be set before fingerprint is applied, which @@ -483,7 +483,7 @@ webrtc::RTCError JsepTransport::NegotiateAndSetDtlsParameters( "without applying any offer."); } std::unique_ptr remote_fingerprint; - rtc::Optional negotiated_dtls_role; + absl::optional negotiated_dtls_role; rtc::SSLFingerprint* local_fp = local_description_->transport_desc.identity_fingerprint.get(); @@ -531,7 +531,7 @@ webrtc::RTCError JsepTransport::NegotiateDtlsRole( SdpType local_description_type, ConnectionRole local_connection_role, ConnectionRole remote_connection_role, - rtc::Optional* negotiated_dtls_role) { + absl::optional* negotiated_dtls_role) { // From RFC 4145, section-4.1, The following are the values that the // 'setup' attribute can take in an offer/answer exchange: // Offer Answer diff --git a/pc/jseptransport.h b/pc/jseptransport.h index 392f861f25..fc9ed5ba7e 100644 --- a/pc/jseptransport.h +++ b/pc/jseptransport.h @@ -16,9 +16,9 @@ #include #include +#include "absl/types/optional.h" #include "api/candidate.h" #include "api/jsep.h" -#include "api/optional.h" #include "p2p/base/dtlstransport.h" #include "p2p/base/p2pconstants.h" #include "p2p/base/transportinfo.h" @@ -125,9 +125,9 @@ class JsepTransport : public sigslot::has_slots<> { // changed ufrag/password). bool needs_ice_restart() const { return needs_ice_restart_; } - // Returns role if negotiated, or empty Optional if it hasn't been negotiated - // yet. - rtc::Optional GetDtlsRole() const; + // Returns role if negotiated, or empty absl::optional if it hasn't been + // negotiated yet. + absl::optional GetDtlsRole() const; // TODO(deadbeef): Make this const. See comment in transportcontroller.h. bool GetStats(TransportStats* stats); @@ -200,7 +200,7 @@ class JsepTransport : public sigslot::has_slots<> { webrtc::SdpType local_description_type, ConnectionRole local_connection_role, ConnectionRole remote_connection_role, - rtc::Optional* negotiated_dtls_role); + absl::optional* negotiated_dtls_role); // Pushes down the ICE parameters from the local description, such // as the ICE ufrag and pwd. @@ -212,7 +212,7 @@ class JsepTransport : public sigslot::has_slots<> { // Pushes down the DTLS parameters obtained via negotiation. webrtc::RTCError SetNegotiatedDtlsParameters( DtlsTransportInternal* dtls_transport, - rtc::Optional dtls_role, + absl::optional dtls_role, rtc::SSLFingerprint* remote_fingerprint); bool GetTransportStats(DtlsTransportInternal* dtls_transport, @@ -238,8 +238,8 @@ class JsepTransport : public sigslot::has_slots<> { RtcpMuxFilter rtcp_mux_negotiator_; // Cache the encrypted header extension IDs for SDES negoitation. - rtc::Optional> send_extension_ids_; - rtc::Optional> recv_extension_ids_; + absl::optional> send_extension_ids_; + absl::optional> recv_extension_ids_; RTC_DISALLOW_COPY_AND_ASSIGN(JsepTransport); }; diff --git a/pc/jseptransport_unittest.cc b/pc/jseptransport_unittest.cc index f6f3e1eb2e..16cc526f24 100644 --- a/pc/jseptransport_unittest.cc +++ b/pc/jseptransport_unittest.cc @@ -759,7 +759,7 @@ TEST_F(JsepTransport2Test, RemoteOfferWithCurrentNegotiatedDtlsRole) { .ok()); // Sanity check that role was actually negotiated. - rtc::Optional role = jsep_transport_->GetDtlsRole(); + absl::optional role = jsep_transport_->GetDtlsRole(); ASSERT_TRUE(role); EXPECT_EQ(rtc::SSL_CLIENT, *role); @@ -804,7 +804,7 @@ TEST_F(JsepTransport2Test, RemoteOfferThatChangesNegotiatedDtlsRole) { .ok()); // Sanity check that role was actually negotiated. - rtc::Optional role = jsep_transport_->GetDtlsRole(); + absl::optional role = jsep_transport_->GetDtlsRole(); ASSERT_TRUE(role); EXPECT_EQ(rtc::SSL_CLIENT, *role); @@ -849,7 +849,7 @@ TEST_F(JsepTransport2Test, DtlsSetupWithLegacyAsAnswerer) { ->SetRemoteJsepTransportDescription(remote_desc, SdpType::kAnswer) .ok()); - rtc::Optional role = jsep_transport_->GetDtlsRole(); + absl::optional role = jsep_transport_->GetDtlsRole(); ASSERT_TRUE(role); // Since legacy answer ommitted setup atribute, and we offered actpass, we // should act as passive (server). diff --git a/pc/jseptransportcontroller.cc b/pc/jseptransportcontroller.cc index 52519c0443..80b723777d 100644 --- a/pc/jseptransportcontroller.cc +++ b/pc/jseptransportcontroller.cc @@ -192,16 +192,16 @@ bool JsepTransportController::NeedsIceRestart( return transport->needs_ice_restart(); } -rtc::Optional JsepTransportController::GetDtlsRole( +absl::optional JsepTransportController::GetDtlsRole( const std::string& mid) const { if (!network_thread_->IsCurrent()) { - return network_thread_->Invoke>( + return network_thread_->Invoke>( RTC_FROM_HERE, [&] { return GetDtlsRole(mid); }); } const cricket::JsepTransport* t = GetJsepTransportForMid(mid); if (!t) { - return rtc::Optional(); + return absl::optional(); } return t->GetDtlsRole(); } diff --git a/pc/jseptransportcontroller.h b/pc/jseptransportcontroller.h index b678a09048..56aed99675 100644 --- a/pc/jseptransportcontroller.h +++ b/pc/jseptransportcontroller.h @@ -146,7 +146,7 @@ class JsepTransportController : public sigslot::has_slots<>, std::unique_ptr GetRemoteSSLCertChain( const std::string& mid) const; // Get negotiated role, if one has been negotiated. - rtc::Optional GetDtlsRole(const std::string& mid) const; + absl::optional GetDtlsRole(const std::string& mid) const; // TODO(deadbeef): GetStats isn't const because all the way down to // OpenSSLStreamAdapter, GetSslCipherSuite and GetDtlsSrtpCryptoSuite are not @@ -206,8 +206,8 @@ class JsepTransportController : public sigslot::has_slots<>, const std::vector& encrypted_extension_ids, int rtp_abs_sendtime_extn_id); - rtc::Optional bundled_mid() const { - rtc::Optional bundled_mid; + absl::optional bundled_mid() const { + absl::optional bundled_mid; if (bundle_group_ && bundle_group_->FirstContentName()) { bundled_mid = *(bundle_group_->FirstContentName()); } @@ -312,9 +312,9 @@ class JsepTransportController : public sigslot::has_slots<>, Config config_; const cricket::SessionDescription* local_desc_ = nullptr; const cricket::SessionDescription* remote_desc_ = nullptr; - rtc::Optional initial_offerer_; + absl::optional initial_offerer_; - rtc::Optional bundle_group_; + absl::optional bundle_group_; cricket::IceConfig ice_config_; cricket::IceRole ice_role_ = cricket::ICEROLE_CONTROLLING; diff --git a/pc/jseptransportcontroller_unittest.cc b/pc/jseptransportcontroller_unittest.cc index f3bf2aff05..93f14c8769 100644 --- a/pc/jseptransportcontroller_unittest.cc +++ b/pc/jseptransportcontroller_unittest.cc @@ -524,7 +524,7 @@ TEST_F(JsepTransportControllerTest, GetDtlsRole) { ->SetLocalDescription(SdpType::kOffer, offer_desc.get()) .ok()); - rtc::Optional role = + absl::optional role = transport_controller_->GetDtlsRole(kAudioMid1); // The DTLS role is not decided yet. EXPECT_FALSE(role); diff --git a/pc/localaudiosource_unittest.cc b/pc/localaudiosource_unittest.cc index b2d87ae3e6..54766caf39 100644 --- a/pc/localaudiosource_unittest.cc +++ b/pc/localaudiosource_unittest.cc @@ -33,5 +33,5 @@ TEST(LocalAudioSourceTest, InitWithAudioOptions) { TEST(LocalAudioSourceTest, InitWithNoOptions) { rtc::scoped_refptr source = LocalAudioSource::Create(nullptr); - EXPECT_EQ(rtc::nullopt, source->options().highpass_filter); + EXPECT_EQ(absl::nullopt, source->options().highpass_filter); } diff --git a/pc/mediasession.cc b/pc/mediasession.cc index 79aa975d96..37354b8beb 100644 --- a/pc/mediasession.cc +++ b/pc/mediasession.cc @@ -18,8 +18,8 @@ #include #include +#include "absl/types/optional.h" #include "api/cryptoparams.h" -#include "api/optional.h" #include "common_types.h" // NOLINT(build/include) #include "media/base/h264_profile_level_id.h" #include "media/base/mediaconstants.h" diff --git a/pc/peerconnection.cc b/pc/peerconnection.cc index 41e4368b67..d99e97f2c9 100644 --- a/pc/peerconnection.cc +++ b/pc/peerconnection.cc @@ -609,11 +609,11 @@ std::string GetStreamIdsString(rtc::ArrayView stream_ids) { return output; } -rtc::Optional RTCConfigurationToIceConfigOptionalInt( +absl::optional RTCConfigurationToIceConfigOptionalInt( int rtc_configuration_parameter) { if (rtc_configuration_parameter == webrtc::PeerConnectionInterface::RTCConfiguration::kUndefined) { - return rtc::nullopt; + return absl::nullopt; } return rtc_configuration_parameter; } @@ -665,9 +665,9 @@ bool PeerConnectionInterface::RTCConfiguration::operator==( int max_ipv6_networks; bool disable_link_local_networks; bool enable_rtp_data_channel; - rtc::Optional screencast_min_bitrate; - rtc::Optional combined_audio_video_bwe; - rtc::Optional enable_dtls_srtp; + absl::optional screencast_min_bitrate; + absl::optional combined_audio_video_bwe; + absl::optional enable_dtls_srtp; TcpCandidatePolicy tcp_candidate_policy; CandidateNetworkPolicy candidate_network_policy; int audio_jitter_buffer_max_packets; @@ -681,16 +681,16 @@ bool PeerConnectionInterface::RTCConfiguration::operator==( bool presume_writable_when_fully_relayed; bool enable_ice_renomination; bool redetermine_role_on_ice_restart; - rtc::Optional ice_check_interval_strong_connectivity; - rtc::Optional ice_check_interval_weak_connectivity; - rtc::Optional ice_check_min_interval; - rtc::Optional ice_unwritable_timeout; - rtc::Optional ice_unwritable_min_checks; - rtc::Optional stun_candidate_keepalive_interval; - rtc::Optional ice_regather_interval_range; + absl::optional ice_check_interval_strong_connectivity; + absl::optional ice_check_interval_weak_connectivity; + absl::optional ice_check_min_interval; + absl::optional ice_unwritable_timeout; + absl::optional ice_unwritable_min_checks; + absl::optional stun_candidate_keepalive_interval; + absl::optional ice_regather_interval_range; webrtc::TurnCustomizer* turn_customizer; SdpSemantics sdp_semantics; - rtc::Optional network_preference; + absl::optional network_preference; bool active_reset_srtp_params; }; static_assert(sizeof(stuff_being_tested_for_equality) == sizeof(*this), @@ -2714,8 +2714,8 @@ PeerConnection::AssociateTransceiver(cricket::ContentSource source, if (old_transceiver) { RTC_LOG(LS_INFO) << "Dissociating transceiver for MID=" << old_mid << " since the media section is being recycled."; - old_transceiver->internal()->set_mid(rtc::nullopt); - old_transceiver->internal()->set_mline_index(rtc::nullopt); + old_transceiver->internal()->set_mid(absl::nullopt); + old_transceiver->internal()->set_mline_index(absl::nullopt); } } const MediaContentDescription* media_desc = content.media_description(); @@ -3674,9 +3674,9 @@ void PeerConnection::GetOptionsForPlanBOffer( (offer_answer_options.offer_to_receive_video > 0); } - rtc::Optional audio_index; - rtc::Optional video_index; - rtc::Optional data_index; + absl::optional audio_index; + absl::optional video_index; + absl::optional data_index; // If a current description exists, generate m= sections in the same order, // using the first audio/video/data section that appears and rejecting // extraneous ones. @@ -3922,9 +3922,9 @@ void PeerConnection::GetOptionsForPlanBAnswer( recv_video = (offer_answer_options.offer_to_receive_video > 0); } - rtc::Optional audio_index; - rtc::Optional video_index; - rtc::Optional data_index; + absl::optional audio_index; + absl::optional video_index; + absl::optional data_index; // Generate m= sections that match those in the offer. // Note that mediasession.cc will handle intersection our preferred @@ -3983,9 +3983,9 @@ void PeerConnection::GenerateMediaDescriptionOptions( const SessionDescriptionInterface* session_desc, RtpTransceiverDirection audio_direction, RtpTransceiverDirection video_direction, - rtc::Optional* audio_index, - rtc::Optional* video_index, - rtc::Optional* data_index, + absl::optional* audio_index, + absl::optional* video_index, + absl::optional* data_index, cricket::MediaSessionOptions* session_options) { for (const cricket::ContentInfo& content : session_desc->description()->contents()) { @@ -4054,17 +4054,17 @@ PeerConnection::GetMediaDescriptionOptionsForRejectedData( return options; } -rtc::Optional PeerConnection::GetDataMid() const { +absl::optional PeerConnection::GetDataMid() const { switch (data_channel_type_) { case cricket::DCT_RTP: if (!rtp_data_channel_) { - return rtc::nullopt; + return absl::nullopt; } return rtp_data_channel_->content_name(); case cricket::DCT_SCTP: return sctp_mid_; default: - return rtc::nullopt; + return absl::nullopt; } } @@ -4727,7 +4727,7 @@ bool PeerConnection::ReconfigurePortAllocator_n( int candidate_pool_size, bool prune_turn_ports, webrtc::TurnCustomizer* turn_customizer, - rtc::Optional stun_candidate_keepalive_interval) { + absl::optional stun_candidate_keepalive_interval) { port_allocator_->set_candidate_filter( ConvertIceTransportTypeToCandidateFilter(type)); // According to JSEP, after setLocalDescription, changing the candidate pool @@ -5123,15 +5123,15 @@ bool PeerConnection::ReadyToSendData() const { sctp_ready_to_send_data_; } -rtc::Optional PeerConnection::sctp_transport_name() const { +absl::optional PeerConnection::sctp_transport_name() const { if (sctp_mid_ && transport_controller_) { auto dtls_transport = transport_controller_->GetDtlsTransport(*sctp_mid_); if (dtls_transport) { return dtls_transport->transport_name(); } - return rtc::Optional(); + return absl::optional(); } - return rtc::Optional(); + return absl::optional(); } cricket::CandidateStatsList PeerConnection::GetPooledCandidateStats() const { @@ -5158,7 +5158,7 @@ std::map PeerConnection::GetTransportNamesByMid() rtp_data_channel_->transport_name(); } if (sctp_transport_) { - rtc::Optional transport_name = sctp_transport_name(); + absl::optional transport_name = sctp_transport_name(); RTC_DCHECK(transport_name); transport_names_by_mid[*sctp_mid_] = *transport_name; } @@ -6036,7 +6036,7 @@ void PeerConnection::ReportTransportStats() { cricket::MEDIA_TYPE_DATA); } - rtc::Optional transport_name = sctp_transport_name(); + absl::optional transport_name = sctp_transport_name(); if (transport_name) { media_types_by_transport_name[*transport_name].insert( cricket::MEDIA_TYPE_DATA); diff --git a/pc/peerconnection.h b/pc/peerconnection.h index f753955f1c..41137464a6 100644 --- a/pc/peerconnection.h +++ b/pc/peerconnection.h @@ -247,11 +247,11 @@ class PeerConnection : public PeerConnectionInternal, return sctp_data_channels_; } - rtc::Optional sctp_content_name() const override { + absl::optional sctp_content_name() const override { return sctp_mid_; } - rtc::Optional sctp_transport_name() const override; + absl::optional sctp_transport_name() const override; cricket::CandidateStatsList GetPooledCandidateStats() const override; std::map GetTransportNamesByMid() const override; @@ -516,9 +516,9 @@ class PeerConnection : public PeerConnectionInternal, const SessionDescriptionInterface* session_desc, RtpTransceiverDirection audio_direction, RtpTransceiverDirection video_direction, - rtc::Optional* audio_index, - rtc::Optional* video_index, - rtc::Optional* data_index, + absl::optional* audio_index, + absl::optional* video_index, + absl::optional* data_index, cricket::MediaSessionOptions* session_options); // Generates the active MediaDescriptionOptions for the local data channel @@ -534,7 +534,7 @@ class PeerConnection : public PeerConnectionInternal, // Returns the MID for the data section associated with either the // RtpDataChannel or SCTP data channel, if it has been set. If no data // channels are configured this will return nullopt. - rtc::Optional GetDataMid() const; + absl::optional GetDataMid() const; // Remove all local and remote senders of type |media_type|. // Called when a media type is rejected (m-line set to port 0). @@ -665,7 +665,7 @@ class PeerConnection : public PeerConnectionInternal, int candidate_pool_size, bool prune_turn_ports, webrtc::TurnCustomizer* turn_customizer, - rtc::Optional stun_candidate_keepalive_interval); + absl::optional stun_candidate_keepalive_interval); void SetMetricObserver_n(UMAObserver* observer); @@ -976,7 +976,7 @@ class PeerConnection : public PeerConnectionInternal, std::unique_ptr sctp_transport_; // |sctp_mid_| is the content name (MID) in SDP. - rtc::Optional sctp_mid_; + absl::optional sctp_mid_; // Value cached on signaling thread. Only updated when SctpReadyToSendData // fires on the signaling thread. bool sctp_ready_to_send_data_ = false; diff --git a/pc/peerconnection_datachannel_unittest.cc b/pc/peerconnection_datachannel_unittest.cc index db6c6568bd..224d0e9a77 100644 --- a/pc/peerconnection_datachannel_unittest.cc +++ b/pc/peerconnection_datachannel_unittest.cc @@ -66,11 +66,11 @@ class PeerConnectionWrapperForDataChannelTest : public PeerConnectionWrapper { sctp_transport_factory_ = sctp_transport_factory; } - rtc::Optional sctp_content_name() { + absl::optional sctp_content_name() { return GetInternalPeerConnection()->sctp_content_name(); } - rtc::Optional sctp_transport_name() { + absl::optional sctp_transport_name() { return GetInternalPeerConnection()->sctp_transport_name(); } diff --git a/pc/peerconnection_ice_unittest.cc b/pc/peerconnection_ice_unittest.cc index 5cf6965a99..cf9f0167cd 100644 --- a/pc/peerconnection_ice_unittest.cc +++ b/pc/peerconnection_ice_unittest.cc @@ -981,7 +981,7 @@ TEST_F(PeerConnectionIceConfigTest, SetStunCandidateKeepaliveInterval) { config.ice_candidate_pool_size = 1; CreatePeerConnection(config); ASSERT_NE(port_allocator_, nullptr); - rtc::Optional actual_stun_keepalive_interval = + absl::optional actual_stun_keepalive_interval = port_allocator_->stun_candidate_keepalive_interval(); EXPECT_EQ(actual_stun_keepalive_interval.value_or(-1), 123); config.stun_candidate_keepalive_interval = 321; diff --git a/pc/peerconnection_jsep_unittest.cc b/pc/peerconnection_jsep_unittest.cc index b4142411cc..3058238a6a 100644 --- a/pc/peerconnection_jsep_unittest.cc +++ b/pc/peerconnection_jsep_unittest.cc @@ -304,7 +304,7 @@ TEST_F(PeerConnectionJsepTest, auto transceivers = callee->pc()->GetTransceivers(); ASSERT_EQ(2u, transceivers.size()); - EXPECT_EQ(rtc::nullopt, transceivers[0]->mid()); + EXPECT_EQ(absl::nullopt, transceivers[0]->mid()); EXPECT_EQ(caller_audio->mid(), transceivers[1]->mid()); } @@ -322,7 +322,7 @@ TEST_F(PeerConnectionJsepTest, auto transceivers = callee->pc()->GetTransceivers(); ASSERT_EQ(2u, transceivers.size()); - EXPECT_EQ(rtc::nullopt, transceivers[0]->mid()); + EXPECT_EQ(absl::nullopt, transceivers[0]->mid()); EXPECT_EQ(caller->pc()->GetTransceivers()[0]->mid(), transceivers[1]->mid()); EXPECT_EQ(MediaStreamTrackInterface::kAudioKind, transceivers[1]->receiver()->track()->kind()); @@ -341,7 +341,7 @@ TEST_F(PeerConnectionJsepTest, auto transceivers = callee->pc()->GetTransceivers(); ASSERT_EQ(2u, transceivers.size()); - EXPECT_EQ(rtc::nullopt, transceivers[0]->mid()); + EXPECT_EQ(absl::nullopt, transceivers[0]->mid()); EXPECT_EQ(caller->pc()->GetTransceivers()[0]->mid(), transceivers[1]->mid()); EXPECT_EQ(MediaStreamTrackInterface::kAudioKind, transceivers[1]->receiver()->track()->kind()); @@ -360,7 +360,7 @@ TEST_F(PeerConnectionJsepTest, SetRemoteOfferDoesNotReuseStoppedTransceiver) { auto transceivers = callee->pc()->GetTransceivers(); ASSERT_EQ(2u, transceivers.size()); - EXPECT_EQ(rtc::nullopt, transceivers[0]->mid()); + EXPECT_EQ(absl::nullopt, transceivers[0]->mid()); EXPECT_TRUE(transceivers[0]->stopped()); EXPECT_EQ(caller->pc()->GetTransceivers()[0]->mid(), transceivers[1]->mid()); EXPECT_FALSE(transceivers[1]->stopped()); @@ -606,7 +606,7 @@ TEST_F(PeerConnectionJsepTest, caller->SetRemoteDescription(callee->CreateAnswerAndSetAsLocal())); EXPECT_TRUE(first_transceiver->stopped()); // First transceivers aren't dissociated yet. - ASSERT_NE(rtc::nullopt, first_transceiver->mid()); + ASSERT_NE(absl::nullopt, first_transceiver->mid()); std::string first_mid = *first_transceiver->mid(); EXPECT_EQ(first_mid, callee->pc()->GetTransceivers()[0]->mid()); @@ -625,10 +625,10 @@ TEST_F(PeerConnectionJsepTest, // associate the new transceivers. ASSERT_TRUE( caller->SetLocalDescription(CloneSessionDescription(offer.get()))); - EXPECT_EQ(rtc::nullopt, first_transceiver->mid()); + EXPECT_EQ(absl::nullopt, first_transceiver->mid()); EXPECT_EQ(second_mid, caller->pc()->GetTransceivers()[1]->mid()); ASSERT_TRUE(callee->SetRemoteDescription(std::move(offer))); - EXPECT_EQ(rtc::nullopt, callee->pc()->GetTransceivers()[0]->mid()); + EXPECT_EQ(absl::nullopt, callee->pc()->GetTransceivers()[0]->mid()); EXPECT_EQ(second_mid, callee->pc()->GetTransceivers()[1]->mid()); // The new answer should also recycle the m section correctly. @@ -644,11 +644,11 @@ TEST_F(PeerConnectionJsepTest, ASSERT_TRUE(caller->SetRemoteDescription(std::move(answer))); auto caller_transceivers = caller->pc()->GetTransceivers(); ASSERT_EQ(2u, caller_transceivers.size()); - EXPECT_EQ(rtc::nullopt, caller_transceivers[0]->mid()); + EXPECT_EQ(absl::nullopt, caller_transceivers[0]->mid()); EXPECT_EQ(second_mid, caller_transceivers[1]->mid()); auto callee_transceivers = callee->pc()->GetTransceivers(); ASSERT_EQ(2u, callee_transceivers.size()); - EXPECT_EQ(rtc::nullopt, callee_transceivers[0]->mid()); + EXPECT_EQ(absl::nullopt, callee_transceivers[0]->mid()); EXPECT_EQ(second_mid, callee_transceivers[1]->mid()); } @@ -687,7 +687,7 @@ TEST_F(PeerConnectionJsepTest, CreateOfferRecyclesWhenOfferingTwice) { // Make sure that the caller's transceivers are associated correctly. auto caller_transceivers = caller->pc()->GetTransceivers(); ASSERT_EQ(2u, caller_transceivers.size()); - EXPECT_EQ(rtc::nullopt, caller_transceivers[0]->mid()); + EXPECT_EQ(absl::nullopt, caller_transceivers[0]->mid()); EXPECT_EQ(second_mid, caller_transceivers[1]->mid()); EXPECT_FALSE(caller_transceivers[1]->stopped()); } @@ -737,7 +737,7 @@ TEST_P(RecycleMediaSectionTest, VerifyOfferAnswerAndTransceivers) { // the MID for the new transceiver. ASSERT_TRUE( caller->SetLocalDescription(CloneSessionDescription(offer.get()))); - EXPECT_EQ(rtc::nullopt, first_transceiver->mid()); + EXPECT_EQ(absl::nullopt, first_transceiver->mid()); EXPECT_EQ(second_mid, second_transceiver->mid()); // Setting the remote offer will dissociate the previous transceiver and @@ -745,7 +745,7 @@ TEST_P(RecycleMediaSectionTest, VerifyOfferAnswerAndTransceivers) { ASSERT_TRUE(callee->SetRemoteDescription(std::move(offer))); auto callee_transceivers = callee->pc()->GetTransceivers(); ASSERT_EQ(2u, callee_transceivers.size()); - EXPECT_EQ(rtc::nullopt, callee_transceivers[0]->mid()); + EXPECT_EQ(absl::nullopt, callee_transceivers[0]->mid()); EXPECT_EQ(first_type_, callee_transceivers[0]->media_type()); EXPECT_EQ(second_mid, callee_transceivers[1]->mid()); EXPECT_EQ(second_type_, callee_transceivers[1]->media_type()); diff --git a/pc/peerconnection_rtp_unittest.cc b/pc/peerconnection_rtp_unittest.cc index d3ae2cbaf5..ca2d3b1fd9 100644 --- a/pc/peerconnection_rtp_unittest.cc +++ b/pc/peerconnection_rtp_unittest.cc @@ -791,10 +791,10 @@ TEST_F(PeerConnectionRtpTestUnifiedPlan, auto caller = CreatePeerConnection(); auto transceiver = caller->AddTransceiver(cricket::MEDIA_TYPE_AUDIO); - EXPECT_EQ(rtc::nullopt, transceiver->mid()); + EXPECT_EQ(absl::nullopt, transceiver->mid()); EXPECT_FALSE(transceiver->stopped()); EXPECT_EQ(RtpTransceiverDirection::kSendRecv, transceiver->direction()); - EXPECT_EQ(rtc::nullopt, transceiver->current_direction()); + EXPECT_EQ(absl::nullopt, transceiver->current_direction()); } // Test that adding a transceiver with the audio kind creates an audio sender diff --git a/pc/peerconnectionendtoend_unittest.cc b/pc/peerconnectionendtoend_unittest.cc index dae5a2e6ec..7e0667f6bc 100644 --- a/pc/peerconnectionendtoend_unittest.cc +++ b/pc/peerconnectionendtoend_unittest.cc @@ -270,7 +270,7 @@ CreateForwardingMockDecoderFactory( .WillRepeatedly( Invoke([real_decoder_factory]( const webrtc::SdpAudioFormat& format, - rtc::Optional codec_pair_id, + absl::optional codec_pair_id, std::unique_ptr* return_value) { auto real_decoder = real_decoder_factory->MakeAudioDecoder(format, codec_pair_id); @@ -284,7 +284,7 @@ CreateForwardingMockDecoderFactory( struct AudioEncoderUnicornSparklesRainbow { using Config = webrtc::AudioEncoderL16::Config; - static rtc::Optional SdpToConfig(webrtc::SdpAudioFormat format) { + static absl::optional SdpToConfig(webrtc::SdpAudioFormat format) { if (STR_CASE_CMP(format.name.c_str(), "UnicornSparklesRainbow") == 0) { const webrtc::SdpAudioFormat::Parameters expected_params = { {"num_horns", "1"}}; @@ -293,7 +293,7 @@ struct AudioEncoderUnicornSparklesRainbow { format.name = "L16"; return webrtc::AudioEncoderL16::SdpToConfig(format); } else { - return rtc::nullopt; + return absl::nullopt; } } static void AppendSupportedEncoders( @@ -313,7 +313,7 @@ struct AudioEncoderUnicornSparklesRainbow { static std::unique_ptr MakeAudioEncoder( const Config& config, int payload_type, - rtc::Optional codec_pair_id = rtc::nullopt) { + absl::optional codec_pair_id = absl::nullopt) { return webrtc::AudioEncoderL16::MakeAudioEncoder(config, payload_type, codec_pair_id); } @@ -321,7 +321,7 @@ struct AudioEncoderUnicornSparklesRainbow { struct AudioDecoderUnicornSparklesRainbow { using Config = webrtc::AudioDecoderL16::Config; - static rtc::Optional SdpToConfig(webrtc::SdpAudioFormat format) { + static absl::optional SdpToConfig(webrtc::SdpAudioFormat format) { if (STR_CASE_CMP(format.name.c_str(), "UnicornSparklesRainbow") == 0) { const webrtc::SdpAudioFormat::Parameters expected_params = { {"num_horns", "1"}}; @@ -330,7 +330,7 @@ struct AudioDecoderUnicornSparklesRainbow { format.name = "L16"; return webrtc::AudioDecoderL16::SdpToConfig(format); } else { - return rtc::nullopt; + return absl::nullopt; } } static void AppendSupportedDecoders( @@ -346,7 +346,7 @@ struct AudioDecoderUnicornSparklesRainbow { } static std::unique_ptr MakeAudioDecoder( const Config& config, - rtc::Optional codec_pair_id = rtc::nullopt) { + absl::optional codec_pair_id = absl::nullopt) { return webrtc::AudioDecoderL16::MakeAudioDecoder(config, codec_pair_id); } }; @@ -392,14 +392,14 @@ TEST_P(PeerConnectionEndToEndTest, CallWithCustomCodec) { std::vector GetSupportedEncoders() override { return fact_->GetSupportedEncoders(); } - rtc::Optional QueryAudioEncoder( + absl::optional QueryAudioEncoder( const webrtc::SdpAudioFormat& format) override { return fact_->QueryAudioEncoder(format); } std::unique_ptr MakeAudioEncoder( int payload_type, const webrtc::SdpAudioFormat& format, - rtc::Optional codec_pair_id) override { + absl::optional codec_pair_id) override { EXPECT_TRUE(codec_pair_id.has_value()); codec_ids_->push_back(*codec_pair_id); return fact_->MakeAudioEncoder(payload_type, format, codec_pair_id); @@ -424,7 +424,7 @@ TEST_P(PeerConnectionEndToEndTest, CallWithCustomCodec) { } std::unique_ptr MakeAudioDecoder( const webrtc::SdpAudioFormat& format, - rtc::Optional codec_pair_id) override { + absl::optional codec_pair_id) override { EXPECT_TRUE(codec_pair_id.has_value()); codec_ids_->push_back(*codec_pair_id); return fact_->MakeAudioDecoder(format, codec_pair_id); diff --git a/pc/peerconnectioninterface_unittest.cc b/pc/peerconnectioninterface_unittest.cc index 5248d51428..938e5b2dec 100644 --- a/pc/peerconnectioninterface_unittest.cc +++ b/pc/peerconnectioninterface_unittest.cc @@ -2487,7 +2487,7 @@ TEST_P(PeerConnectionInterfaceTest, SetConfigurationChangesPruneTurnPortsFlag) { // require a very complex set of mocks. TEST_P(PeerConnectionInterfaceTest, SetConfigurationChangesIceCheckInterval) { PeerConnectionInterface::RTCConfiguration config; - config.ice_check_min_interval = rtc::nullopt; + config.ice_check_min_interval = absl::nullopt; CreatePeerConnection(config, nullptr); config = pc_->GetConfiguration(); config.ice_check_min_interval = 100; diff --git a/pc/peerconnectioninternal.h b/pc/peerconnectioninternal.h index f0267a700d..8a169547cc 100644 --- a/pc/peerconnectioninternal.h +++ b/pc/peerconnectioninternal.h @@ -53,8 +53,8 @@ class PeerConnectionInternal : public PeerConnectionInterface { virtual std::vector> sctp_data_channels() const = 0; - virtual rtc::Optional sctp_content_name() const = 0; - virtual rtc::Optional sctp_transport_name() const = 0; + virtual absl::optional sctp_content_name() const = 0; + virtual absl::optional sctp_transport_name() const = 0; virtual cricket::CandidateStatsList GetPooledCandidateStats() const = 0; diff --git a/pc/rtcstatscollector.h b/pc/rtcstatscollector.h index bad281fc9b..43d5653f0a 100644 --- a/pc/rtcstatscollector.h +++ b/pc/rtcstatscollector.h @@ -17,7 +17,7 @@ #include #include -#include "api/optional.h" +#include "absl/types/optional.h" #include "api/stats/rtcstats_objects.h" #include "api/stats/rtcstatscollectorcallback.h" #include "api/stats/rtcstatsreport.h" @@ -145,8 +145,8 @@ class RTCStatsCollector : public virtual rtc::RefCountInterface, struct RtpTransceiverStatsInfo { rtc::scoped_refptr transceiver; cricket::MediaType media_type; - rtc::Optional mid; - rtc::Optional transport_name; + absl::optional mid; + absl::optional transport_name; std::unique_ptr track_media_info_map; }; diff --git a/pc/rtcstatscollector_unittest.cc b/pc/rtcstatscollector_unittest.cc index 99bb88caef..0c4bc032cd 100644 --- a/pc/rtcstatscollector_unittest.cc +++ b/pc/rtcstatscollector_unittest.cc @@ -1096,7 +1096,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCIceCandidatePairStats) { connection_info.sent_total_bytes = 42; connection_info.recv_total_bytes = 1234; connection_info.total_round_trip_time_ms = 0; - connection_info.current_round_trip_time_ms = rtc::nullopt; + connection_info.current_round_trip_time_ms = absl::nullopt; connection_info.recv_ping_requests = 2020; connection_info.sent_ping_requests_total = 2020; connection_info.sent_ping_requests_before_first_response = 2000; @@ -1638,7 +1638,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Video) { video_media_info.receivers[0].plis_sent = 6; video_media_info.receivers[0].nacks_sent = 7; video_media_info.receivers[0].frames_decoded = 8; - video_media_info.receivers[0].qp_sum = rtc::nullopt; + video_media_info.receivers[0].qp_sum = absl::nullopt; RtpCodecParameters codec_parameters; codec_parameters.payload_type = 42; @@ -1757,7 +1757,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCOutboundRTPStreamStats_Video) { video_media_info.senders[0].bytes_sent = 6; video_media_info.senders[0].codec_payload_type = 42; video_media_info.senders[0].frames_encoded = 8; - video_media_info.senders[0].qp_sum = rtc::nullopt; + video_media_info.senders[0].qp_sum = absl::nullopt; RtpCodecParameters codec_parameters; codec_parameters.payload_type = 42; diff --git a/pc/rtpreceiver.h b/pc/rtpreceiver.h index 4d6457f8e2..964a8f590f 100644 --- a/pc/rtpreceiver.h +++ b/pc/rtpreceiver.h @@ -137,7 +137,7 @@ class AudioRtpReceiver : public ObserverInterface, const rtc::scoped_refptr source_; const rtc::scoped_refptr track_; cricket::VoiceMediaChannel* media_channel_ = nullptr; - rtc::Optional ssrc_; + absl::optional ssrc_; std::vector> streams_; bool cached_track_enabled_; double cached_volume_ = 1; @@ -223,7 +223,7 @@ class VideoRtpReceiver : public rtc::RefCountedObject { rtc::Thread* const worker_thread_; const std::string id_; cricket::VideoMediaChannel* media_channel_ = nullptr; - rtc::Optional ssrc_; + absl::optional ssrc_; // |source_| is held here to be able to change the state of the source when // the VideoRtpReceiver is stopped. rtc::scoped_refptr source_; diff --git a/pc/rtpsender.h b/pc/rtpsender.h index 62b8b59285..d1d278b4e8 100644 --- a/pc/rtpsender.h +++ b/pc/rtpsender.h @@ -171,7 +171,7 @@ class AudioRtpSender : public DtmfProviderInterface, StatsCollector* stats_; rtc::scoped_refptr track_; rtc::scoped_refptr dtmf_sender_proxy_; - rtc::Optional last_transaction_id_; + absl::optional last_transaction_id_; uint32_t ssrc_ = 0; bool cached_track_enabled_ = false; bool stopped_ = false; @@ -253,7 +253,7 @@ class VideoRtpSender : public ObserverInterface, std::vector stream_ids_; cricket::VideoMediaChannel* media_channel_ = nullptr; rtc::scoped_refptr track_; - rtc::Optional last_transaction_id_; + absl::optional last_transaction_id_; uint32_t ssrc_ = 0; VideoTrackInterface::ContentHint cached_track_content_hint_ = VideoTrackInterface::ContentHint::kNone; diff --git a/pc/rtpsenderreceiver_unittest.cc b/pc/rtpsenderreceiver_unittest.cc index 1575e969d7..99e624dd88 100644 --- a/pc/rtpsenderreceiver_unittest.cc +++ b/pc/rtpsenderreceiver_unittest.cc @@ -1101,7 +1101,7 @@ TEST_F(RtpSenderReceiverTest, video_track_->set_enabled(true); // Sender is not ready to send (no SSRC) so no option should have been set. - EXPECT_EQ(rtc::nullopt, video_media_channel_->options().is_screencast); + EXPECT_EQ(absl::nullopt, video_media_channel_->options().is_screencast); // Verify that the content hint is accounted for when video_rtp_sender_ does // get enabled. diff --git a/pc/rtptransceiver.cc b/pc/rtptransceiver.cc index 37770b524d..011478517a 100644 --- a/pc/rtptransceiver.cc +++ b/pc/rtptransceiver.cc @@ -148,7 +148,7 @@ cricket::MediaType RtpTransceiver::media_type() const { return media_type_; } -rtc::Optional RtpTransceiver::mid() const { +absl::optional RtpTransceiver::mid() const { return mid_; } @@ -203,7 +203,7 @@ void RtpTransceiver::SetDirection(RtpTransceiverDirection new_direction) { SignalNegotiationNeeded(); } -rtc::Optional RtpTransceiver::current_direction() +absl::optional RtpTransceiver::current_direction() const { return current_direction_; } @@ -216,7 +216,7 @@ void RtpTransceiver::Stop() { receiver->internal()->Stop(); } stopped_ = true; - current_direction_ = rtc::nullopt; + current_direction_ = absl::nullopt; } void RtpTransceiver::SetCodecPreferences( diff --git a/pc/rtptransceiver.h b/pc/rtptransceiver.h index 3cefda2e1f..7656995f0b 100644 --- a/pc/rtptransceiver.h +++ b/pc/rtptransceiver.h @@ -119,15 +119,15 @@ class RtpTransceiver final // when setting a local offer we need a way to remember which transceiver was // used to create which media section in the offer. Storing the mline index // in CreateOffer is specified in JSEP to allow us to do that. - rtc::Optional mline_index() const { return mline_index_; } - void set_mline_index(rtc::Optional mline_index) { + absl::optional mline_index() const { return mline_index_; } + void set_mline_index(absl::optional mline_index) { mline_index_ = mline_index; } // Sets the MID for this transceiver. If the MID is not null, then the // transceiver is considered "associated" with the media section that has the // same MID. - void set_mid(const rtc::Optional& mid) { mid_ = mid; } + void set_mid(const absl::optional& mid) { mid_ = mid; } // Sets the intended direction for this transceiver. Intended to be used // internally over SetDirection since this does not trigger a negotiation @@ -160,13 +160,13 @@ class RtpTransceiver final // RtpTransceiverInterface implementation. cricket::MediaType media_type() const override; - rtc::Optional mid() const override; + absl::optional mid() const override; rtc::scoped_refptr sender() const override; rtc::scoped_refptr receiver() const override; bool stopped() const override; RtpTransceiverDirection direction() const override; void SetDirection(RtpTransceiverDirection new_direction) override; - rtc::Optional current_direction() const override; + absl::optional current_direction() const override; void Stop() override; void SetCodecPreferences(rtc::ArrayView codecs) override; @@ -183,9 +183,9 @@ class RtpTransceiver final bool stopped_ = false; RtpTransceiverDirection direction_ = RtpTransceiverDirection::kInactive; - rtc::Optional current_direction_; - rtc::Optional mid_; - rtc::Optional mline_index_; + absl::optional current_direction_; + absl::optional mid_; + absl::optional mline_index_; bool created_by_addtrack_ = false; bool has_ever_been_used_to_send_ = false; @@ -195,13 +195,13 @@ class RtpTransceiver final BEGIN_SIGNALING_PROXY_MAP(RtpTransceiver) PROXY_SIGNALING_THREAD_DESTRUCTOR() PROXY_CONSTMETHOD0(cricket::MediaType, media_type); -PROXY_CONSTMETHOD0(rtc::Optional, mid); +PROXY_CONSTMETHOD0(absl::optional, mid); PROXY_CONSTMETHOD0(rtc::scoped_refptr, sender); PROXY_CONSTMETHOD0(rtc::scoped_refptr, receiver); PROXY_CONSTMETHOD0(bool, stopped); PROXY_CONSTMETHOD0(RtpTransceiverDirection, direction); PROXY_METHOD1(void, SetDirection, RtpTransceiverDirection); -PROXY_CONSTMETHOD0(rtc::Optional, current_direction); +PROXY_CONSTMETHOD0(absl::optional, current_direction); PROXY_METHOD0(void, Stop); PROXY_METHOD1(void, SetCodecPreferences, rtc::ArrayView); END_PROXY_MAP(); diff --git a/pc/rtptransport.cc b/pc/rtptransport.cc index 366d6e2fc8..9e994e9b98 100644 --- a/pc/rtptransport.cc +++ b/pc/rtptransport.cc @@ -39,7 +39,7 @@ void RtpTransport::SetRtpPacketTransport( rtp_packet_transport_->SignalWritableState.disconnect(this); rtp_packet_transport_->SignalSentPacket.disconnect(this); // Reset the network route of the old transport. - SignalNetworkRouteChanged(rtc::Optional()); + SignalNetworkRouteChanged(absl::optional()); } if (new_packet_transport) { new_packet_transport->SignalReadyToSend.connect( @@ -75,7 +75,7 @@ void RtpTransport::SetRtcpPacketTransport( rtcp_packet_transport_->SignalWritableState.disconnect(this); rtcp_packet_transport_->SignalSentPacket.disconnect(this); // Reset the network route of the old transport. - SignalNetworkRouteChanged(rtc::Optional()); + SignalNetworkRouteChanged(absl::optional()); } if (new_packet_transport) { new_packet_transport->SignalReadyToSend.connect( @@ -217,7 +217,7 @@ void RtpTransport::OnReadyToSend(rtc::PacketTransportInternal* transport) { } void RtpTransport::OnNetworkRouteChanged( - rtc::Optional network_route) { + absl::optional network_route) { SignalNetworkRouteChanged(network_route); } diff --git a/pc/rtptransport.h b/pc/rtptransport.h index 6620095e15..0044615426 100644 --- a/pc/rtptransport.h +++ b/pc/rtptransport.h @@ -100,7 +100,7 @@ class RtpTransport : public RtpTransportInternal { // Overridden by SrtpTransport. virtual void OnNetworkRouteChanged( - rtc::Optional network_route); + absl::optional network_route); virtual void OnRtpPacketReceived(rtc::CopyOnWriteBuffer* packet, const rtc::PacketTime& packet_time); virtual void OnRtcpPacketReceived(rtc::CopyOnWriteBuffer* packet, diff --git a/pc/rtptransport_unittest.cc b/pc/rtptransport_unittest.cc index 97ea2e4e23..7e4eb84cd7 100644 --- a/pc/rtptransport_unittest.cc +++ b/pc/rtptransport_unittest.cc @@ -78,8 +78,8 @@ class SignalObserver : public sigslot::has_slots<> { bool ready() const { return ready_; } void OnReadyToSend(bool ready) { ready_ = ready; } - rtc::Optional network_route() { return network_route_; } - void OnNetworkRouteChanged(rtc::Optional network_route) { + absl::optional network_route() { return network_route_; } + void OnNetworkRouteChanged(absl::optional network_route) { network_route_ = std::move(network_route); } @@ -102,7 +102,7 @@ class SignalObserver : public sigslot::has_slots<> { int rtcp_transport_sent_count_ = 0; RtpTransport* transport_ = nullptr; bool ready_ = false; - rtc::Optional network_route_; + absl::optional network_route_; }; TEST(RtpTransportTest, SettingRtcpAndRtpSignalsReady) { @@ -184,7 +184,7 @@ TEST(RtpTransportTest, SetRtpTransportWithNetworkRouteChanged) { network_route.remote_network_id = kRemoteNetId; network_route.last_sent_packet_id = kLastPacketId; network_route.packet_overhead = kTransportOverheadPerPacket; - fake_rtp.SetNetworkRoute(rtc::Optional(network_route)); + fake_rtp.SetNetworkRoute(absl::optional(network_route)); transport.SetRtpPacketTransport(&fake_rtp); ASSERT_TRUE(observer.network_route()); EXPECT_EQ(network_route, *(observer.network_route())); @@ -211,7 +211,7 @@ TEST(RtpTransportTest, SetRtcpTransportWithNetworkRouteChanged) { network_route.remote_network_id = kRemoteNetId; network_route.last_sent_packet_id = kLastPacketId; network_route.packet_overhead = kTransportOverheadPerPacket; - fake_rtcp.SetNetworkRoute(rtc::Optional(network_route)); + fake_rtcp.SetNetworkRoute(absl::optional(network_route)); transport.SetRtcpPacketTransport(&fake_rtcp); ASSERT_TRUE(observer.network_route()); EXPECT_EQ(network_route, *(observer.network_route())); diff --git a/pc/rtptransportinternal.h b/pc/rtptransportinternal.h index 7845d42a9c..0ecaa1ac28 100644 --- a/pc/rtptransportinternal.h +++ b/pc/rtptransportinternal.h @@ -65,7 +65,7 @@ class RtpTransportInternal : public SrtpTransportInterface, // Called whenever the network route of the P2P layer transport changes. // The argument is an optional network route. - sigslot::signal1> SignalNetworkRouteChanged; + sigslot::signal1> SignalNetworkRouteChanged; // Called whenever a transport's writable state might change. The argument is // true if the transport is writable, otherwise it is false. diff --git a/pc/srtpfilter.cc b/pc/srtpfilter.cc index a561d3649a..91142a5aa0 100644 --- a/pc/srtpfilter.cc +++ b/pc/srtpfilter.cc @@ -186,8 +186,8 @@ bool SrtpFilter::ResetParams() { offer_params_.clear(); applied_send_params_ = CryptoParams(); applied_recv_params_ = CryptoParams(); - send_cipher_suite_ = rtc::nullopt; - recv_cipher_suite_ = rtc::nullopt; + send_cipher_suite_ = absl::nullopt; + recv_cipher_suite_ = absl::nullopt; send_key_.Clear(); recv_key_.Clear(); state_ = ST_INIT; diff --git a/pc/srtpfilter.h b/pc/srtpfilter.h index e51d9fe211..a4dd54fa8b 100644 --- a/pc/srtpfilter.h +++ b/pc/srtpfilter.h @@ -17,10 +17,10 @@ #include #include +#include "absl/types/optional.h" #include "api/array_view.h" #include "api/cryptoparams.h" #include "api/jsep.h" -#include "api/optional.h" #include "pc/sessiondescription.h" #include "rtc_base/buffer.h" #include "rtc_base/constructormagic.h" @@ -78,8 +78,8 @@ class SrtpFilter { bool ResetParams(); - rtc::Optional send_cipher_suite() { return send_cipher_suite_; } - rtc::Optional recv_cipher_suite() { return recv_cipher_suite_; } + absl::optional send_cipher_suite() { return send_cipher_suite_; } + absl::optional recv_cipher_suite() { return recv_cipher_suite_; } rtc::ArrayView send_key() { return send_key_; } rtc::ArrayView recv_key() { return recv_key_; } @@ -135,8 +135,8 @@ class SrtpFilter { std::vector offer_params_; CryptoParams applied_send_params_; CryptoParams applied_recv_params_; - rtc::Optional send_cipher_suite_; - rtc::Optional recv_cipher_suite_; + absl::optional send_cipher_suite_; + absl::optional recv_cipher_suite_; rtc::ZeroOnFreeBuffer send_key_; rtc::ZeroOnFreeBuffer recv_key_; }; diff --git a/pc/srtptransport.cc b/pc/srtptransport.cc index 1fe0cc812e..a1c1a8a3b6 100644 --- a/pc/srtptransport.cc +++ b/pc/srtptransport.cc @@ -237,7 +237,7 @@ void SrtpTransport::OnRtcpPacketReceived(rtc::CopyOnWriteBuffer* packet, } void SrtpTransport::OnNetworkRouteChanged( - rtc::Optional network_route) { + absl::optional network_route) { // Only append the SRTP overhead when there is a selected network route. if (network_route) { int srtp_overhead = 0; diff --git a/pc/srtptransport.h b/pc/srtptransport.h index 3266e54a05..157392f76e 100644 --- a/pc/srtptransport.h +++ b/pc/srtptransport.h @@ -117,7 +117,7 @@ class SrtpTransport : public RtpTransport { void OnRtcpPacketReceived(rtc::CopyOnWriteBuffer* packet, const rtc::PacketTime& packet_time) override; void OnNetworkRouteChanged( - rtc::Optional network_route) override; + absl::optional network_route) override; // Override the RtpTransport::OnWritableState. void OnWritableState(rtc::PacketTransportInternal* packet_transport) override; @@ -151,10 +151,10 @@ class SrtpTransport : public RtpTransport { std::unique_ptr send_rtcp_session_; std::unique_ptr recv_rtcp_session_; - rtc::Optional send_params_; - rtc::Optional recv_params_; - rtc::Optional send_cipher_suite_; - rtc::Optional recv_cipher_suite_; + absl::optional send_params_; + absl::optional recv_params_; + absl::optional send_cipher_suite_; + absl::optional recv_cipher_suite_; rtc::ZeroOnFreeBuffer send_key_; rtc::ZeroOnFreeBuffer recv_key_; diff --git a/pc/test/fakepeerconnectionbase.h b/pc/test/fakepeerconnectionbase.h index 203ab0f652..d6b61188b9 100644 --- a/pc/test/fakepeerconnectionbase.h +++ b/pc/test/fakepeerconnectionbase.h @@ -266,12 +266,12 @@ class FakePeerConnectionBase : public PeerConnectionInternal { return {}; } - rtc::Optional sctp_content_name() const override { - return rtc::nullopt; + absl::optional sctp_content_name() const override { + return absl::nullopt; } - rtc::Optional sctp_transport_name() const override { - return rtc::nullopt; + absl::optional sctp_transport_name() const override { + return absl::nullopt; } std::map GetTransportNamesByMid() const override { diff --git a/pc/test/fakepeerconnectionforstats.h b/pc/test/fakepeerconnectionforstats.h index 733291fe82..c8cc29b818 100644 --- a/pc/test/fakepeerconnectionforstats.h +++ b/pc/test/fakepeerconnectionforstats.h @@ -45,7 +45,7 @@ class FakeVoiceMediaChannelForStats : public cricket::FakeVoiceMediaChannel { } private: - rtc::Optional stats_; + absl::optional stats_; }; // Fake VideoMediaChannel where the result of GetStats can be configured. @@ -68,7 +68,7 @@ class FakeVideoMediaChannelForStats : public cricket::FakeVideoMediaChannel { } private: - rtc::Optional stats_; + absl::optional stats_; }; constexpr bool kDefaultRtcpMuxRequired = true; diff --git a/pc/test/fakertccertificategenerator.h b/pc/test/fakertccertificategenerator.h index bb56f3e5bc..a3e7654a20 100644 --- a/pc/test/fakertccertificategenerator.h +++ b/pc/test/fakertccertificategenerator.h @@ -140,7 +140,7 @@ class FakeRTCCertificateGenerator void GenerateCertificateAsync( const rtc::KeyParams& key_params, - const rtc::Optional& expires_ms, + const absl::optional& expires_ms, const rtc::scoped_refptr& callback) override { // The certificates are created from constant PEM strings and use its coded diff --git a/pc/test/fakesctptransport.h b/pc/test/fakesctptransport.h index 002caa6213..294376d91a 100644 --- a/pc/test/fakesctptransport.h +++ b/pc/test/fakesctptransport.h @@ -40,8 +40,8 @@ class FakeSctpTransport : public cricket::SctpTransportInternal { int remote_port() const { return *remote_port_; } private: - rtc::Optional local_port_; - rtc::Optional remote_port_; + absl::optional local_port_; + absl::optional remote_port_; }; class FakeSctpTransportFactory : public cricket::SctpTransportInternalFactory { diff --git a/pc/test/mockpeerconnectionobservers.h b/pc/test/mockpeerconnectionobservers.h index 71c1523e4d..e864706fcb 100644 --- a/pc/test/mockpeerconnectionobservers.h +++ b/pc/test/mockpeerconnectionobservers.h @@ -293,7 +293,7 @@ class MockSetRemoteDescriptionObserver private: // Set on complete, on success this is set to an RTCError::OK() error. - rtc::Optional error_; + absl::optional error_; }; class MockDataChannelObserver : public webrtc::DataChannelObserver { diff --git a/pc/trackmediainfomap.cc b/pc/trackmediainfomap.cc index 5450cee7f0..b5abb7e936 100644 --- a/pc/trackmediainfomap.cc +++ b/pc/trackmediainfomap.cc @@ -266,11 +266,11 @@ rtc::scoped_refptr TrackMediaInfoMap::GetVideoTrack( return FindValueOrNull(video_track_by_receiver_info_, &video_receiver_info); } -rtc::Optional TrackMediaInfoMap::GetAttachmentIdByTrack( +absl::optional TrackMediaInfoMap::GetAttachmentIdByTrack( const MediaStreamTrackInterface* track) const { auto it = attachment_id_by_track_.find(track); - return it != attachment_id_by_track_.end() ? rtc::Optional(it->second) - : rtc::nullopt; + return it != attachment_id_by_track_.end() ? absl::optional(it->second) + : absl::nullopt; } } // namespace webrtc diff --git a/pc/trackmediainfomap.h b/pc/trackmediainfomap.h index d6036264ea..fa1f7e7128 100644 --- a/pc/trackmediainfomap.h +++ b/pc/trackmediainfomap.h @@ -79,12 +79,12 @@ class TrackMediaInfoMap { // It is not going to work if a track is attached multiple times, and // it is not going to work if a received track is attached as a sending // track (loopback). - rtc::Optional GetAttachmentIdByTrack( + absl::optional GetAttachmentIdByTrack( const MediaStreamTrackInterface* track) const; private: - rtc::Optional voice_mid_; - rtc::Optional video_mid_; + absl::optional voice_mid_; + absl::optional video_mid_; std::unique_ptr voice_media_info_; std::unique_ptr video_media_info_; // These maps map tracks (identified by a pointer) to their corresponding info diff --git a/pc/trackmediainfomap_unittest.cc b/pc/trackmediainfomap_unittest.cc index c1355647be..1b320d021c 100644 --- a/pc/trackmediainfomap_unittest.cc +++ b/pc/trackmediainfomap_unittest.cc @@ -408,7 +408,7 @@ TEST_F(TrackMediaInfoMapTest, GetAttachmentIdByTrack) { CreateMap(); EXPECT_EQ(rtp_senders_[0]->AttachmentId(), map_->GetAttachmentIdByTrack(local_audio_track_)); - EXPECT_EQ(rtc::nullopt, map_->GetAttachmentIdByTrack(local_video_track_)); + EXPECT_EQ(absl::nullopt, map_->GetAttachmentIdByTrack(local_video_track_)); } // Death tests. diff --git a/pc/videocapturertracksource.cc b/pc/videocapturertracksource.cc index d90ba51244..0767dcffff 100644 --- a/pc/videocapturertracksource.cc +++ b/pc/videocapturertracksource.cc @@ -242,7 +242,7 @@ const cricket::VideoFormat& GetBestCaptureFormat( // Return false if the key is mandatory, and the value is invalid. bool ExtractOption(const MediaConstraintsInterface* all_constraints, const std::string& key, - rtc::Optional* option) { + absl::optional* option) { size_t mandatory = 0; bool value; if (FindConstraint(all_constraints, key, &value, &mandatory)) { diff --git a/pc/videocapturertracksource.h b/pc/videocapturertracksource.h index 5854944ade..9039aa30f2 100644 --- a/pc/videocapturertracksource.h +++ b/pc/videocapturertracksource.h @@ -48,7 +48,9 @@ class VideoCapturerTrackSource : public VideoTrackSource, bool remote); bool is_screencast() const final { return video_capturer_->IsScreencast(); } - rtc::Optional needs_denoising() const final { return needs_denoising_; } + absl::optional needs_denoising() const final { + return needs_denoising_; + } bool GetStats(Stats* stats) final; @@ -76,7 +78,7 @@ class VideoCapturerTrackSource : public VideoTrackSource, std::unique_ptr video_capturer_; bool started_; cricket::VideoFormat format_; - rtc::Optional needs_denoising_; + absl::optional needs_denoising_; }; } // namespace webrtc diff --git a/pc/videocapturertracksource_unittest.cc b/pc/videocapturertracksource_unittest.cc index 34d11b58a9..1ddfc6f4a5 100644 --- a/pc/videocapturertracksource_unittest.cc +++ b/pc/videocapturertracksource_unittest.cc @@ -322,7 +322,7 @@ TEST_F(VideoCapturerTrackSourceTest, SetValidDenoisingConstraint) { TEST_F(VideoCapturerTrackSourceTest, NoiseReductionConstraintNotSet) { FakeConstraints constraints; CreateVideoCapturerSource(&constraints); - EXPECT_EQ(rtc::nullopt, source_->needs_denoising()); + EXPECT_EQ(absl::nullopt, source_->needs_denoising()); } TEST_F(VideoCapturerTrackSourceTest, @@ -357,7 +357,7 @@ TEST_F(VideoCapturerTrackSourceTest, NoiseReductionAndInvalidKeyMandatory) { EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), kMaxWaitMs); - EXPECT_EQ(rtc::nullopt, source_->needs_denoising()); + EXPECT_EQ(absl::nullopt, source_->needs_denoising()); } TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueOptional) { @@ -370,12 +370,13 @@ TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueOptional) { EXPECT_EQ_WAIT(MediaSourceInterface::kLive, state_observer_->state(), kMaxWaitMs); - EXPECT_EQ(rtc::nullopt, source_->needs_denoising()); + EXPECT_EQ(absl::nullopt, source_->needs_denoising()); } TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueMandatory) { FakeConstraints constraints; - // Optional constraints should be ignored if the mandatory constraints fail. + // absl::optional constraints should be ignored if the mandatory constraints + // fail. constraints.AddOptional(MediaConstraintsInterface::kNoiseReduction, "false"); // Values are case-sensitive and must be all lower-case. constraints.AddMandatory(MediaConstraintsInterface::kNoiseReduction, "True"); @@ -384,7 +385,7 @@ TEST_F(VideoCapturerTrackSourceTest, InvalidDenoisingValueMandatory) { EXPECT_EQ_WAIT(MediaSourceInterface::kEnded, state_observer_->state(), kMaxWaitMs); - EXPECT_EQ(rtc::nullopt, source_->needs_denoising()); + EXPECT_EQ(absl::nullopt, source_->needs_denoising()); } TEST_F(VideoCapturerTrackSourceTest, MixedOptionsAndConstraints) { diff --git a/pc/videotracksource.h b/pc/videotracksource.h index fb6c7be52b..50488dd2c6 100644 --- a/pc/videotracksource.h +++ b/pc/videotracksource.h @@ -30,7 +30,9 @@ class VideoTrackSource : public Notifier { bool remote() const override { return remote_; } bool is_screencast() const override { return false; } - rtc::Optional needs_denoising() const override { return rtc::nullopt; } + absl::optional needs_denoising() const override { + return absl::nullopt; + } bool GetStats(Stats* stats) override { return false; } diff --git a/pc/webrtcsdp.cc b/pc/webrtcsdp.cc index 4bfb9efa80..d068470086 100644 --- a/pc/webrtcsdp.cc +++ b/pc/webrtcsdp.cc @@ -2032,7 +2032,7 @@ bool ParseSessionDescription(const std::string& message, std::string(), error); } - // Optional lines + // absl::optional lines // Those are the optional lines, so shouldn't return false if not present. // RFC 4566 // i=* (session information) diff --git a/pc/webrtcsessiondescriptionfactory.cc b/pc/webrtcsessiondescriptionfactory.cc index 4a6221f334..3d89932224 100644 --- a/pc/webrtcsessiondescriptionfactory.cc +++ b/pc/webrtcsessiondescriptionfactory.cc @@ -175,7 +175,7 @@ WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory( // Request certificate. This happens asynchronously, so that the caller gets // a chance to connect to |SignalCertificateReady|. - cert_generator_->GenerateCertificateAsync(key_params, rtc::nullopt, + cert_generator_->GenerateCertificateAsync(key_params, absl::nullopt, callback); } }