Use webrtc name specifier instead of rtc/cricket in pc

WebRTC has unified all namespaces to webrtc, and the rtc:: and cricket::
name specifiers need to be replaced with webrtc::. This was generated using
a combination of clang AST rewriting tools and sed.

This CL was uploaded by git cl split.

Bug: webrtc:42232595
Change-Id: Ib7dd9291d727a1bc177d07960d19395b7e4fca2a
No-Iwyu: LSC
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/386649
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Auto-Submit: Evan Shrubsole <eshr@webrtc.org>
Commit-Queue: Evan Shrubsole <eshr@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#44387}
diff --git a/pc/audio_rtp_receiver.cc b/pc/audio_rtp_receiver.cc
index b901355..10bd129 100644
--- a/pc/audio_rtp_receiver.cc
+++ b/pc/audio_rtp_receiver.cc
@@ -53,12 +53,12 @@
 AudioRtpReceiver::AudioRtpReceiver(
     Thread* worker_thread,
     const std::string& receiver_id,
-    const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams,
+    const std::vector<scoped_refptr<MediaStreamInterface>>& streams,
     bool is_unified_plan,
     VoiceMediaReceiveChannelInterface* voice_channel /*= nullptr*/)
     : worker_thread_(worker_thread),
       id_(receiver_id),
-      source_(rtc::make_ref_counted<RemoteAudioSource>(
+      source_(make_ref_counted<RemoteAudioSource>(
           worker_thread,
           is_unified_plan
               ? RemoteAudioSource::OnAudioChannelGoneAction::kSurvive
@@ -128,8 +128,7 @@
   });
 }
 
-rtc::scoped_refptr<DtlsTransportInterface> AudioRtpReceiver::dtls_transport()
-    const {
+scoped_refptr<DtlsTransportInterface> AudioRtpReceiver::dtls_transport() const {
   RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
   return dtls_transport_;
 }
@@ -142,8 +141,8 @@
   return stream_ids;
 }
 
-std::vector<rtc::scoped_refptr<MediaStreamInterface>>
-AudioRtpReceiver::streams() const {
+std::vector<scoped_refptr<MediaStreamInterface>> AudioRtpReceiver::streams()
+    const {
   RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
   return streams_;
 }
@@ -159,7 +158,7 @@
 }
 
 void AudioRtpReceiver::SetFrameDecryptor(
-    rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor) {
+    scoped_refptr<FrameDecryptorInterface> frame_decryptor) {
   RTC_DCHECK_RUN_ON(worker_thread_);
   frame_decryptor_ = std::move(frame_decryptor);
   // Special Case: Set the frame decryptor to any value on any existing channel.
@@ -168,8 +167,8 @@
   }
 }
 
-rtc::scoped_refptr<FrameDecryptorInterface>
-AudioRtpReceiver::GetFrameDecryptor() const {
+scoped_refptr<FrameDecryptorInterface> AudioRtpReceiver::GetFrameDecryptor()
+    const {
   RTC_DCHECK_RUN_ON(worker_thread_);
   return frame_decryptor_;
 }
@@ -244,13 +243,13 @@
 }
 
 void AudioRtpReceiver::set_transport(
-    rtc::scoped_refptr<DtlsTransportInterface> dtls_transport) {
+    scoped_refptr<DtlsTransportInterface> dtls_transport) {
   RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
   dtls_transport_ = std::move(dtls_transport);
 }
 
 void AudioRtpReceiver::SetStreams(
-    const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams) {
+    const std::vector<scoped_refptr<MediaStreamInterface>>& streams) {
   RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
   // Remove remote track from any streams that are going away.
   for (const auto& existing_stream : streams_) {
@@ -293,7 +292,7 @@
 }
 
 void AudioRtpReceiver::SetFrameTransformer(
-    rtc::scoped_refptr<FrameTransformerInterface> frame_transformer) {
+    scoped_refptr<FrameTransformerInterface> frame_transformer) {
   RTC_DCHECK_RUN_ON(worker_thread_);
   if (media_channel_) {
     media_channel_->SetDepacketizerToDecoderFrameTransformer(
diff --git a/pc/audio_rtp_receiver.h b/pc/audio_rtp_receiver.h
index ebec9b3..df88699 100644
--- a/pc/audio_rtp_receiver.h
+++ b/pc/audio_rtp_receiver.h
@@ -59,7 +59,7 @@
   AudioRtpReceiver(
       Thread* worker_thread,
       const std::string& receiver_id,
-      const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams,
+      const std::vector<scoped_refptr<MediaStreamInterface>>& streams,
       bool is_unified_plan,
       VoiceMediaReceiveChannelInterface* media_channel = nullptr);
   virtual ~AudioRtpReceiver();
@@ -70,16 +70,15 @@
   // AudioSourceInterface::AudioObserver implementation
   void OnSetVolume(double volume) override;
 
-  rtc::scoped_refptr<AudioTrackInterface> audio_track() const { return track_; }
+  scoped_refptr<AudioTrackInterface> audio_track() const { return track_; }
 
   // RtpReceiverInterface implementation
-  rtc::scoped_refptr<MediaStreamTrackInterface> track() const override {
+  scoped_refptr<MediaStreamTrackInterface> track() const override {
     return track_;
   }
-  rtc::scoped_refptr<DtlsTransportInterface> dtls_transport() const override;
+  scoped_refptr<DtlsTransportInterface> dtls_transport() const override;
   std::vector<std::string> stream_ids() const override;
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams()
-      const override;
+  std::vector<scoped_refptr<MediaStreamInterface>> streams() const override;
 
   webrtc::MediaType media_type() const override {
     return webrtc::MediaType::AUDIO;
@@ -90,10 +89,9 @@
   RtpParameters GetParameters() const override;
 
   void SetFrameDecryptor(
-      rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor) override;
+      scoped_refptr<FrameDecryptorInterface> frame_decryptor) override;
 
-  rtc::scoped_refptr<FrameDecryptorInterface> GetFrameDecryptor()
-      const override;
+  scoped_refptr<FrameDecryptorInterface> GetFrameDecryptor() const override;
 
   // RtpReceiverInternal implementation.
   void Stop() override;
@@ -103,9 +101,9 @@
   void NotifyFirstPacketReceived() override;
   void set_stream_ids(std::vector<std::string> stream_ids) override;
   void set_transport(
-      rtc::scoped_refptr<DtlsTransportInterface> dtls_transport) override;
-  void SetStreams(const std::vector<rtc::scoped_refptr<MediaStreamInterface>>&
-                      streams) override;
+      scoped_refptr<DtlsTransportInterface> dtls_transport) override;
+  void SetStreams(
+      const std::vector<scoped_refptr<MediaStreamInterface>>& streams) override;
   void SetObserver(RtpReceiverObserverInterface* observer) override;
 
   void SetJitterBufferMinimumDelay(
@@ -116,7 +114,7 @@
   std::vector<RtpSource> GetSources() const override;
   int AttachmentId() const override { return attachment_id_; }
   void SetFrameTransformer(
-      rtc::scoped_refptr<FrameTransformerInterface> frame_transformer) override;
+      scoped_refptr<FrameTransformerInterface> frame_transformer) override;
 
  private:
   void RestartMediaChannel(std::optional<uint32_t> ssrc)
@@ -131,12 +129,12 @@
   RTC_NO_UNIQUE_ADDRESS SequenceChecker signaling_thread_checker_;
   Thread* const worker_thread_;
   const std::string id_;
-  const rtc::scoped_refptr<RemoteAudioSource> source_;
-  const rtc::scoped_refptr<AudioTrackProxyWithInternal<AudioTrack>> track_;
+  const scoped_refptr<RemoteAudioSource> source_;
+  const scoped_refptr<AudioTrackProxyWithInternal<AudioTrack>> track_;
   VoiceMediaReceiveChannelInterface* media_channel_
       RTC_GUARDED_BY(worker_thread_) = nullptr;
   std::optional<uint32_t> signaled_ssrc_ RTC_GUARDED_BY(worker_thread_);
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams_
+  std::vector<scoped_refptr<MediaStreamInterface>> streams_
       RTC_GUARDED_BY(&signaling_thread_checker_);
   bool cached_track_enabled_ RTC_GUARDED_BY(&signaling_thread_checker_);
   double cached_volume_ RTC_GUARDED_BY(worker_thread_) = 1.0;
@@ -145,16 +143,16 @@
   bool received_first_packet_ RTC_GUARDED_BY(&signaling_thread_checker_) =
       false;
   const int attachment_id_;
-  rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor_
+  scoped_refptr<FrameDecryptorInterface> frame_decryptor_
       RTC_GUARDED_BY(worker_thread_);
-  rtc::scoped_refptr<DtlsTransportInterface> dtls_transport_
+  scoped_refptr<DtlsTransportInterface> dtls_transport_
       RTC_GUARDED_BY(&signaling_thread_checker_);
   // Stores and updates the playout delay. Handles caching cases if
   // `SetJitterBufferMinimumDelay` is called before start.
   JitterBufferDelay delay_ RTC_GUARDED_BY(worker_thread_);
-  rtc::scoped_refptr<FrameTransformerInterface> frame_transformer_
+  scoped_refptr<FrameTransformerInterface> frame_transformer_
       RTC_GUARDED_BY(worker_thread_);
-  const rtc::scoped_refptr<PendingTaskSafetyFlag> worker_thread_safety_;
+  const scoped_refptr<PendingTaskSafetyFlag> worker_thread_safety_;
 };
 
 }  // namespace webrtc
diff --git a/pc/audio_rtp_receiver_unittest.cc b/pc/audio_rtp_receiver_unittest.cc
index fd4e271..91614d7 100644
--- a/pc/audio_rtp_receiver_unittest.cc
+++ b/pc/audio_rtp_receiver_unittest.cc
@@ -41,11 +41,10 @@
  protected:
   AudioRtpReceiverTest()
       : worker_(Thread::Current()),
-        receiver_(
-            rtc::make_ref_counted<AudioRtpReceiver>(worker_,
-                                                    std::string(),
-                                                    std::vector<std::string>(),
-                                                    false)) {
+        receiver_(make_ref_counted<AudioRtpReceiver>(worker_,
+                                                     std::string(),
+                                                     std::vector<std::string>(),
+                                                     false)) {
     EXPECT_CALL(receive_channel_, SetRawAudioSink(kSsrc, _));
     EXPECT_CALL(receive_channel_, SetBaseMinimumPlayoutDelayMs(kSsrc, _));
   }
@@ -57,7 +56,7 @@
 
   AutoThread main_thread_;
   Thread* worker_;
-  rtc::scoped_refptr<AudioRtpReceiver> receiver_;
+  scoped_refptr<AudioRtpReceiver> receiver_;
   MockVoiceMediaReceiveChannelInterface receive_channel_;
 };
 
@@ -110,9 +109,9 @@
   test::RunLoop loop;
   auto* thread = Thread::Current();  // Points to loop's thread.
   MockVoiceMediaReceiveChannelInterface receive_channel;
-  auto receiver = rtc::make_ref_counted<AudioRtpReceiver>(
-      thread, std::string(), std::vector<std::string>(), true,
-      &receive_channel);
+  auto receiver = make_ref_counted<AudioRtpReceiver>(thread, std::string(),
+                                                     std::vector<std::string>(),
+                                                     true, &receive_channel);
 
   EXPECT_CALL(receive_channel, SetDefaultRawAudioSink(_)).Times(1);
   EXPECT_CALL(receive_channel, SetDefaultOutputVolume(kDefaultVolume)).Times(1);
diff --git a/pc/audio_track.cc b/pc/audio_track.cc
index 7d6dc9a..dc446c4 100644
--- a/pc/audio_track.cc
+++ b/pc/audio_track.cc
@@ -22,14 +22,14 @@
 namespace webrtc {
 
 // static
-rtc::scoped_refptr<AudioTrack> AudioTrack::Create(
+scoped_refptr<AudioTrack> AudioTrack::Create(
     absl::string_view id,
-    const rtc::scoped_refptr<AudioSourceInterface>& source) {
-  return rtc::make_ref_counted<AudioTrack>(id, source);
+    const scoped_refptr<AudioSourceInterface>& source) {
+  return make_ref_counted<AudioTrack>(id, source);
 }
 
 AudioTrack::AudioTrack(absl::string_view label,
-                       const rtc::scoped_refptr<AudioSourceInterface>& source)
+                       const scoped_refptr<AudioSourceInterface>& source)
     : MediaStreamTrack<AudioTrackInterface>(label), audio_source_(source) {
   if (audio_source_) {
     audio_source_->RegisterObserver(this);
diff --git a/pc/audio_track.h b/pc/audio_track.h
index d8e6eed..7b7f5af 100644
--- a/pc/audio_track.h
+++ b/pc/audio_track.h
@@ -31,7 +31,7 @@
  protected:
   // Protected ctor to force use of factory method.
   AudioTrack(absl::string_view label,
-             const rtc::scoped_refptr<AudioSourceInterface>& source);
+             const scoped_refptr<AudioSourceInterface>& source);
 
   AudioTrack() = delete;
   AudioTrack(const AudioTrack&) = delete;
@@ -40,9 +40,9 @@
   ~AudioTrack() override;
 
  public:
-  static rtc::scoped_refptr<AudioTrack> Create(
+  static scoped_refptr<AudioTrack> Create(
       absl::string_view id,
-      const rtc::scoped_refptr<AudioSourceInterface>& source);
+      const scoped_refptr<AudioSourceInterface>& source);
 
   // MediaStreamTrack implementation.
   std::string kind() const override;
@@ -58,7 +58,7 @@
   void OnChanged() override;
 
  private:
-  const rtc::scoped_refptr<AudioSourceInterface> audio_source_;
+  const scoped_refptr<AudioSourceInterface> audio_source_;
   RTC_NO_UNIQUE_ADDRESS SequenceChecker signaling_thread_checker_;
 };
 
diff --git a/pc/channel.cc b/pc/channel.cc
index 64883cc..deeb8b7 100644
--- a/pc/channel.cc
+++ b/pc/channel.cc
@@ -55,7 +55,7 @@
 namespace webrtc {
 namespace {
 
-using ::rtc::UniqueRandomIdGenerator;
+using ::webrtc::UniqueRandomIdGenerator;
 
 // Finds a stream based on target's Primary SSRC or RIDs.
 // This struct is used in BaseChannel::UpdateLocalStreams_w.
@@ -183,14 +183,14 @@
   rtp_transport_->SubscribeReadyToSend(
       this, [this](bool ready) { OnTransportReadyToSend(ready); });
   rtp_transport_->SubscribeNetworkRouteChanged(
-      this, [this](std::optional<rtc::NetworkRoute> route) {
+      this, [this](std::optional<NetworkRoute> route) {
         OnNetworkRouteChanged(route);
       });
   rtp_transport_->SubscribeWritableState(
       this, [this](bool state) { OnWritableState(state); });
   rtp_transport_->SubscribeSentPacket(
       this,
-      [this](const rtc::SentPacket& packet) { SignalSentPacket_n(packet); });
+      [this](const SentPacketInfo& packet) { SignalSentPacket_n(packet); });
   return true;
 }
 
@@ -309,12 +309,12 @@
 }
 
 bool BaseChannel::SendPacket(CopyOnWriteBuffer* packet,
-                             const rtc::PacketOptions& options) {
+                             const AsyncSocketPacketOptions& options) {
   return SendPacket(false, packet, options);
 }
 
 bool BaseChannel::SendRtcp(CopyOnWriteBuffer* packet,
-                           const rtc::PacketOptions& options) {
+                           const AsyncSocketPacketOptions& options) {
   return SendPacket(true, packet, options);
 }
 
@@ -391,7 +391,7 @@
 
 bool BaseChannel::SendPacket(bool rtcp,
                              CopyOnWriteBuffer* packet,
-                             const rtc::PacketOptions& options) {
+                             const AsyncSocketPacketOptions& options) {
   RTC_DCHECK_RUN_ON(network_thread());
   RTC_DCHECK(network_initialized());
   TRACE_EVENT0("webrtc", "BaseChannel::SendPacket");
@@ -436,10 +436,8 @@
     on_first_packet_sent_ = nullptr;
   }
 
-  return rtcp ? rtp_transport_->SendRtcpPacket(packet, options,
-                                               cricket::PF_SRTP_BYPASS)
-              : rtp_transport_->SendRtpPacket(packet, options,
-                                              cricket::PF_SRTP_BYPASS);
+  return rtcp ? rtp_transport_->SendRtcpPacket(packet, options, PF_SRTP_BYPASS)
+              : rtp_transport_->SendRtpPacket(packet, options, PF_SRTP_BYPASS);
 }
 
 void BaseChannel::OnRtpPacket(const RtpPacketReceived& parsed_packet) {
@@ -655,7 +653,7 @@
 
   // Check for streams that have been removed.
   bool ret = true;
-  for (const cricket::StreamParams& old_stream : local_streams_) {
+  for (const StreamParams& old_stream : local_streams_) {
     if (!old_stream.has_ssrcs() ||
         GetStream(streams, StreamFinder(&old_stream))) {
       continue;
@@ -670,7 +668,7 @@
   }
   // Check for new streams.
   std::vector<StreamParams> all_streams;
-  for (const cricket::StreamParams& stream : streams) {
+  for (const StreamParams& stream : streams) {
     StreamParams* existing = GetStream(local_streams_, StreamFinder(&stream));
     if (existing) {
       // Parameters cannot change for an existing stream.
@@ -736,7 +734,7 @@
   const bool old_has_unsignaled_ssrcs = HasStreamWithNoSsrcs(remote_streams_);
 
   // Check for streams that have been removed.
-  for (const cricket::StreamParams& old_stream : remote_streams_) {
+  for (const StreamParams& old_stream : remote_streams_) {
     // If we no longer have an unsignaled stream, we would like to remove
     // the unsignaled stream params that are cached.
     if (!old_stream.has_ssrcs() && !new_has_unsignaled_ssrcs) {
@@ -760,7 +758,7 @@
 
   // Check for new streams.
   flat_set<uint32_t> ssrcs;
-  for (const cricket::StreamParams& new_stream : streams) {
+  for (const StreamParams& new_stream : streams) {
     // We allow a StreamParams with an empty list of SSRCs, in which case the
     // MediaChannel will cache the parameters and use them for any unsignaled
     // stream received later.
@@ -836,7 +834,7 @@
   return !was_empty;
 }
 
-void BaseChannel::SignalSentPacket_n(const rtc::SentPacket& sent_packet) {
+void BaseChannel::SignalSentPacket_n(const SentPacketInfo& sent_packet) {
   RTC_DCHECK_RUN_ON(network_thread());
   RTC_DCHECK(network_initialized());
   media_send_channel()->OnPacketSent(sent_packet);
diff --git a/pc/channel.h b/pc/channel.h
index 98fb010..0d367b0 100644
--- a/pc/channel.h
+++ b/pc/channel.h
@@ -220,9 +220,9 @@
 
   // NetworkInterface implementation, called by MediaEngine
   bool SendPacket(CopyOnWriteBuffer* packet,
-                  const rtc::PacketOptions& options) override;
+                  const AsyncSocketPacketOptions& options) override;
   bool SendRtcp(CopyOnWriteBuffer* packet,
-                const rtc::PacketOptions& options) override;
+                const AsyncSocketPacketOptions& options) override;
 
   // From RtpTransportInternal
   void OnWritableState(bool writable);
@@ -231,7 +231,7 @@
 
   bool SendPacket(bool rtcp,
                   CopyOnWriteBuffer* packet,
-                  const rtc::PacketOptions& options);
+                  const AsyncSocketPacketOptions& options);
 
   void EnableMedia_w() RTC_RUN_ON(worker_thread());
   void DisableMedia_w() RTC_RUN_ON(worker_thread());
@@ -308,7 +308,7 @@
  private:
   bool ConnectToRtpTransport_n() RTC_RUN_ON(network_thread());
   void DisconnectFromRtpTransport_n() RTC_RUN_ON(network_thread());
-  void SignalSentPacket_n(const rtc::SentPacket& sent_packet);
+  void SignalSentPacket_n(const SentPacketInfo& sent_packet);
 
   TaskQueueBase* const worker_thread_;
   Thread* const network_thread_;
diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc
index d447668..bdb4a05 100644
--- a/pc/channel_unittest.cc
+++ b/pc/channel_unittest.cc
@@ -67,10 +67,10 @@
 
 namespace {
 
-using ::cricket::DtlsTransportInternal;
 using ::testing::AllOf;
 using ::testing::ElementsAre;
 using ::testing::Field;
+using ::webrtc::DtlsTransportInternal;
 using ::webrtc::FakeVoiceMediaReceiveChannel;
 using ::webrtc::FakeVoiceMediaSendChannel;
 using ::webrtc::RidDescription;
@@ -145,8 +145,8 @@
   };
 
   ChannelTest(bool verify_playout,
-              rtc::ArrayView<const uint8_t> rtp_data,
-              rtc::ArrayView<const uint8_t> rtcp_data,
+              webrtc::ArrayView<const uint8_t> rtp_data,
+              webrtc::ArrayView<const uint8_t> rtcp_data,
               NetworkIsWorker network_is_worker)
       : verify_playout_(verify_playout),
         rtp_packet_(rtp_data.data(), rtp_data.size()),
@@ -469,27 +469,28 @@
     return result;
   }
 
-  void SendRtp(typename T::MediaSendChannel* media_channel, rtc::Buffer data) {
+  void SendRtp(typename T::MediaSendChannel* media_channel,
+               webrtc::Buffer data) {
     network_thread_->PostTask(webrtc::SafeTask(
         network_thread_safety_, [media_channel, data = std::move(data)]() {
           media_channel->SendPacket(data.data(), data.size(),
-                                    rtc::PacketOptions());
+                                    webrtc::AsyncSocketPacketOptions());
         }));
   }
 
   void SendRtp1() {
-    SendRtp1(rtc::Buffer(rtp_packet_.data(), rtp_packet_.size()));
+    SendRtp1(webrtc::Buffer(rtp_packet_.data(), rtp_packet_.size()));
   }
 
-  void SendRtp1(rtc::Buffer data) {
+  void SendRtp1(webrtc::Buffer data) {
     SendRtp(media_send_channel1_impl(), std::move(data));
   }
 
   void SendRtp2() {
-    SendRtp2(rtc::Buffer(rtp_packet_.data(), rtp_packet_.size()));
+    SendRtp2(webrtc::Buffer(rtp_packet_.data(), rtp_packet_.size()));
   }
 
-  void SendRtp2(rtc::Buffer data) {
+  void SendRtp2(webrtc::Buffer data) {
     SendRtp(media_send_channel2_impl(), std::move(data));
   }
 
@@ -511,15 +512,17 @@
   }
   // Methods to check custom data.
   bool CheckCustomRtp1(uint32_t ssrc, int sequence_number, int pl_type = -1) {
-    rtc::Buffer data = CreateRtpData(ssrc, sequence_number, pl_type);
+    webrtc::Buffer data = CreateRtpData(ssrc, sequence_number, pl_type);
     return media_receive_channel1_impl()->CheckRtp(data.data(), data.size());
   }
   bool CheckCustomRtp2(uint32_t ssrc, int sequence_number, int pl_type = -1) {
-    rtc::Buffer data = CreateRtpData(ssrc, sequence_number, pl_type);
+    webrtc::Buffer data = CreateRtpData(ssrc, sequence_number, pl_type);
     return media_receive_channel2_impl()->CheckRtp(data.data(), data.size());
   }
-  rtc::Buffer CreateRtpData(uint32_t ssrc, int sequence_number, int pl_type) {
-    rtc::Buffer data(rtp_packet_.data(), rtp_packet_.size());
+  webrtc::Buffer CreateRtpData(uint32_t ssrc,
+                               int sequence_number,
+                               int pl_type) {
+    webrtc::Buffer data(rtp_packet_.data(), rtp_packet_.size());
     // Set SSRC in the rtp packet copy.
     webrtc::SetBE32(data.data() + 8, ssrc);
     webrtc::SetBE16(data.data() + 2, sequence_number);
@@ -1488,7 +1491,9 @@
   }
 
  protected:
-  void WaitForThreads() { WaitForThreads(rtc::ArrayView<rtc::Thread*>()); }
+  void WaitForThreads() {
+    WaitForThreads(webrtc::ArrayView<webrtc::Thread*>());
+  }
   static void ProcessThreadQueue(webrtc::Thread* thread) {
     RTC_DCHECK(thread->IsCurrent());
     while (!thread->empty()) {
@@ -1498,9 +1503,9 @@
   static void FlushCurrentThread() {
     webrtc::Thread::Current()->ProcessMessages(0);
   }
-  void WaitForThreads(rtc::ArrayView<rtc::Thread*> threads) {
+  void WaitForThreads(webrtc::ArrayView<webrtc::Thread*> threads) {
     // `threads` and current thread post packets to network thread.
-    for (rtc::Thread* thread : threads) {
+    for (webrtc::Thread* thread : threads) {
       SendTask(thread, [thread] { ProcessThreadQueue(thread); });
     }
     ProcessThreadQueue(webrtc::Thread::Current());
@@ -1562,7 +1567,7 @@
   // TODO(pbos): Remove playout from all media channels and let renderers mute
   // themselves.
   const bool verify_playout_;
-  rtc::scoped_refptr<webrtc::PendingTaskSafetyFlag> network_thread_safety_ =
+  webrtc::scoped_refptr<webrtc::PendingTaskSafetyFlag> network_thread_safety_ =
       webrtc::PendingTaskSafetyFlag::CreateDetached();
   std::unique_ptr<webrtc::Thread> network_thread_keeper_;
   webrtc::Thread* network_thread_;
@@ -1585,8 +1590,8 @@
   typename T::Content remote_media_content1_;
   typename T::Content remote_media_content2_;
   // The RTP and RTCP packets to send in the tests.
-  rtc::Buffer rtp_packet_;
-  rtc::Buffer rtcp_packet_;
+  webrtc::Buffer rtp_packet_;
+  webrtc::Buffer rtcp_packet_;
   webrtc::CandidatePairInterface* last_selected_candidate_pair_;
   webrtc::UniqueRandomIdGenerator ssrc_generator_;
   webrtc::test::ScopedKeyValueConfig field_trials_;
diff --git a/pc/codec_vendor.cc b/pc/codec_vendor.cc
index 444832e..b7f6423 100644
--- a/pc/codec_vendor.cc
+++ b/pc/codec_vendor.cc
@@ -287,7 +287,7 @@
         continue;
       }
 
-      rtx_codec.params[cricket::kCodecParamAssociatedPayloadType] =
+      rtx_codec.params[kCodecParamAssociatedPayloadType] =
           absl::StrCat(matching_codec->id);
       used_pltypes->FindAndSetIdUsed(&rtx_codec);
       offered_codecs.push_back(rtx_codec);
@@ -307,7 +307,7 @@
           continue;
         }
 
-        red_codec.params[cricket::kCodecParamNotInNameValueFormat] =
+        red_codec.params[kCodecParamNotInNameValueFormat] =
             absl::StrCat(matching_codec->id) + "/" +
             absl::StrCat(matching_codec->id);
       }
diff --git a/pc/codec_vendor_unittest.cc b/pc/codec_vendor_unittest.cc
index a9ed68a..f4cfef0 100644
--- a/pc/codec_vendor_unittest.cc
+++ b/pc/codec_vendor_unittest.cc
@@ -38,7 +38,7 @@
 namespace webrtc {
 namespace {
 
-using cricket::FakeMediaEngine;
+using webrtc::FakeMediaEngine;
 
 using testing::Contains;
 using testing::Eq;
diff --git a/pc/connection_context.cc b/pc/connection_context.cc
index ac7bedb..0e208ea 100644
--- a/pc/connection_context.cc
+++ b/pc/connection_context.cc
@@ -57,7 +57,7 @@
   }
   auto this_thread = Thread::Current();
   if (!this_thread) {
-    // If this thread isn't already wrapped by an rtc::Thread, create a
+    // If this thread isn't already wrapped by an webrtc::Thread, create a
     // wrapper and own it in this class.
     this_thread = ThreadManager::Instance()->WrapCurrentThread();
     wraps_current_thread = true;
@@ -81,10 +81,10 @@
 }  // namespace
 
 // Static
-rtc::scoped_refptr<ConnectionContext> ConnectionContext::Create(
+scoped_refptr<ConnectionContext> ConnectionContext::Create(
     const Environment& env,
     PeerConnectionFactoryDependencies* dependencies) {
-  return rtc::scoped_refptr<ConnectionContext>(
+  return scoped_refptr<ConnectionContext>(
       new ConnectionContext(env, dependencies));
 }
 
@@ -150,8 +150,8 @@
       // TODO(bugs.webrtc.org/13145): This case should be deleted. Either
       // require that a PacketSocketFactory and NetworkManager always are
       // injected (with no need to construct these default objects), or require
-      // that if a network_thread is injected, an approprite rtc::SocketServer
-      // should be injected too.
+      // that if a network_thread is injected, an approprite
+      // webrtc::SocketServer should be injected too.
       socket_factory = network_thread()->socketserver();
     }
   }
diff --git a/pc/connection_context.h b/pc/connection_context.h
index 60f1ef6..9d27561 100644
--- a/pc/connection_context.h
+++ b/pc/connection_context.h
@@ -42,7 +42,7 @@
   // Creates a ConnectionContext. May return null if initialization fails.
   // The Dependencies class allows simple management of all new dependencies
   // being added to the ConnectionContext.
-  static rtc::scoped_refptr<ConnectionContext> Create(
+  static scoped_refptr<ConnectionContext> Create(
       const Environment& env,
       PeerConnectionFactoryDependencies* dependencies);
 
diff --git a/pc/data_channel_controller.cc b/pc/data_channel_controller.cc
index 63cf193..f8018d7 100644
--- a/pc/data_channel_controller.cc
+++ b/pc/data_channel_controller.cc
@@ -69,10 +69,9 @@
   event_observer_ = std::move(observer);
 }
 
-RTCError DataChannelController::SendData(
-    StreamId sid,
-    const SendDataParams& params,
-    const rtc::CopyOnWriteBuffer& payload) {
+RTCError DataChannelController::SendData(StreamId sid,
+                                         const SendDataParams& params,
+                                         const CopyOnWriteBuffer& payload) {
   RTC_DCHECK_RUN_ON(network_thread());
   if (!data_channel_transport_) {
     RTC_LOG(LS_ERROR) << "SendData called before transport is ready";
@@ -157,10 +156,9 @@
                                                          bytes);
 }
 
-void DataChannelController::OnDataReceived(
-    int channel_id,
-    DataMessageType type,
-    const rtc::CopyOnWriteBuffer& buffer) {
+void DataChannelController::OnDataReceived(int channel_id,
+                                           DataMessageType type,
+                                           const CopyOnWriteBuffer& buffer) {
   RTC_DCHECK_RUN_ON(network_thread());
 
   if (HandleOpenMessage_n(channel_id, type, buffer))
@@ -200,7 +198,7 @@
                             [&](const auto& c) { return c->sid_n() == sid; });
 
   if (it != sctp_data_channels_n_.end()) {
-    rtc::scoped_refptr<SctpDataChannel> channel = std::move(*it);
+    scoped_refptr<SctpDataChannel> channel = std::move(*it);
     sctp_data_channels_n_.erase(it);
     channel->OnClosingProcedureComplete();
   }
@@ -229,7 +227,7 @@
   // `OnSctpDataChannelClosed`. We'll empty `sctp_data_channels_n_`, first
   // and `OnSctpDataChannelClosed` will become a noop but we'll release the
   // StreamId here.
-  std::vector<rtc::scoped_refptr<SctpDataChannel>> temp_sctp_dcs;
+  std::vector<scoped_refptr<SctpDataChannel>> temp_sctp_dcs;
   temp_sctp_dcs.swap(sctp_data_channels_n_);
   for (const auto& channel : temp_sctp_dcs) {
     channel->OnTransportChannelClosed(error);
@@ -295,7 +293,7 @@
 bool DataChannelController::HandleOpenMessage_n(
     int channel_id,
     DataMessageType type,
-    const rtc::CopyOnWriteBuffer& buffer) {
+    const CopyOnWriteBuffer& buffer) {
   if (type != DataMessageType::kControl || !IsOpenMessage(buffer))
     return false;
 
@@ -327,7 +325,7 @@
 }
 
 void DataChannelController::OnDataChannelOpenMessage(
-    rtc::scoped_refptr<SctpDataChannel> channel,
+    scoped_refptr<SctpDataChannel> channel,
     bool ready_to_send) {
   channel_usage_ = DataChannelUsage::kInUse;
   auto proxy = SctpDataChannel::CreateProxy(channel, signaling_safety_.flag());
@@ -369,7 +367,7 @@
 }
 
 // RTC_RUN_ON(network_thread())
-RTCErrorOr<rtc::scoped_refptr<SctpDataChannel>>
+RTCErrorOr<scoped_refptr<SctpDataChannel>>
 DataChannelController::CreateDataChannel(const std::string& label,
                                          InternalDataChannelInit& config) {
   std::optional<StreamId> sid = std::nullopt;
@@ -389,7 +387,7 @@
     config.id = sid->stream_id_int();
   }
 
-  rtc::scoped_refptr<SctpDataChannel> channel = SctpDataChannel::Create(
+  scoped_refptr<SctpDataChannel> channel = SctpDataChannel::Create(
       weak_factory_.GetWeakPtr(), label, data_channel_transport_ != nullptr,
       config, signaling_thread(), network_thread());
   RTC_DCHECK(channel);
@@ -403,7 +401,7 @@
   return channel;
 }
 
-RTCErrorOr<rtc::scoped_refptr<DataChannelInterface>>
+RTCErrorOr<scoped_refptr<DataChannelInterface>>
 DataChannelController::InternalCreateDataChannelWithProxy(
     const std::string& label,
     const InternalDataChannelInit& config) {
@@ -417,7 +415,7 @@
   bool ready_to_send = false;
   InternalDataChannelInit new_config = config;
   auto ret = network_thread()->BlockingCall(
-      [&]() -> RTCErrorOr<rtc::scoped_refptr<SctpDataChannel>> {
+      [&]() -> RTCErrorOr<scoped_refptr<SctpDataChannel>> {
         RTC_DCHECK_RUN_ON(network_thread());
         auto channel = CreateDataChannel(label, new_config);
         if (!channel.ok())
@@ -454,7 +452,7 @@
       data_channel_transport_ && data_channel_transport_->IsReadyToSend();
 
   std::vector<std::pair<SctpDataChannel*, StreamId>> channels_to_update;
-  std::vector<rtc::scoped_refptr<SctpDataChannel>> channels_to_close;
+  std::vector<scoped_refptr<SctpDataChannel>> channels_to_close;
   for (auto it = sctp_data_channels_n_.begin();
        it != sctp_data_channels_n_.end();) {
     if (!(*it)->sid_n().has_value()) {
@@ -538,7 +536,7 @@
                                     ? Message::DataType::kBinary
                                     : Message::DataType::kString;
   message.set_data_type(data_type);
-  message.set_unix_timestamp_ms(rtc::TimeUTCMillis());
+  message.set_unix_timestamp_ms(TimeUTCMillis());
   message.set_datachannel_id(sid.stream_id_int());
   message.set_label((*it)->label());
   message.set_direction(direction);
diff --git a/pc/data_channel_controller.h b/pc/data_channel_controller.h
index a204a09..b9e8c60 100644
--- a/pc/data_channel_controller.h
+++ b/pc/data_channel_controller.h
@@ -56,7 +56,7 @@
   // SctpDataChannelProviderInterface.
   RTCError SendData(StreamId sid,
                     const SendDataParams& params,
-                    const rtc::CopyOnWriteBuffer& payload) override;
+                    const CopyOnWriteBuffer& payload) override;
   void AddSctpDataStream(StreamId sid, PriorityValue priority) override;
   void RemoveSctpDataStream(StreamId sid) override;
   void OnChannelStateChanged(SctpDataChannel* channel,
@@ -68,7 +68,7 @@
   // Implements DataChannelSink.
   void OnDataReceived(int channel_id,
                       DataMessageType type,
-                      const rtc::CopyOnWriteBuffer& buffer) override;
+                      const CopyOnWriteBuffer& buffer) override;
   void OnChannelClosing(int channel_id) override;
   void OnChannelClosed(int channel_id) override;
   void OnReadyToSend() override;
@@ -93,7 +93,7 @@
 
   // Creates channel and adds it to the collection of DataChannels that will
   // be offered in a SessionDescription, and wraps it in a proxy object.
-  RTCErrorOr<rtc::scoped_refptr<DataChannelInterface>>
+  RTCErrorOr<scoped_refptr<DataChannelInterface>>
   InternalCreateDataChannelWithProxy(const std::string& label,
                                      const InternalDataChannelInit& config);
   void AllocateSctpSids(SSLRole role);
@@ -116,7 +116,7 @@
   void OnSctpDataChannelClosed(SctpDataChannel* channel);
 
   // Creates a new SctpDataChannel object on the network thread.
-  RTCErrorOr<rtc::scoped_refptr<SctpDataChannel>> CreateDataChannel(
+  RTCErrorOr<scoped_refptr<SctpDataChannel>> CreateDataChannel(
       const std::string& label,
       InternalDataChannelInit& config) RTC_RUN_ON(network_thread());
 
@@ -124,10 +124,10 @@
   // message and should be considered to be handled, false otherwise.
   bool HandleOpenMessage_n(int channel_id,
                            DataMessageType type,
-                           const rtc::CopyOnWriteBuffer& buffer)
+                           const CopyOnWriteBuffer& buffer)
       RTC_RUN_ON(network_thread());
   // Called when a valid data channel OPEN message is received.
-  void OnDataChannelOpenMessage(rtc::scoped_refptr<SctpDataChannel> channel,
+  void OnDataChannelOpenMessage(scoped_refptr<SctpDataChannel> channel,
                                 bool ready_to_send)
       RTC_RUN_ON(signaling_thread());
 
@@ -163,7 +163,7 @@
   DataChannelTransportInterface* data_channel_transport_
       RTC_GUARDED_BY(network_thread()) = nullptr;
   SctpSidAllocator sid_allocator_ RTC_GUARDED_BY(network_thread());
-  std::vector<rtc::scoped_refptr<SctpDataChannel>> sctp_data_channels_n_
+  std::vector<scoped_refptr<SctpDataChannel>> sctp_data_channels_n_
       RTC_GUARDED_BY(network_thread());
   enum class DataChannelUsage : uint8_t {
     kNeverUsed = 0,
diff --git a/pc/data_channel_controller_unittest.cc b/pc/data_channel_controller_unittest.cc
index 93c4c6c..88f8a9e 100644
--- a/pc/data_channel_controller_unittest.cc
+++ b/pc/data_channel_controller_unittest.cc
@@ -64,7 +64,7 @@
               SendData,
               (int channel_id,
                const SendDataParams& params,
-               const rtc::CopyOnWriteBuffer& buffer),
+               const webrtc::CopyOnWriteBuffer& buffer),
               (override));
   MOCK_METHOD(RTCError, CloseChannel, (int channel_id), (override));
   MOCK_METHOD(void, SetDataSink, (DataChannelSink * sink), (override));
@@ -118,7 +118,7 @@
   DataChannelControllerTest()
       : network_thread_(std::make_unique<NullSocketServer>()) {
     network_thread_.Start();
-    pc_ = rtc::make_ref_counted<NiceMock<MockPeerConnectionInternal>>();
+    pc_ = make_ref_counted<NiceMock<MockPeerConnectionInternal>>();
     ON_CALL(*pc_, signaling_thread).WillByDefault(Return(Thread::Current()));
     ON_CALL(*pc_, network_thread).WillByDefault(Return(&network_thread_));
   }
@@ -131,7 +131,7 @@
   ScopedBaseFakeClock clock_;
   test::RunLoop run_loop_;
   Thread network_thread_;
-  rtc::scoped_refptr<NiceMock<MockPeerConnectionInternal>> pc_;
+  scoped_refptr<NiceMock<MockPeerConnectionInternal>> pc_;
 };
 
 TEST_F(DataChannelControllerTest, CreateAndDestroy) {
diff --git a/pc/data_channel_integrationtest.cc b/pc/data_channel_integrationtest.cc
index 6853a18..de87405 100644
--- a/pc/data_channel_integrationtest.cc
+++ b/pc/data_channel_integrationtest.cc
@@ -134,7 +134,7 @@
     std::unique_ptr<SessionDescriptionInterface>& desc) {
   auto& transport_infos = desc->description()->transport_infos();
   for (auto& transport_info : transport_infos) {
-    transport_info.description.connection_role = cricket::CONNECTIONROLE_ACTIVE;
+    transport_info.description.connection_role = CONNECTIONROLE_ACTIVE;
   }
 }
 
@@ -142,8 +142,7 @@
     std::unique_ptr<SessionDescriptionInterface>& desc) {
   auto& transport_infos = desc->description()->transport_infos();
   for (auto& transport_info : transport_infos) {
-    transport_info.description.connection_role =
-        cricket::CONNECTIONROLE_PASSIVE;
+    transport_info.description.connection_role = CONNECTIONROLE_PASSIVE;
   }
 }
 
@@ -434,7 +433,7 @@
   EXPECT_FALSE(caller()->data_observer()->messages().back().binary);
 
   // Sending empty binary data
-  rtc::CopyOnWriteBuffer empty_buffer;
+  CopyOnWriteBuffer empty_buffer;
   caller()->data_channel()->Send(DataBuffer(empty_buffer, true));
   EXPECT_THAT(
       WaitUntil(
@@ -1513,10 +1512,9 @@
       bool addTurn) {
     RTCConfiguration config;
     if (addTurn) {
-      static const rtc::SocketAddress turn_server_1_internal_address{
-          "192.0.2.1", 3478};
-      static const rtc::SocketAddress turn_server_1_external_address{
-          "192.0.3.1", 0};
+      static const SocketAddress turn_server_1_internal_address{"192.0.2.1",
+                                                                3478};
+      static const SocketAddress turn_server_1_external_address{"192.0.3.1", 0};
       TestTurnServer* turn_server_1 = CreateTurnServer(
           turn_server_1_internal_address, turn_server_1_external_address);
 
diff --git a/pc/data_channel_unittest.cc b/pc/data_channel_unittest.cc
index d81db2c..293d33f 100644
--- a/pc/data_channel_unittest.cc
+++ b/pc/data_channel_unittest.cc
@@ -120,7 +120,7 @@
   // in the SctpDataChannel code is (still) tied to the signaling thread, but
   // the `AddSctpDataStream` operation is a bridge to the transport and needs
   // to run on the network thread.
-  void SetChannelSid(const rtc::scoped_refptr<SctpDataChannel>& channel,
+  void SetChannelSid(const scoped_refptr<SctpDataChannel>& channel,
                      StreamId sid) {
     network_thread_.BlockingCall([&]() {
       channel->SetSctpSid_n(sid);
@@ -150,12 +150,12 @@
   test::RunLoop run_loop_;
   Thread network_thread_;
   InternalDataChannelInit init_;
-  rtc::scoped_refptr<PendingTaskSafetyFlag> signaling_safety_ =
+  scoped_refptr<PendingTaskSafetyFlag> signaling_safety_ =
       PendingTaskSafetyFlag::Create();
   std::unique_ptr<FakeDataChannelController> controller_;
   std::unique_ptr<FakeDataChannelObserver> observer_;
-  rtc::scoped_refptr<SctpDataChannel> inner_channel_;
-  rtc::scoped_refptr<DataChannelInterface> channel_;
+  scoped_refptr<SctpDataChannel> inner_channel_;
+  scoped_refptr<DataChannelInterface> channel_;
 };
 
 TEST_F(SctpDataChannelTest, VerifyConfigurationGetters) {
@@ -187,7 +187,7 @@
 // Verifies that the data channel is connected to the transport after creation.
 TEST_F(SctpDataChannelTest, ConnectedToTransportOnCreated) {
   controller_->set_transport_available(true);
-  rtc::scoped_refptr<SctpDataChannel> dc =
+  scoped_refptr<SctpDataChannel> dc =
       controller_->CreateDataChannel("test1", init_);
   EXPECT_TRUE(controller_->IsConnected(dc.get()));
 
@@ -257,7 +257,7 @@
   InternalDataChannelInit init;
   init.id = 1;
   init.ordered = false;
-  rtc::scoped_refptr<SctpDataChannel> dc =
+  scoped_refptr<SctpDataChannel> dc =
       controller_->CreateDataChannel("test1", init);
   auto proxy = SctpDataChannel::CreateProxy(dc, signaling_safety_);
 
@@ -271,7 +271,7 @@
   EXPECT_TRUE(controller_->last_send_data_params().ordered);
 
   // Emulates receiving an OPEN_ACK message.
-  rtc::CopyOnWriteBuffer payload;
+  CopyOnWriteBuffer payload;
   WriteDataChannelOpenAckMessage(&payload);
   network_thread_.BlockingCall(
       [&] { dc->OnDataReceived(DataMessageType::kControl, payload); });
@@ -288,7 +288,7 @@
   InternalDataChannelInit init;
   init.id = 1;
   init.ordered = false;
-  rtc::scoped_refptr<SctpDataChannel> dc =
+  scoped_refptr<SctpDataChannel> dc =
       controller_->CreateDataChannel("test1", init);
   auto proxy = SctpDataChannel::CreateProxy(dc, signaling_safety_);
 
@@ -302,7 +302,7 @@
   EXPECT_TRUE(controller_->last_send_data_params().ordered);
 
   // Emulates receiving an OPEN_ACK message.
-  rtc::CopyOnWriteBuffer payload;
+  CopyOnWriteBuffer payload;
   WriteDataChannelOpenAckMessage(&payload);
   network_thread_.BlockingCall(
       [&] { dc->OnDataReceived(DataMessageType::kControl, payload); });
@@ -319,7 +319,7 @@
   InternalDataChannelInit init;
   init.id = 1;
   init.ordered = false;
-  rtc::scoped_refptr<SctpDataChannel> dc =
+  scoped_refptr<SctpDataChannel> dc =
       controller_->CreateDataChannel("test1", init);
   auto proxy = SctpDataChannel::CreateProxy(dc, signaling_safety_);
 
@@ -344,7 +344,7 @@
   InternalDataChannelInit init;
   init.id = 1;
   init.ordered = false;
-  rtc::scoped_refptr<SctpDataChannel> dc =
+  scoped_refptr<SctpDataChannel> dc =
       controller_->CreateDataChannel("test1", init);
   auto proxy = SctpDataChannel::CreateProxy(dc, signaling_safety_);
 
@@ -405,7 +405,7 @@
   config.open_handshake_role = InternalDataChannelInit::kNone;
 
   SetChannelReady();
-  rtc::scoped_refptr<SctpDataChannel> dc =
+  scoped_refptr<SctpDataChannel> dc =
       controller_->CreateDataChannel("test1", config);
   auto proxy = SctpDataChannel::CreateProxy(dc, signaling_safety_);
 
@@ -472,7 +472,7 @@
   config.open_handshake_role = InternalDataChannelInit::kAcker;
 
   SetChannelReady();
-  rtc::scoped_refptr<SctpDataChannel> dc =
+  scoped_refptr<SctpDataChannel> dc =
       controller_->CreateDataChannel("test1", config);
   auto proxy = SctpDataChannel::CreateProxy(dc, signaling_safety_);
 
@@ -528,7 +528,7 @@
 // Tests that the DataChannel is closed if the received buffer is full.
 TEST_F(SctpDataChannelTest, ClosedWhenReceivedBufferFull) {
   SetChannelReady();
-  rtc::CopyOnWriteBuffer buffer(1024);
+  CopyOnWriteBuffer buffer(1024);
   memset(buffer.MutableData(), 0, buffer.size());
 
   network_thread_.BlockingCall([&] {
@@ -587,7 +587,7 @@
   AddObserver();
   SetChannelReady();
 
-  rtc::CopyOnWriteBuffer buffer(100 * 1024);
+  CopyOnWriteBuffer buffer(100 * 1024);
   memset(buffer.MutableData(), 0, buffer.size());
   DataBuffer packet(buffer, true);
 
@@ -642,10 +642,10 @@
 // Verifies that an even SCTP id is allocated for SSL_CLIENT and an odd id for
 // SSL_SERVER.
 TEST_F(SctpSidAllocatorTest, SctpIdAllocationBasedOnRole) {
-  EXPECT_EQ(allocator_.AllocateSid(rtc::SSL_SERVER), StreamId(1));
-  EXPECT_EQ(allocator_.AllocateSid(rtc::SSL_CLIENT), StreamId(0));
-  EXPECT_EQ(allocator_.AllocateSid(rtc::SSL_SERVER), StreamId(3));
-  EXPECT_EQ(allocator_.AllocateSid(rtc::SSL_CLIENT), StreamId(2));
+  EXPECT_EQ(allocator_.AllocateSid(SSL_SERVER), StreamId(1));
+  EXPECT_EQ(allocator_.AllocateSid(SSL_CLIENT), StreamId(0));
+  EXPECT_EQ(allocator_.AllocateSid(SSL_SERVER), StreamId(3));
+  EXPECT_EQ(allocator_.AllocateSid(SSL_CLIENT), StreamId(2));
 }
 
 // Verifies that SCTP ids of existing DataChannels are not reused.
@@ -653,13 +653,13 @@
   StreamId old_id(1);
   EXPECT_TRUE(allocator_.ReserveSid(old_id));
 
-  std::optional<StreamId> new_id = allocator_.AllocateSid(rtc::SSL_SERVER);
+  std::optional<StreamId> new_id = allocator_.AllocateSid(SSL_SERVER);
   EXPECT_TRUE(new_id.has_value());
   EXPECT_NE(old_id, new_id);
 
   old_id = StreamId(0);
   EXPECT_TRUE(allocator_.ReserveSid(old_id));
-  new_id = allocator_.AllocateSid(rtc::SSL_CLIENT);
+  new_id = allocator_.AllocateSid(SSL_CLIENT);
   EXPECT_TRUE(new_id.has_value());
   EXPECT_NE(old_id, new_id);
 }
@@ -671,34 +671,33 @@
   EXPECT_TRUE(allocator_.ReserveSid(odd_id));
   EXPECT_TRUE(allocator_.ReserveSid(even_id));
 
-  std::optional<StreamId> allocated_id =
-      allocator_.AllocateSid(rtc::SSL_SERVER);
+  std::optional<StreamId> allocated_id = allocator_.AllocateSid(SSL_SERVER);
   EXPECT_EQ(odd_id.stream_id_int() + 2, allocated_id->stream_id_int());
 
-  allocated_id = allocator_.AllocateSid(rtc::SSL_CLIENT);
+  allocated_id = allocator_.AllocateSid(SSL_CLIENT);
   EXPECT_EQ(even_id.stream_id_int() + 2, allocated_id->stream_id_int());
 
-  allocated_id = allocator_.AllocateSid(rtc::SSL_SERVER);
+  allocated_id = allocator_.AllocateSid(SSL_SERVER);
   EXPECT_EQ(odd_id.stream_id_int() + 4, allocated_id->stream_id_int());
 
-  allocated_id = allocator_.AllocateSid(rtc::SSL_CLIENT);
+  allocated_id = allocator_.AllocateSid(SSL_CLIENT);
   EXPECT_EQ(even_id.stream_id_int() + 4, allocated_id->stream_id_int());
 
   allocator_.ReleaseSid(odd_id);
   allocator_.ReleaseSid(even_id);
 
   // Verifies that removed ids are reused.
-  allocated_id = allocator_.AllocateSid(rtc::SSL_SERVER);
+  allocated_id = allocator_.AllocateSid(SSL_SERVER);
   EXPECT_EQ(odd_id, allocated_id);
 
-  allocated_id = allocator_.AllocateSid(rtc::SSL_CLIENT);
+  allocated_id = allocator_.AllocateSid(SSL_CLIENT);
   EXPECT_EQ(even_id, allocated_id);
 
   // Verifies that used higher ids are not reused.
-  allocated_id = allocator_.AllocateSid(rtc::SSL_SERVER);
+  allocated_id = allocator_.AllocateSid(SSL_SERVER);
   EXPECT_EQ(odd_id.stream_id_int() + 6, allocated_id->stream_id_int());
 
-  allocated_id = allocator_.AllocateSid(rtc::SSL_CLIENT);
+  allocated_id = allocator_.AllocateSid(SSL_CLIENT);
   EXPECT_EQ(even_id.stream_id_int() + 6, allocated_id->stream_id_int());
 }
 
@@ -737,7 +736,7 @@
 }  // namespace
 
 TEST(DataChannelInterfaceTest, Coverage) {
-  auto channel = rtc::make_ref_counted<NoImplDataChannel>();
+  auto channel = make_ref_counted<NoImplDataChannel>();
   EXPECT_FALSE(channel->ordered());
   EXPECT_FALSE(channel->maxRetransmitsOpt());
   EXPECT_FALSE(channel->maxPacketLifeTime());
@@ -753,12 +752,12 @@
 #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
 
 TEST(DataChannelInterfaceDeathTest, SendDefaultImplDchecks) {
-  auto channel = rtc::make_ref_counted<NoImplDataChannel>();
+  auto channel = webrtc::make_ref_counted<NoImplDataChannel>();
   RTC_EXPECT_DEATH(channel->Send(DataBuffer("Foo")), "Check failed: false");
 }
 
 TEST(DataChannelInterfaceDeathTest, SendAsyncDefaultImplDchecks) {
-  auto channel = rtc::make_ref_counted<NoImplDataChannel>();
+  auto channel = webrtc::make_ref_counted<NoImplDataChannel>();
   RTC_EXPECT_DEATH(channel->SendAsync(DataBuffer("Foo"), nullptr),
                    "Check failed: false");
 }
diff --git a/pc/dtls_srtp_transport.cc b/pc/dtls_srtp_transport.cc
index 10d85b5..10a5291 100644
--- a/pc/dtls_srtp_transport.cc
+++ b/pc/dtls_srtp_transport.cc
@@ -161,8 +161,8 @@
   }
 
   int selected_crypto_suite;
-  rtc::ZeroOnFreeBuffer<uint8_t> send_key;
-  rtc::ZeroOnFreeBuffer<uint8_t> recv_key;
+  ZeroOnFreeBuffer<uint8_t> send_key;
+  ZeroOnFreeBuffer<uint8_t> recv_key;
 
   if (!ExtractParams(rtp_dtls_transport_, &selected_crypto_suite, &send_key,
                      &recv_key) ||
@@ -190,8 +190,8 @@
   }
 
   int selected_crypto_suite;
-  rtc::ZeroOnFreeBuffer<uint8_t> rtcp_send_key;
-  rtc::ZeroOnFreeBuffer<uint8_t> rtcp_recv_key;
+  ZeroOnFreeBuffer<uint8_t> rtcp_send_key;
+  ZeroOnFreeBuffer<uint8_t> rtcp_recv_key;
   if (!ExtractParams(rtcp_dtls_transport_, &selected_crypto_suite,
                      &rtcp_send_key, &rtcp_recv_key) ||
       !SetRtcpParams(selected_crypto_suite, rtcp_send_key, send_extension_ids,
@@ -201,11 +201,10 @@
   }
 }
 
-bool DtlsSrtpTransport::ExtractParams(
-    DtlsTransportInternal* dtls_transport,
-    int* selected_crypto_suite,
-    rtc::ZeroOnFreeBuffer<uint8_t>* send_key,
-    rtc::ZeroOnFreeBuffer<uint8_t>* recv_key) {
+bool DtlsSrtpTransport::ExtractParams(DtlsTransportInternal* dtls_transport,
+                                      int* selected_crypto_suite,
+                                      ZeroOnFreeBuffer<uint8_t>* send_key,
+                                      ZeroOnFreeBuffer<uint8_t>* recv_key) {
   if (!dtls_transport || !dtls_transport->IsDtlsActive()) {
     return false;
   }
@@ -228,7 +227,7 @@
   }
 
   // OK, we're now doing DTLS (RFC 5764)
-  rtc::ZeroOnFreeBuffer<uint8_t> dtls_buffer(key_len * 2 + salt_len * 2);
+  ZeroOnFreeBuffer<uint8_t> dtls_buffer(key_len * 2 + salt_len * 2);
 
   // RFC 5705 exporter using the RFC 5764 parameters
   if (!dtls_transport->ExportSrtpKeyingMaterial(dtls_buffer)) {
@@ -241,10 +240,10 @@
   // https://datatracker.ietf.org/doc/html/rfc5764#section-4.2
   // The keying material is in the format:
   // client_write_key|server_write_key|client_write_salt|server_write_salt
-  rtc::ZeroOnFreeBuffer<uint8_t> client_write_key(&dtls_buffer[0], key_len,
-                                                  key_len + salt_len);
-  rtc::ZeroOnFreeBuffer<uint8_t> server_write_key(&dtls_buffer[key_len],
-                                                  key_len, key_len + salt_len);
+  ZeroOnFreeBuffer<uint8_t> client_write_key(&dtls_buffer[0], key_len,
+                                             key_len + salt_len);
+  ZeroOnFreeBuffer<uint8_t> server_write_key(&dtls_buffer[key_len], key_len,
+                                             key_len + salt_len);
   client_write_key.AppendData(&dtls_buffer[key_len + key_len], salt_len);
   server_write_key.AppendData(&dtls_buffer[key_len + key_len + salt_len],
                               salt_len);
@@ -281,8 +280,9 @@
   if (new_dtls_transport) {
     new_dtls_transport->SubscribeDtlsTransportState(
         this,
-        [this](cricket::DtlsTransportInternal* transport,
-               DtlsTransportState state) { OnDtlsState(transport, state); });
+        [this](DtlsTransportInternal* transport, DtlsTransportState state) {
+          OnDtlsState(transport, state);
+        });
   }
 }
 
diff --git a/pc/dtls_srtp_transport.h b/pc/dtls_srtp_transport.h
index 2528082..a5592b2 100644
--- a/pc/dtls_srtp_transport.h
+++ b/pc/dtls_srtp_transport.h
@@ -64,8 +64,8 @@
   void SetupRtcpDtlsSrtp();
   bool ExtractParams(DtlsTransportInternal* dtls_transport,
                      int* selected_crypto_suite,
-                     rtc::ZeroOnFreeBuffer<uint8_t>* send_key,
-                     rtc::ZeroOnFreeBuffer<uint8_t>* recv_key);
+                     ZeroOnFreeBuffer<uint8_t>* send_key,
+                     ZeroOnFreeBuffer<uint8_t>* recv_key);
   void SetDtlsTransport(DtlsTransportInternal* new_dtls_transport,
                         DtlsTransportInternal** old_dtls_transport);
   void SetRtpDtlsTransport(DtlsTransportInternal* rtp_dtls_transport);
diff --git a/pc/dtls_srtp_transport_integrationtest.cc b/pc/dtls_srtp_transport_integrationtest.cc
index a095a2f..1b4990b 100644
--- a/pc/dtls_srtp_transport_integrationtest.cc
+++ b/pc/dtls_srtp_transport_integrationtest.cc
@@ -78,7 +78,7 @@
     srtp_transport_.UnregisterRtpDemuxerSink(&srtp_transport_observer_);
   }
 
-  rtc::scoped_refptr<webrtc::RTCCertificate> MakeCertificate() {
+  webrtc::scoped_refptr<webrtc::RTCCertificate> MakeCertificate() {
     return webrtc::RTCCertificate::Create(
         webrtc::SSLIdentity::Create("test", webrtc::KT_DEFAULT));
   }
@@ -92,15 +92,15 @@
     return ice_transport;
   }
 
-  std::unique_ptr<cricket::DtlsTransport> MakeDtlsTransport(
+  std::unique_ptr<webrtc::DtlsTransportInternalImpl> MakeDtlsTransport(
       webrtc::FakeIceTransport* ice_transport) {
-    return std::make_unique<cricket::DtlsTransport>(
+    return std::make_unique<webrtc::DtlsTransportInternalImpl>(
         ice_transport, webrtc::CryptoOptions(),
         /*event_log=*/nullptr, webrtc::SSL_PROTOCOL_DTLS_12);
   }
   void SetRemoteFingerprintFromCert(
-      cricket::DtlsTransport* transport,
-      const rtc::scoped_refptr<webrtc::RTCCertificate>& cert) {
+      webrtc::DtlsTransportInternalImpl* transport,
+      const webrtc::scoped_refptr<webrtc::RTCCertificate>& cert) {
     std::unique_ptr<webrtc::SSLFingerprint> fingerprint =
         webrtc::SSLFingerprint::CreateFromCertificate(*cert);
 
@@ -151,12 +151,12 @@
                                                  &key_len, &salt_len));
 
     // Extract the keys. The order depends on the role!
-    rtc::ZeroOnFreeBuffer<uint8_t> dtls_buffer(key_len * 2 + salt_len * 2);
+    webrtc::ZeroOnFreeBuffer<uint8_t> dtls_buffer(key_len * 2 + salt_len * 2);
     ASSERT_TRUE(server_dtls_transport_->ExportSrtpKeyingMaterial(dtls_buffer));
 
-    rtc::ZeroOnFreeBuffer<unsigned char> client_write_key(
+    webrtc::ZeroOnFreeBuffer<unsigned char> client_write_key(
         &dtls_buffer[0], key_len, key_len + salt_len);
-    rtc::ZeroOnFreeBuffer<unsigned char> server_write_key(
+    webrtc::ZeroOnFreeBuffer<unsigned char> server_write_key(
         &dtls_buffer[key_len], key_len, key_len + salt_len);
     client_write_key.AppendData(&dtls_buffer[key_len + key_len], salt_len);
     server_write_key.AppendData(&dtls_buffer[key_len + key_len + salt_len],
@@ -167,10 +167,10 @@
         client_write_key, {}));
   }
 
-  rtc::CopyOnWriteBuffer CreateRtpPacket() {
+  webrtc::CopyOnWriteBuffer CreateRtpPacket() {
     size_t rtp_len = sizeof(kPcmuFrame);
     size_t packet_size = rtp_len + kRtpAuthTagLen;
-    rtc::Buffer rtp_packet_buffer(packet_size);
+    webrtc::Buffer rtp_packet_buffer(packet_size);
     char* rtp_packet_data = rtp_packet_buffer.data<char>();
     memcpy(rtp_packet_data, kPcmuFrame, rtp_len);
 
@@ -178,11 +178,11 @@
   }
 
   void SendRtpPacketFromSrtpToDtlsSrtp() {
-    rtc::PacketOptions options;
-    rtc::CopyOnWriteBuffer packet = CreateRtpPacket();
+    webrtc::AsyncSocketPacketOptions options;
+    webrtc::CopyOnWriteBuffer packet = CreateRtpPacket();
 
     EXPECT_TRUE(srtp_transport_.SendRtpPacket(&packet, options,
-                                              cricket::PF_SRTP_BYPASS));
+                                              webrtc::PF_SRTP_BYPASS));
     EXPECT_THAT(webrtc::WaitUntil(
                     [&] { return dtls_srtp_transport_observer_.rtp_count(); },
                     ::testing::Eq(1),
@@ -198,11 +198,11 @@
   }
 
   void SendRtpPacketFromDtlsSrtpToSrtp() {
-    rtc::PacketOptions options;
-    rtc::CopyOnWriteBuffer packet = CreateRtpPacket();
+    webrtc::AsyncSocketPacketOptions options;
+    webrtc::CopyOnWriteBuffer packet = CreateRtpPacket();
 
     EXPECT_TRUE(dtls_srtp_transport_.SendRtpPacket(&packet, options,
-                                                   cricket::PF_SRTP_BYPASS));
+                                                   webrtc::PF_SRTP_BYPASS));
     EXPECT_THAT(
         webrtc::WaitUntil([&] { return srtp_transport_observer_.rtp_count(); },
                           ::testing::Eq(1),
@@ -224,11 +224,11 @@
   std::unique_ptr<webrtc::FakeIceTransport> client_ice_transport_;
   std::unique_ptr<webrtc::FakeIceTransport> server_ice_transport_;
 
-  std::unique_ptr<cricket::DtlsTransport> client_dtls_transport_;
-  std::unique_ptr<cricket::DtlsTransport> server_dtls_transport_;
+  std::unique_ptr<webrtc::DtlsTransportInternalImpl> client_dtls_transport_;
+  std::unique_ptr<webrtc::DtlsTransportInternalImpl> server_dtls_transport_;
 
-  rtc::scoped_refptr<webrtc::RTCCertificate> client_certificate_;
-  rtc::scoped_refptr<webrtc::RTCCertificate> server_certificate_;
+  webrtc::scoped_refptr<webrtc::RTCCertificate> client_certificate_;
+  webrtc::scoped_refptr<webrtc::RTCCertificate> server_certificate_;
 
   webrtc::DtlsSrtpTransport dtls_srtp_transport_;
   webrtc::SrtpTransport srtp_transport_;
diff --git a/pc/dtls_srtp_transport_unittest.cc b/pc/dtls_srtp_transport_unittest.cc
index acdfb6c..19499ab 100644
--- a/pc/dtls_srtp_transport_unittest.cc
+++ b/pc/dtls_srtp_transport_unittest.cc
@@ -83,7 +83,7 @@
 
     dtls_srtp_transport1_->SubscribeRtcpPacketReceived(
         &transport_observer1_,
-        [this](rtc::CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
+        [this](webrtc::CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
           transport_observer1_.OnRtcpPacketReceived(buffer, packet_time_ms);
         });
     dtls_srtp_transport1_->SubscribeReadyToSend(
@@ -92,7 +92,7 @@
 
     dtls_srtp_transport2_->SubscribeRtcpPacketReceived(
         &transport_observer2_,
-        [this](rtc::CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
+        [this](webrtc::CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
           transport_observer2_.OnRtcpPacketReceived(buffer, packet_time_ms);
         });
     dtls_srtp_transport2_->SubscribeReadyToSend(
@@ -126,24 +126,24 @@
 
     size_t rtp_len = sizeof(kPcmuFrame);
     size_t packet_size = rtp_len + kRtpAuthTagLen;
-    rtc::Buffer rtp_packet_buffer(packet_size);
+    webrtc::Buffer rtp_packet_buffer(packet_size);
     char* rtp_packet_data = rtp_packet_buffer.data<char>();
     memcpy(rtp_packet_data, kPcmuFrame, rtp_len);
     // In order to be able to run this test function multiple times we can not
     // use the same sequence number twice. Increase the sequence number by one.
     webrtc::SetBE16(reinterpret_cast<uint8_t*>(rtp_packet_data) + 2,
                     ++sequence_number_);
-    rtc::CopyOnWriteBuffer rtp_packet1to2(rtp_packet_data, rtp_len,
-                                          packet_size);
-    rtc::CopyOnWriteBuffer rtp_packet2to1(rtp_packet_data, rtp_len,
-                                          packet_size);
+    webrtc::CopyOnWriteBuffer rtp_packet1to2(rtp_packet_data, rtp_len,
+                                             packet_size);
+    webrtc::CopyOnWriteBuffer rtp_packet2to1(rtp_packet_data, rtp_len,
+                                             packet_size);
 
-    rtc::PacketOptions options;
+    webrtc::AsyncSocketPacketOptions options;
     // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
     // that the packet can be successfully received and decrypted.
     int prev_received_packets = transport_observer2_.rtp_count();
     ASSERT_TRUE(dtls_srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options,
-                                                     cricket::PF_SRTP_BYPASS));
+                                                     webrtc::PF_SRTP_BYPASS));
     ASSERT_TRUE(transport_observer2_.last_recv_rtp_packet().data());
     EXPECT_EQ(0, memcmp(transport_observer2_.last_recv_rtp_packet().data(),
                         kPcmuFrame, rtp_len));
@@ -151,7 +151,7 @@
 
     prev_received_packets = transport_observer1_.rtp_count();
     ASSERT_TRUE(dtls_srtp_transport2_->SendRtpPacket(&rtp_packet2to1, options,
-                                                     cricket::PF_SRTP_BYPASS));
+                                                     webrtc::PF_SRTP_BYPASS));
     ASSERT_TRUE(transport_observer1_.last_recv_rtp_packet().data());
     EXPECT_EQ(0, memcmp(transport_observer1_.last_recv_rtp_packet().data(),
                         kPcmuFrame, rtp_len));
@@ -161,19 +161,21 @@
   void SendRecvRtcpPackets() {
     size_t rtcp_len = sizeof(kRtcpReport);
     size_t packet_size = rtcp_len + 4 + kRtpAuthTagLen;
-    rtc::Buffer rtcp_packet_buffer(packet_size);
+    webrtc::Buffer rtcp_packet_buffer(packet_size);
 
     // TODO(zhihuang): Remove the extra copy when the SendRtpPacket method
     // doesn't take the CopyOnWriteBuffer by pointer.
-    rtc::CopyOnWriteBuffer rtcp_packet1to2(kRtcpReport, rtcp_len, packet_size);
-    rtc::CopyOnWriteBuffer rtcp_packet2to1(kRtcpReport, rtcp_len, packet_size);
+    webrtc::CopyOnWriteBuffer rtcp_packet1to2(kRtcpReport, rtcp_len,
+                                              packet_size);
+    webrtc::CopyOnWriteBuffer rtcp_packet2to1(kRtcpReport, rtcp_len,
+                                              packet_size);
 
-    rtc::PacketOptions options;
+    webrtc::AsyncSocketPacketOptions options;
     // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
     // that the packet can be successfully received and decrypted.
     int prev_received_packets = transport_observer2_.rtcp_count();
     ASSERT_TRUE(dtls_srtp_transport1_->SendRtcpPacket(&rtcp_packet1to2, options,
-                                                      cricket::PF_SRTP_BYPASS));
+                                                      webrtc::PF_SRTP_BYPASS));
     ASSERT_TRUE(transport_observer2_.last_recv_rtcp_packet().data());
     EXPECT_EQ(0, memcmp(transport_observer2_.last_recv_rtcp_packet().data(),
                         kRtcpReport, rtcp_len));
@@ -182,7 +184,7 @@
     // Do the same thing in the opposite direction;
     prev_received_packets = transport_observer1_.rtcp_count();
     ASSERT_TRUE(dtls_srtp_transport2_->SendRtcpPacket(&rtcp_packet2to1, options,
-                                                      cricket::PF_SRTP_BYPASS));
+                                                      webrtc::PF_SRTP_BYPASS));
     ASSERT_TRUE(transport_observer1_.last_recv_rtcp_packet().data());
     EXPECT_EQ(0, memcmp(transport_observer1_.last_recv_rtcp_packet().data(),
                         kRtcpReport, rtcp_len));
@@ -198,26 +200,26 @@
 
     size_t rtp_len = sizeof(kPcmuFrameWithExtensions);
     size_t packet_size = rtp_len + kRtpAuthTagLen;
-    rtc::Buffer rtp_packet_buffer(packet_size);
+    webrtc::Buffer rtp_packet_buffer(packet_size);
     char* rtp_packet_data = rtp_packet_buffer.data<char>();
     memcpy(rtp_packet_data, kPcmuFrameWithExtensions, rtp_len);
     // In order to be able to run this test function multiple times we can not
     // use the same sequence number twice. Increase the sequence number by one.
     webrtc::SetBE16(reinterpret_cast<uint8_t*>(rtp_packet_data) + 2,
                     ++sequence_number_);
-    rtc::CopyOnWriteBuffer rtp_packet1to2(rtp_packet_data, rtp_len,
-                                          packet_size);
-    rtc::CopyOnWriteBuffer rtp_packet2to1(rtp_packet_data, rtp_len,
-                                          packet_size);
+    webrtc::CopyOnWriteBuffer rtp_packet1to2(rtp_packet_data, rtp_len,
+                                             packet_size);
+    webrtc::CopyOnWriteBuffer rtp_packet2to1(rtp_packet_data, rtp_len,
+                                             packet_size);
 
     char original_rtp_data[sizeof(kPcmuFrameWithExtensions)];
     memcpy(original_rtp_data, rtp_packet_data, rtp_len);
 
-    rtc::PacketOptions options;
+    webrtc::AsyncSocketPacketOptions options;
     // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
     // that the packet can be successfully received and decrypted.
     ASSERT_TRUE(dtls_srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options,
-                                                     cricket::PF_SRTP_BYPASS));
+                                                     webrtc::PF_SRTP_BYPASS));
     ASSERT_TRUE(transport_observer2_.last_recv_rtp_packet().data());
     EXPECT_EQ(0, memcmp(transport_observer2_.last_recv_rtp_packet().data(),
                         original_rtp_data, rtp_len));
@@ -237,7 +239,7 @@
 
     // Do the same thing in the opposite direction.
     ASSERT_TRUE(dtls_srtp_transport2_->SendRtpPacket(&rtp_packet2to1, options,
-                                                     cricket::PF_SRTP_BYPASS));
+                                                     webrtc::PF_SRTP_BYPASS));
     ASSERT_TRUE(transport_observer1_.last_recv_rtp_packet().data());
     EXPECT_EQ(0, memcmp(transport_observer1_.last_recv_rtp_packet().data(),
                         original_rtp_data, rtp_len));
@@ -560,11 +562,12 @@
   // Sending some RTCP packets.
   size_t rtcp_len = sizeof(kRtcpReport);
   size_t packet_size = rtcp_len + 4 + kRtpAuthTagLen;
-  rtc::Buffer rtcp_packet_buffer(packet_size);
-  rtc::CopyOnWriteBuffer rtcp_packet(kRtcpReport, rtcp_len, packet_size);
+  webrtc::Buffer rtcp_packet_buffer(packet_size);
+  webrtc::CopyOnWriteBuffer rtcp_packet(kRtcpReport, rtcp_len, packet_size);
   int prev_received_packets = transport_observer2_.rtcp_count();
   ASSERT_TRUE(dtls_srtp_transport1_->SendRtcpPacket(
-      &rtcp_packet, rtc::PacketOptions(), cricket::PF_SRTP_BYPASS));
+      &rtcp_packet, webrtc::AsyncSocketPacketOptions(),
+      webrtc::PF_SRTP_BYPASS));
   // The RTCP packet is not exepected to be received because the SRTP parameters
   // are only reset on one side and the SRTCP index is out of sync.
   EXPECT_EQ(prev_received_packets, transport_observer2_.rtcp_count());
diff --git a/pc/dtls_transport.cc b/pc/dtls_transport.cc
index 3b78320..f79f1bb 100644
--- a/pc/dtls_transport.cc
+++ b/pc/dtls_transport.cc
@@ -34,12 +34,11 @@
     : owner_thread_(Thread::Current()),
       info_(DtlsTransportState::kNew),
       internal_dtls_transport_(std::move(internal)),
-      ice_transport_(rtc::make_ref_counted<IceTransportWithPointer>(
+      ice_transport_(make_ref_counted<IceTransportWithPointer>(
           internal_dtls_transport_->ice_transport())) {
   RTC_DCHECK(internal_dtls_transport_.get());
   internal_dtls_transport_->SubscribeDtlsTransportState(
-      [this](cricket::DtlsTransportInternal* transport,
-             DtlsTransportState state) {
+      [this](DtlsTransportInternal* transport, DtlsTransportState state) {
         OnInternalDtlsState(transport, state);
       });
   UpdateInformation();
@@ -77,7 +76,7 @@
   observer_ = nullptr;
 }
 
-rtc::scoped_refptr<IceTransportInterface> DtlsTransport::ice_transport() {
+scoped_refptr<IceTransportInterface> DtlsTransport::ice_transport() {
   return ice_transport_;
 }
 
diff --git a/pc/dtls_transport.h b/pc/dtls_transport.h
index cf21c18..0ddc573 100644
--- a/pc/dtls_transport.h
+++ b/pc/dtls_transport.h
@@ -28,18 +28,18 @@
 
 class IceTransportWithPointer;
 
-// This implementation wraps a cricket::DtlsTransport, and takes
+// This implementation wraps a webrtc::DtlsTransportInternalImpl, and takes
 // ownership of it.
 class DtlsTransport : public DtlsTransportInterface {
  public:
   // This object must be constructed and updated on a consistent thread,
-  // the same thread as the one the cricket::DtlsTransportInternal object
+  // the same thread as the one the webrtc::DtlsTransportInternal object
   // lives on.
   // The Information() function can be called from a different thread,
   // such as the signalling thread.
   explicit DtlsTransport(std::unique_ptr<DtlsTransportInternal> internal);
 
-  rtc::scoped_refptr<IceTransportInterface> ice_transport() override;
+  scoped_refptr<IceTransportInterface> ice_transport() override;
 
   // Currently called from the signaling thread and potentially Chromium's
   // JS thread.
@@ -80,7 +80,7 @@
   DtlsTransportInformation info_ RTC_GUARDED_BY(lock_);
   std::unique_ptr<DtlsTransportInternal> internal_dtls_transport_
       RTC_GUARDED_BY(owner_thread_);
-  const rtc::scoped_refptr<IceTransportWithPointer> ice_transport_;
+  const scoped_refptr<IceTransportWithPointer> ice_transport_;
 };
 
 }  // namespace webrtc
diff --git a/pc/dtls_transport_unittest.cc b/pc/dtls_transport_unittest.cc
index 1b3e806..4769756 100644
--- a/pc/dtls_transport_unittest.cc
+++ b/pc/dtls_transport_unittest.cc
@@ -71,8 +71,7 @@
       cricket_transport->SetRemoteSSLCertificate(certificate);
     }
     cricket_transport->SetSslCipherSuite(kNonsenseCipherSuite);
-    transport_ =
-        rtc::make_ref_counted<DtlsTransport>(std::move(cricket_transport));
+    transport_ = make_ref_counted<DtlsTransport>(std::move(cricket_transport));
   }
 
   void CompleteDtlsHandshake() {
@@ -89,7 +88,7 @@
   }
 
   AutoThread main_thread_;
-  rtc::scoped_refptr<DtlsTransport> transport_;
+  scoped_refptr<DtlsTransport> transport_;
   TestDtlsTransportObserver observer_;
 };
 
@@ -97,7 +96,7 @@
   auto cricket_transport =
       std::make_unique<FakeDtlsTransport>("audio", ICE_CANDIDATE_COMPONENT_RTP);
   auto webrtc_transport =
-      rtc::make_ref_counted<DtlsTransport>(std::move(cricket_transport));
+      make_ref_counted<DtlsTransport>(std::move(cricket_transport));
   ASSERT_TRUE(webrtc_transport->internal());
   ASSERT_EQ(DtlsTransportState::kNew, webrtc_transport->Information().state());
   webrtc_transport->Clear();
diff --git a/pc/dtmf_sender.cc b/pc/dtmf_sender.cc
index c1fba6e..6ecc285 100644
--- a/pc/dtmf_sender.cc
+++ b/pc/dtmf_sender.cc
@@ -64,13 +64,12 @@
   return true;
 }
 
-rtc::scoped_refptr<DtmfSender> DtmfSender::Create(
-    TaskQueueBase* signaling_thread,
-    DtmfProviderInterface* provider) {
+scoped_refptr<DtmfSender> DtmfSender::Create(TaskQueueBase* signaling_thread,
+                                             DtmfProviderInterface* provider) {
   if (!signaling_thread) {
     return nullptr;
   }
-  return rtc::make_ref_counted<DtmfSender>(signaling_thread, provider);
+  return make_ref_counted<DtmfSender>(signaling_thread, provider);
 }
 
 DtmfSender::DtmfSender(TaskQueueBase* signaling_thread,
diff --git a/pc/dtmf_sender.h b/pc/dtmf_sender.h
index ecdb499..5c75750 100644
--- a/pc/dtmf_sender.h
+++ b/pc/dtmf_sender.h
@@ -47,8 +47,8 @@
 
 class DtmfSender : public DtmfSenderInterface {
  public:
-  static rtc::scoped_refptr<DtmfSender> Create(TaskQueueBase* signaling_thread,
-                                               DtmfProviderInterface* provider);
+  static scoped_refptr<DtmfSender> Create(TaskQueueBase* signaling_thread,
+                                          DtmfProviderInterface* provider);
 
   void OnDtmfProviderDestroyed();
 
@@ -91,7 +91,7 @@
   int comma_delay_ RTC_GUARDED_BY(signaling_thread_);
 
   // For cancelling the tasks which feed the DTMF provider one tone at a time.
-  rtc::scoped_refptr<PendingTaskSafetyFlag> safety_flag_ RTC_GUARDED_BY(
+  scoped_refptr<PendingTaskSafetyFlag> safety_flag_ RTC_GUARDED_BY(
       signaling_thread_) RTC_PT_GUARDED_BY(signaling_thread_) = nullptr;
 };
 
diff --git a/pc/dtmf_sender_unittest.cc b/pc/dtmf_sender_unittest.cc
index c7ffa2f..d121809 100644
--- a/pc/dtmf_sender_unittest.cc
+++ b/pc/dtmf_sender_unittest.cc
@@ -89,7 +89,7 @@
 
   bool InsertDtmf(int code, int duration) override {
     int gap = 0;
-    // TODO(ronghuawu): Make the timer (basically the rtc::TimeNanos)
+    // TODO(ronghuawu): Make the timer (basically the webrtc::TimeNanos)
     // mockable and use a fake timer in the unit tests.
     if (last_insert_dtmf_call_ > 0) {
       gap = static_cast<int>(webrtc::TimeMillis() - last_insert_dtmf_call_);
@@ -217,7 +217,7 @@
   webrtc::AutoThread main_thread_;
   std::unique_ptr<FakeDtmfObserver> observer_;
   std::unique_ptr<FakeDtmfProvider> provider_;
-  rtc::scoped_refptr<DtmfSender> dtmf_;
+  webrtc::scoped_refptr<DtmfSender> dtmf_;
   webrtc::ScopedFakeClock fake_clock_;
 };
 
diff --git a/pc/external_hmac.cc b/pc/external_hmac.cc
index 3b72e26..6ee917d 100644
--- a/pc/external_hmac.cc
+++ b/pc/external_hmac.cc
@@ -93,7 +93,8 @@
 }
 
 srtp_err_status_t external_hmac_dealloc(srtp_auth_t* a) {
-  rtc::ExplicitZeroMemory(a, sizeof(ExternalHmacContext) + sizeof(srtp_auth_t));
+  webrtc::ExplicitZeroMemory(a,
+                             sizeof(ExternalHmacContext) + sizeof(srtp_auth_t));
 
   // Free memory
   delete[] a;
diff --git a/pc/g3doc/dtls_transport.md b/pc/g3doc/dtls_transport.md
index 28d6739..b567338 100644
--- a/pc/g3doc/dtls_transport.md
+++ b/pc/g3doc/dtls_transport.md
@@ -23,17 +23,17 @@
 ## webrtc::DtlsTransport
 
 The [`webrtc::DtlsTransport`][1] class is a wrapper around the
-`cricket::DtlsTransportInternal` and allows registering observers implementing
+`webrtc::DtlsTransportInternal` and allows registering observers implementing
 the `webrtc::DtlsTransportObserverInterface`. The
 [`webrtc::DtlsTransportObserverInterface`][2] will provide updates to the
 observers, passing around a snapshot of the transports state such as the
 connection state, the remote certificate(s) and the SRTP ciphers as
 [`DtlsTransportInformation`][3].
 
-## cricket::DtlsTransportInternal
+## webrtc::DtlsTransportInternal
 
-The [`cricket::DtlsTransportInternal`][4] class is an interface. Its
-implementation is [`cricket::DtlsTransport`][5]. The `cricket::DtlsTransport`
+The [`webrtc::DtlsTransportInternal`][4] class is an interface. Its
+implementation is [`webrtc::DtlsTransportInternalImpl`][5]. The `webrtc::DtlsTransportInternalImpl`
 sends and receives network packets via an ICE transport. It also demultiplexes
 DTLS packets and SRTP packets according to the scheme described in
 [RFC 5764](https://tools.ietf.org/html/rfc5764#section-5.1.2).
@@ -42,7 +42,7 @@
 
 The [`webrtc::DtlsSrtpTransport`][6] class is responsÑ–ble for extracting the
 SRTP keys after the DTLS handshake as well as protection and unprotection of
-SRTP packets via its [`cricket::SrtpSession`][7].
+SRTP packets via its [`webrtc::SrtpSession`][7].
 
 [1]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/pc/dtls_transport.h;l=32;drc=6a55e7307b78edb50f94a1ff1ef8393d58218369
 [2]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/dtls_transport_interface.h;l=76;drc=34437d5660a80393d631657329ef74c6538be25a
diff --git a/pc/g3doc/peer_connection.md b/pc/g3doc/peer_connection.md
index cd01265..255def1 100644
--- a/pc/g3doc/peer_connection.md
+++ b/pc/g3doc/peer_connection.md
@@ -53,7 +53,7 @@
 
 PeerConnectionFactory owns an object called ConnectionContext, and a
 reference to this is passed to each PeerConnection. It is referenced
-via an rtc::scoped_refptr, which means that it is guaranteed to be
+via an webrtc::scoped_refptr, which means that it is guaranteed to be
 alive as long as either the factory or one of the PeerConnections
 is using it.
 
diff --git a/pc/g3doc/sctp_transport.md b/pc/g3doc/sctp_transport.md
index 100eb92..8d4979e 100644
--- a/pc/g3doc/sctp_transport.md
+++ b/pc/g3doc/sctp_transport.md
@@ -18,16 +18,16 @@
 set during PeerConnectionFactory initialization).
 
 The implementation of this object lives in pc/sctp_transport.{h,cc}, and is
-basically a wrapper around a `cricket::SctpTransportInternal`, hiding its
+basically a wrapper around a `webrtc::SctpTransportInternal`, hiding its
 implementation details and APIs that shouldn't be accessed from the user.
 
 The `webrtc::SctpTransport` is a ref counted object; it should be regarded
 as owned by the PeerConnection, and will be closed when the PeerConnection
 closes, but the object itself may survive longer than the PeerConnection.
 
-## cricket::SctpTransportInternal
+## webrtc::SctpTransportInternal
 
-[`cricket::SctpTransportInternal`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/media/sctp/sctp_transport_internal.h?q=cricket::SctpTransportInternal) owns two objects: The SCTP association object
+[`webrtc::SctpTransportInternal`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/media/sctp/sctp_transport_internal.h?q=webrtc::SctpTransportInternal) owns two objects: The SCTP association object
 and the DTLS transport, which is the object used to send and receive messages
 as emitted from or consumed by the sctp library.
 
diff --git a/pc/g3doc/srtp.md b/pc/g3doc/srtp.md
index 96bc55e..cdc1311 100644
--- a/pc/g3doc/srtp.md
+++ b/pc/g3doc/srtp.md
@@ -31,9 +31,9 @@
 The cipher suite ordering allows a non-WebRTC peer to prefer GCM cipher suites,
 however they are not selected as default by two instances of the WebRTC library.
 
-## cricket::SrtpSession
+## webrtc::SrtpSession
 
-The [`cricket::SrtpSession`][3] is providing encryption and decryption of SRTP
+The [`webrtc::SrtpSession`][3] is providing encryption and decryption of SRTP
 packets using [`libsrtp`](https://github.com/cisco/libsrtp). Keys will be
 provided by `SrtpTransport` or `DtlsSrtpTransport` in the [`SetSend`][4] and
 [`SetRecv`][5] methods.
diff --git a/pc/ice_server_parsing.cc b/pc/ice_server_parsing.cc
index 7f98a64..02612eb 100644
--- a/pc/ice_server_parsing.cc
+++ b/pc/ice_server_parsing.cc
@@ -165,7 +165,7 @@
 // by parsing `url` and using the username/password in `server`.
 RTCError ParseIceServerUrl(const PeerConnectionInterface::IceServer& server,
                            absl::string_view url,
-                           cricket::ServerAddresses* stun_servers,
+                           ServerAddresses* stun_servers,
                            std::vector<RelayServerConfig>* turn_servers) {
   // RFC 7064
   // stunURI       = scheme ":" host [ ":" port ]
@@ -323,7 +323,7 @@
 
 RTCError ParseIceServersOrError(
     const PeerConnectionInterface::IceServers& servers,
-    cricket::ServerAddresses* stun_servers,
+    ServerAddresses* stun_servers,
     std::vector<RelayServerConfig>* turn_servers) {
   for (const PeerConnectionInterface::IceServer& server : servers) {
     if (!server.urls.empty()) {
@@ -356,7 +356,7 @@
 
 RTCError ParseAndValidateIceServersFromConfiguration(
     const PeerConnectionInterface::RTCConfiguration& configuration,
-    cricket::ServerAddresses& stun_servers,
+    ServerAddresses& stun_servers,
     std::vector<RelayServerConfig>& turn_servers) {
   RTC_DCHECK(stun_servers.empty());
   RTC_DCHECK(turn_servers.empty());
@@ -376,7 +376,7 @@
   }
 
   // Add the turn logging id to all turn servers
-  for (cricket::RelayServerConfig& turn_server : turn_servers) {
+  for (RelayServerConfig& turn_server : turn_servers) {
     turn_server.turn_logging_id = configuration.turn_logging_id;
   }
 
diff --git a/pc/ice_server_parsing.h b/pc/ice_server_parsing.h
index 8009cb7..75c16f0 100644
--- a/pc/ice_server_parsing.h
+++ b/pc/ice_server_parsing.h
@@ -29,14 +29,14 @@
 // PeerConnection through RTCConfiguration.
 RTC_EXPORT RTCError
 ParseIceServersOrError(const PeerConnectionInterface::IceServers& servers,
-                       cricket::ServerAddresses* stun_servers,
+                       ServerAddresses* stun_servers,
                        std::vector<RelayServerConfig>* turn_servers);
 
 // Calls `ParseIceServersOrError` to extract ice server information from the
 // `configuration` and then validates the extracted configuration.
 RTC_EXPORT RTCError ParseAndValidateIceServersFromConfiguration(
     const PeerConnectionInterface::RTCConfiguration& configuration,
-    cricket::ServerAddresses& stun_servers,
+    ServerAddresses& stun_servers,
     std::vector<RelayServerConfig>& turn_servers);
 
 }  // namespace webrtc
diff --git a/pc/ice_server_parsing_unittest.cc b/pc/ice_server_parsing_unittest.cc
index c2deb51..df459e6 100644
--- a/pc/ice_server_parsing_unittest.cc
+++ b/pc/ice_server_parsing_unittest.cc
@@ -69,7 +69,7 @@
   }
 
  protected:
-  cricket::ServerAddresses stun_servers_;
+  ServerAddresses stun_servers_;
   std::vector<RelayServerConfig> turn_servers_;
 };
 
@@ -86,12 +86,12 @@
   EXPECT_TRUE(ParseTurnUrl("turn:hostname"));
   EXPECT_EQ(0U, stun_servers_.size());
   EXPECT_EQ(1U, turn_servers_.size());
-  EXPECT_EQ(cricket::PROTO_UDP, turn_servers_[0].ports[0].proto);
+  EXPECT_EQ(PROTO_UDP, turn_servers_[0].ports[0].proto);
 
   EXPECT_TRUE(ParseTurnUrl("turns:hostname"));
   EXPECT_EQ(0U, stun_servers_.size());
   EXPECT_EQ(1U, turn_servers_.size());
-  EXPECT_EQ(cricket::PROTO_TLS, turn_servers_[0].ports[0].proto);
+  EXPECT_EQ(PROTO_TLS, turn_servers_[0].ports[0].proto);
   EXPECT_TRUE(turn_servers_[0].tls_cert_policy ==
               TlsCertPolicy::TLS_CERT_POLICY_SECURE);
 
@@ -102,7 +102,7 @@
   EXPECT_EQ(1U, turn_servers_.size());
   EXPECT_TRUE(turn_servers_[0].tls_cert_policy ==
               TlsCertPolicy::TLS_CERT_POLICY_INSECURE_NO_CHECK);
-  EXPECT_EQ(cricket::PROTO_TLS, turn_servers_[0].ports[0].proto);
+  EXPECT_EQ(PROTO_TLS, turn_servers_[0].ports[0].proto);
 
   // invalid prefixes
   EXPECT_FALSE(ParseUrl("stunn:hostname"));
@@ -116,13 +116,13 @@
   EXPECT_TRUE(ParseTurnUrl("turns:hostname"));
   EXPECT_EQ(1U, turn_servers_.size());
   EXPECT_EQ(5349, turn_servers_[0].ports[0].address.port());
-  EXPECT_EQ(cricket::PROTO_TLS, turn_servers_[0].ports[0].proto);
+  EXPECT_EQ(PROTO_TLS, turn_servers_[0].ports[0].proto);
 
   // TURN defaults
   EXPECT_TRUE(ParseTurnUrl("turn:hostname"));
   EXPECT_EQ(1U, turn_servers_.size());
   EXPECT_EQ(3478, turn_servers_[0].ports[0].address.port());
-  EXPECT_EQ(cricket::PROTO_UDP, turn_servers_[0].ports[0].proto);
+  EXPECT_EQ(PROTO_UDP, turn_servers_[0].ports[0].proto);
 
   // STUN defaults
   EXPECT_TRUE(ParseUrl("stun:hostname"));
@@ -197,11 +197,11 @@
 TEST_F(IceServerParsingTest, ParseTransport) {
   EXPECT_TRUE(ParseTurnUrl("turn:hostname:1234?transport=tcp"));
   EXPECT_EQ(1U, turn_servers_.size());
-  EXPECT_EQ(cricket::PROTO_TCP, turn_servers_[0].ports[0].proto);
+  EXPECT_EQ(PROTO_TCP, turn_servers_[0].ports[0].proto);
 
   EXPECT_TRUE(ParseTurnUrl("turn:hostname?transport=udp"));
   EXPECT_EQ(1U, turn_servers_.size());
-  EXPECT_EQ(cricket::PROTO_UDP, turn_servers_[0].ports[0].proto);
+  EXPECT_EQ(PROTO_UDP, turn_servers_[0].ports[0].proto);
 
   EXPECT_FALSE(ParseTurnUrl("turn:hostname?transport=invalid"));
   EXPECT_FALSE(ParseTurnUrl("turn:hostname?transport="));
diff --git a/pc/ice_transport_unittest.cc b/pc/ice_transport_unittest.cc
index 56abb7c..767d1ad 100644
--- a/pc/ice_transport_unittest.cc
+++ b/pc/ice_transport_unittest.cc
@@ -44,7 +44,7 @@
   auto cricket_transport =
       std::make_unique<FakeIceTransport>("name", 0, nullptr);
   auto ice_transport =
-      rtc::make_ref_counted<IceTransportWithPointer>(cricket_transport.get());
+      make_ref_counted<IceTransportWithPointer>(cricket_transport.get());
   EXPECT_EQ(ice_transport->internal(), cricket_transport.get());
   ice_transport->Clear();
   EXPECT_NE(ice_transport->internal(), cricket_transport.get());
diff --git a/pc/jitter_buffer_delay.cc b/pc/jitter_buffer_delay.cc
index 3e0f500..7e8c3a5 100644
--- a/pc/jitter_buffer_delay.cc
+++ b/pc/jitter_buffer_delay.cc
@@ -30,9 +30,9 @@
 
 int JitterBufferDelay::GetMs() const {
   RTC_DCHECK_RUN_ON(&worker_thread_checker_);
-  return SafeClamp(rtc::saturated_cast<int>(
-                       cached_delay_seconds_.value_or(kDefaultDelay) * 1000),
-                   0, kMaximumDelayMs);
+  return SafeClamp(
+      saturated_cast<int>(cached_delay_seconds_.value_or(kDefaultDelay) * 1000),
+      0, kMaximumDelayMs);
 }
 
 }  // namespace webrtc
diff --git a/pc/jsep_session_description.cc b/pc/jsep_session_description.cc
index 8bdeeb6..fe4bd79 100644
--- a/pc/jsep_session_description.cc
+++ b/pc/jsep_session_description.cc
@@ -34,7 +34,7 @@
 #include "rtc_base/net_helpers.h"
 #include "rtc_base/socket_address.h"
 
-using cricket::Candidate;
+using webrtc::Candidate;
 using ::webrtc::SessionDescription;
 
 namespace webrtc {
diff --git a/pc/jsep_transport.cc b/pc/jsep_transport.cc
index e44df56f..8f0a397 100644
--- a/pc/jsep_transport.cc
+++ b/pc/jsep_transport.cc
@@ -110,16 +110,16 @@
       unencrypted_rtp_transport_(std::move(unencrypted_rtp_transport)),
       sdes_transport_(std::move(sdes_transport)),
       dtls_srtp_transport_(std::move(dtls_srtp_transport)),
-      rtp_dtls_transport_(rtp_dtls_transport
-                              ? rtc::make_ref_counted<DtlsTransport>(
-                                    std::move(rtp_dtls_transport))
-                              : nullptr),
-      rtcp_dtls_transport_(rtcp_dtls_transport
-                               ? rtc::make_ref_counted<DtlsTransport>(
-                                     std::move(rtcp_dtls_transport))
-                               : nullptr),
+      rtp_dtls_transport_(
+          rtp_dtls_transport
+              ? make_ref_counted<DtlsTransport>(std::move(rtp_dtls_transport))
+              : nullptr),
+      rtcp_dtls_transport_(
+          rtcp_dtls_transport
+              ? make_ref_counted<DtlsTransport>(std::move(rtcp_dtls_transport))
+              : nullptr),
       sctp_transport_(sctp_transport
-                          ? rtc::make_ref_counted<::webrtc::SctpTransport>(
+                          ? make_ref_counted<::webrtc::SctpTransport>(
                                 std::move(sctp_transport),
                                 rtp_dtls_transport_)
                           : nullptr),
@@ -300,7 +300,7 @@
                         "not set.");
   }
 
-  for (const cricket::Candidate& candidate : candidates) {
+  for (const Candidate& candidate : candidates) {
     auto transport = candidate.component() == ICE_CANDIDATE_COMPONENT_RTP
                          ? rtp_dtls_transport_
                          : rtcp_dtls_transport_;
@@ -523,7 +523,7 @@
   } else {
     // We are not doing DTLS
     remote_fingerprint =
-        std::make_unique<SSLFingerprint>("", rtc::ArrayView<const uint8_t>());
+        std::make_unique<SSLFingerprint>("", ArrayView<const uint8_t>());
   }
   // Now that we have negotiated everything, push it downward.
   // Note that we cache the result so that if we have race conditions
diff --git a/pc/jsep_transport_collection.cc b/pc/jsep_transport_collection.cc
index d475da6..c773b67 100644
--- a/pc/jsep_transport_collection.cc
+++ b/pc/jsep_transport_collection.cc
@@ -46,7 +46,7 @@
     // groups.
     bundle_groups_changed = true;
     bundle_groups_.clear();
-    for (const cricket::ContentGroup* new_bundle_group :
+    for (const ContentGroup* new_bundle_group :
          description->GetGroupsByName(GROUP_TYPE_BUNDLE)) {
       bundle_groups_.push_back(
           std::make_unique<ContentGroup>(*new_bundle_group));
@@ -60,7 +60,7 @@
     // Thus any m= sections added to a BUNDLE group in this offer can
     // preemptively start using the bundled transport, as there is no possible
     // non-bundled fallback.
-    for (const cricket::ContentGroup* new_bundle_group :
+    for (const ContentGroup* new_bundle_group :
          description->GetGroupsByName(GROUP_TYPE_BUNDLE)) {
       // Attempt to find a matching existing group.
       for (const std::string& mid : new_bundle_group->content_names()) {
@@ -106,11 +106,11 @@
   // Remove the rejected content from the `bundle_group`.
   // The const pointer arg is used to identify the group, we verify
   // it before we use it to make a modification.
-  auto bundle_group_it = std::find_if(
-      bundle_groups_.begin(), bundle_groups_.end(),
-      [bundle_group](std::unique_ptr<cricket::ContentGroup>& group) {
-        return bundle_group == group.get();
-      });
+  auto bundle_group_it =
+      std::find_if(bundle_groups_.begin(), bundle_groups_.end(),
+                   [bundle_group](std::unique_ptr<ContentGroup>& group) {
+                     return bundle_group == group.get();
+                   });
   RTC_DCHECK(bundle_group_it != bundle_groups_.end());
   (*bundle_group_it)->RemoveContentName(mid);
   established_bundle_groups_by_mid_.erase(
@@ -121,11 +121,11 @@
   RTC_DCHECK_RUN_ON(&sequence_checker_);
   RTC_DLOG(LS_VERBOSE) << "Deleting bundle group " << bundle_group->ToString();
 
-  auto bundle_group_it = std::find_if(
-      bundle_groups_.begin(), bundle_groups_.end(),
-      [bundle_group](std::unique_ptr<cricket::ContentGroup>& group) {
-        return bundle_group == group.get();
-      });
+  auto bundle_group_it =
+      std::find_if(bundle_groups_.begin(), bundle_groups_.end(),
+                   [bundle_group](std::unique_ptr<ContentGroup>& group) {
+                     return bundle_group == group.get();
+                   });
   RTC_DCHECK(bundle_group_it != bundle_groups_.end());
   auto mid_list = (*bundle_group_it)->content_names();
   for (const auto& content_name : mid_list) {
diff --git a/pc/jsep_transport_controller.cc b/pc/jsep_transport_controller.cc
index aabbf58..7a6f7b6 100644
--- a/pc/jsep_transport_controller.cc
+++ b/pc/jsep_transport_controller.cc
@@ -84,7 +84,7 @@
       port_allocator_(port_allocator),
       async_dns_resolver_factory_(async_dns_resolver_factory),
       transports_(
-          [this](const std::string& mid, cricket::JsepTransport* transport) {
+          [this](const std::string& mid, JsepTransport* transport) {
             return OnTransportChanged(mid, transport);
           },
           [this]() {
@@ -191,8 +191,8 @@
   return jsep_transport->rtcp_dtls_transport();
 }
 
-rtc::scoped_refptr<DtlsTransport>
-JsepTransportController::LookupDtlsTransportByMid(const std::string& mid) {
+scoped_refptr<DtlsTransport> JsepTransportController::LookupDtlsTransportByMid(
+    const std::string& mid) {
   RTC_DCHECK_RUN_ON(network_thread_);
   auto jsep_transport = GetJsepTransportForMid(mid);
   if (!jsep_transport) {
@@ -201,7 +201,7 @@
   return jsep_transport->RtpDtlsTransport();
 }
 
-rtc::scoped_refptr<SctpTransport> JsepTransportController::GetSctpTransport(
+scoped_refptr<SctpTransport> JsepTransportController::GetSctpTransport(
     const std::string& mid) const {
   RTC_DCHECK_RUN_ON(network_thread_);
   auto jsep_transport = GetJsepTransportForMid(mid);
@@ -323,7 +323,7 @@
 }
 
 bool JsepTransportController::SetLocalCertificate(
-    const rtc::scoped_refptr<RTCCertificate>& certificate) {
+    const scoped_refptr<RTCCertificate>& certificate) {
   if (!network_thread_->IsCurrent()) {
     return network_thread_->BlockingCall(
         [&] { return SetLocalCertificate(certificate); });
@@ -350,7 +350,7 @@
   return true;
 }
 
-rtc::scoped_refptr<RTCCertificate> JsepTransportController::GetLocalCertificate(
+scoped_refptr<RTCCertificate> JsepTransportController::GetLocalCertificate(
     const std::string& transport_name) const {
   RTC_DCHECK_RUN_ON(network_thread_);
 
@@ -393,7 +393,7 @@
 
 RTCError JsepTransportController::AddRemoteCandidates(
     const std::string& transport_name,
-    const cricket::Candidates& candidates) {
+    const Candidates& candidates) {
   RTC_DCHECK_RUN_ON(network_thread_);
   RTC_DCHECK(VerifyCandidates(candidates).ok());
   auto jsep_transport = GetJsepTransportByName(transport_name);
@@ -406,7 +406,7 @@
 }
 
 RTCError JsepTransportController::RemoveRemoteCandidates(
-    const cricket::Candidates& candidates) {
+    const Candidates& candidates) {
   if (!network_thread_->IsCurrent()) {
     return network_thread_->BlockingCall(
         [&] { return RemoveRemoteCandidates(candidates); });
@@ -420,8 +420,8 @@
     return error;
   }
 
-  std::map<std::string, cricket::Candidates> candidates_by_transport_name;
-  for (const cricket::Candidate& cand : candidates) {
+  std::map<std::string, Candidates> candidates_by_transport_name;
+  for (const Candidate& cand : candidates) {
     if (!cand.transport_name().empty()) {
       candidates_by_transport_name[cand.transport_name()].push_back(cand);
     } else {
@@ -433,14 +433,14 @@
 
   for (const auto& kv : candidates_by_transport_name) {
     const std::string& transport_name = kv.first;
-    const cricket::Candidates& transport_candidates = kv.second;
+    const Candidates& transport_candidates = kv.second;
     JsepTransport* jsep_transport = GetJsepTransportByName(transport_name);
     if (!jsep_transport) {
       RTC_LOG(LS_WARNING)
           << "Not removing candidate because the JsepTransport doesn't exist.";
       continue;
     }
-    for (const cricket::Candidate& candidate : transport_candidates) {
+    for (const Candidate& candidate : transport_candidates) {
       DtlsTransportInternal* dtls =
           candidate.component() == ICE_CANDIDATE_COMPONENT_RTP
               ? jsep_transport->rtp_dtls_transport()
@@ -490,7 +490,7 @@
   return RTCError::OK();
 }
 
-rtc::scoped_refptr<IceTransportInterface>
+scoped_refptr<IceTransportInterface>
 JsepTransportController::CreateIceTransport(const std::string& transport_name,
                                             bool rtcp) {
   int component =
@@ -520,9 +520,9 @@
     dtls = config_.dtls_transport_factory->CreateDtlsTransport(
         ice, config_.crypto_options, config_.ssl_max_version);
   } else {
-    dtls = std::make_unique<cricket::DtlsTransport>(ice, config_.crypto_options,
-                                                    config_.event_log,
-                                                    config_.ssl_max_version);
+    dtls = std::make_unique<DtlsTransportInternalImpl>(
+        ice, config_.crypto_options, config_.event_log,
+        config_.ssl_max_version);
   }
 
   RTC_DCHECK(dtls);
@@ -539,21 +539,20 @@
   dtls->SignalReceivingState.connect(
       this, &JsepTransportController::OnTransportReceivingState_n);
   dtls->ice_transport()->AddGatheringStateCallback(
-      this, [this](cricket::IceTransportInternal* transport) {
+      this, [this](IceTransportInternal* transport) {
         RTC_DCHECK_RUN_ON(network_thread_);
         OnTransportGatheringState_n(transport);
       });
   dtls->ice_transport()->SignalCandidateGathered.connect(
       this, &JsepTransportController::OnTransportCandidateGathered_n);
   dtls->ice_transport()->SetCandidateErrorCallback(
-      [this](cricket::IceTransportInternal* transport,
-             const cricket::IceCandidateErrorEvent& error) {
+      [this](IceTransportInternal* transport,
+             const IceCandidateErrorEvent& error) {
         RTC_DCHECK_RUN_ON(network_thread_);
         OnTransportCandidateError_n(transport, error);
       });
   dtls->ice_transport()->SetCandidatesRemovedCallback(
-      [this](cricket::IceTransportInternal* transport,
-             const cricket::Candidates& candidates) {
+      [this](IceTransportInternal* transport, const Candidates& candidates) {
         RTC_DCHECK_RUN_ON(network_thread_);
         OnTransportCandidatesRemoved_n(transport, candidates);
       });
@@ -564,13 +563,13 @@
   dtls->ice_transport()->SignalIceTransportStateChanged.connect(
       this, &JsepTransportController::OnTransportStateChanged_n);
   dtls->ice_transport()->SetCandidatePairChangeCallback(
-      [this](const cricket::CandidatePairChangeEvent& event) {
+      [this](const CandidatePairChangeEvent& event) {
         RTC_DCHECK_RUN_ON(network_thread_);
         OnTransportCandidatePairChanged_n(event);
       });
 
   dtls->SubscribeDtlsHandshakeError(
-      [this](rtc::SSLHandshakeError error) { OnDtlsHandshakeError(error); });
+      [this](SSLHandshakeError error) { OnDtlsHandshakeError(error); });
   return dtls;
 }
 
@@ -692,7 +691,7 @@
         MergeEncryptedHeaderExtensionIdsForBundles(description);
   }
 
-  for (const cricket::ContentInfo& content_info : description->contents()) {
+  for (const ContentInfo& content_info : description->contents()) {
     // Don't create transports for rejected m-lines and bundled m-lines.
     if (content_info.rejected ||
         !bundles_.IsFirstMidInGroup(content_info.mid())) {
@@ -805,7 +804,7 @@
       description->GetGroupsByName(GROUP_TYPE_BUNDLE);
   // Verify `new_bundle_groups`.
   std::map<std::string, const ContentGroup*> new_bundle_groups_by_mid;
-  for (const cricket::ContentGroup* new_bundle_group : new_bundle_groups) {
+  for (const ContentGroup* new_bundle_group : new_bundle_groups) {
     for (const std::string& content_name : new_bundle_group->content_names()) {
       // The BUNDLE group must not contain a MID that is a member of a different
       // BUNDLE group, or that contains the same MID multiple times.
@@ -837,7 +836,7 @@
         new_bundle_groups_by_existing_bundle_groups;
     std::map<const ContentGroup*, const ContentGroup*>
         existing_bundle_groups_by_new_bundle_groups;
-    for (const cricket::ContentGroup* new_bundle_group : new_bundle_groups) {
+    for (const ContentGroup* new_bundle_group : new_bundle_groups) {
       for (const std::string& mid : new_bundle_group->content_names()) {
         ContentGroup* existing_bundle_group = bundles_.LookupGroupByMid(mid);
         if (!existing_bundle_group) {
@@ -869,8 +868,7 @@
                 : local_desc->GetGroupsByName(GROUP_TYPE_BUNDLE);
 
       std::map<std::string, const ContentGroup*> offered_bundle_groups_by_mid;
-      for (const cricket::ContentGroup* offered_bundle_group :
-           offered_bundle_groups) {
+      for (const ContentGroup* offered_bundle_group : offered_bundle_groups) {
         for (const std::string& content_name :
              offered_bundle_group->content_names()) {
           offered_bundle_groups_by_mid[content_name] = offered_bundle_group;
@@ -879,7 +877,7 @@
 
       std::map<const ContentGroup*, const ContentGroup*>
           new_bundle_groups_by_offered_bundle_groups;
-      for (const cricket::ContentGroup* new_bundle_group : new_bundle_groups) {
+      for (const ContentGroup* new_bundle_group : new_bundle_groups) {
         if (!new_bundle_group->FirstContentName()) {
           // Empty groups could be a subset of any group.
           continue;
@@ -994,7 +992,7 @@
     const ContentInfo& content_info) {
   // If the content is rejected, let the
   // BaseChannel/SctpTransport change the RtpTransport/DtlsTransport first,
-  // then destroy the cricket::JsepTransport.
+  // then destroy the webrtc::JsepTransport.
   ContentGroup* bundle_group = bundles_.LookupGroupByMid(content_info.mid());
   if (bundle_group && !bundle_group->content_names().empty() &&
       content_info.mid() == *bundle_group->FirstContentName()) {
@@ -1024,7 +1022,7 @@
   RTC_DCHECK(jsep_transport);
   // If the content is bundled, let the
   // BaseChannel/SctpTransport change the RtpTransport/DtlsTransport first,
-  // then destroy the cricket::JsepTransport.
+  // then destroy the webrtc::JsepTransport.
   // TODO(bugs.webrtc.org/9719) For media transport this is far from ideal,
   // because it means that we first create media transport and start
   // connecting it, and then we destroy it. We will need to address it before
@@ -1081,7 +1079,7 @@
   std::map<const ContentGroup*, std::vector<int>>
       merged_encrypted_extension_ids_by_bundle;
   // Union the encrypted header IDs in the group when bundle is enabled.
-  for (const cricket::ContentInfo& content_info : description->contents()) {
+  for (const ContentInfo& content_info : description->contents()) {
     auto group = bundles_.LookupGroupByMid(content_info.mid());
     if (!group)
       continue;
@@ -1156,7 +1154,7 @@
     return RTCError::OK();
   }
 
-  rtc::scoped_refptr<IceTransportInterface> ice =
+  scoped_refptr<IceTransportInterface> ice =
       CreateIceTransport(content_info.mid(), /*rtcp=*/false);
 
   std::unique_ptr<DtlsTransportInternal> rtp_dtls_transport =
@@ -1167,7 +1165,7 @@
   std::unique_ptr<SrtpTransport> sdes_transport;
   std::unique_ptr<DtlsSrtpTransport> dtls_srtp_transport;
 
-  rtc::scoped_refptr<IceTransportInterface> rtcp_ice;
+  scoped_refptr<IceTransportInterface> rtcp_ice;
   if (config_.rtcp_mux_policy !=
           PeerConnectionInterface::kRtcpMuxPolicyRequire &&
       content_info.type == MediaProtocolType::kRtp) {
@@ -1208,7 +1206,7 @@
           payload_type_picker_);
 
   jsep_transport->rtp_transport()->SubscribeRtcpPacketReceived(
-      this, [this](rtc::CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
+      this, [this](CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
         RTC_DCHECK_RUN_ON(network_thread_);
         OnRtcpPacketReceived_n(buffer, packet_time_ms);
       });
@@ -1257,7 +1255,7 @@
       ice_role = ICEROLE_CONTROLLING;
     }
   } else {
-    // If our role is cricket::ICEROLE_CONTROLLED and the remote endpoint
+    // If our role is webrtc::ICEROLE_CONTROLLED and the remote endpoint
     // supports only ice_lite, this local endpoint should take the CONTROLLING
     // role.
     // TODO(deadbeef): This is a session-level attribute, so it really shouldn't
@@ -1318,7 +1316,7 @@
 }
 void JsepTransportController::OnTransportCandidatesRemoved_n(
     IceTransportInternal* transport,
-    const cricket::Candidates& candidates) {
+    const Candidates& candidates) {
   signal_ice_candidates_removed_.Send(candidates);
 }
 void JsepTransportController::OnTransportCandidatePairChanged_n(
@@ -1352,8 +1350,7 @@
 void JsepTransportController::UpdateAggregateStates_n() {
   TRACE_EVENT0("webrtc", "JsepTransportController::UpdateAggregateStates_n");
   auto dtls_transports = GetActiveDtlsTransports();
-  cricket::IceConnectionState new_connection_state =
-      cricket::kIceConnectionConnecting;
+  IceConnectionState new_connection_state = kIceConnectionConnecting;
   PeerConnectionInterface::IceConnectionState new_ice_connection_state =
       PeerConnectionInterface::IceConnectionState::kIceConnectionNew;
   PeerConnectionInterface::PeerConnectionState new_combined_state =
@@ -1370,12 +1367,12 @@
 
   for (const auto& dtls : dtls_transports) {
     any_failed = any_failed || dtls->ice_transport()->GetState() ==
-                                   cricket::IceTransportState::STATE_FAILED;
+                                   IceTransportStateInternal::STATE_FAILED;
     all_connected = all_connected && dtls->writable();
     all_completed =
         all_completed && dtls->writable() &&
         dtls->ice_transport()->GetState() ==
-            cricket::IceTransportState::STATE_COMPLETED &&
+            IceTransportStateInternal::STATE_COMPLETED &&
         dtls->ice_transport()->GetIceRole() == ICEROLE_CONTROLLING &&
         dtls->ice_transport()->gathering_state() == kIceGatheringComplete;
     any_gathering = any_gathering || dtls->ice_transport()->gathering_state() !=
@@ -1389,11 +1386,11 @@
   }
 
   if (any_failed) {
-    new_connection_state = cricket::kIceConnectionFailed;
+    new_connection_state = kIceConnectionFailed;
   } else if (all_completed) {
-    new_connection_state = cricket::kIceConnectionCompleted;
+    new_connection_state = kIceConnectionCompleted;
   } else if (all_connected) {
-    new_connection_state = cricket::kIceConnectionConnected;
+    new_connection_state = kIceConnectionConnected;
   }
   if (ice_connection_state_ != new_connection_state) {
     ice_connection_state_ = new_connection_state;
@@ -1525,9 +1522,8 @@
   }
 }
 
-void JsepTransportController::OnRtcpPacketReceived_n(
-    rtc::CopyOnWriteBuffer* packet,
-    int64_t packet_time_us) {
+void JsepTransportController::OnRtcpPacketReceived_n(CopyOnWriteBuffer* packet,
+                                                     int64_t packet_time_us) {
   RTC_DCHECK(config_.rtcp_handler);
   config_.rtcp_handler(*packet, packet_time_us);
 }
diff --git a/pc/jsep_transport_controller.h b/pc/jsep_transport_controller.h
index d4ea2cf..3f42a02 100644
--- a/pc/jsep_transport_controller.h
+++ b/pc/jsep_transport_controller.h
@@ -96,7 +96,7 @@
     virtual bool OnTransportChanged(
         const std::string& mid,
         RtpTransportInternal* rtp_transport,
-        rtc::scoped_refptr<DtlsTransport> dtls_transport,
+        scoped_refptr<DtlsTransport> dtls_transport,
         DataChannelTransportInterface* data_channel_transport) = 0;
   };
 
@@ -121,7 +121,7 @@
     Observer* transport_observer = nullptr;
     // Must be provided and valid for the lifetime of the
     // JsepTransportController instance.
-    absl::AnyInvocable<void(const rtc::CopyOnWriteBuffer& packet,
+    absl::AnyInvocable<void(const webrtc::CopyOnWriteBuffer& packet,
                             int64_t packet_time_us) const>
         rtcp_handler;
     absl::AnyInvocable<void(const RtpPacketReceived& parsed_packet) const>
@@ -182,10 +182,8 @@
   const DtlsTransportInternal* GetRtcpDtlsTransport(
       const std::string& mid) const;
   // Gets the externally sharable version of the DtlsTransport.
-  rtc::scoped_refptr<DtlsTransport> LookupDtlsTransportByMid(
-      const std::string& mid);
-  rtc::scoped_refptr<SctpTransport> GetSctpTransport(
-      const std::string& mid) const;
+  scoped_refptr<DtlsTransport> LookupDtlsTransportByMid(const std::string& mid);
+  scoped_refptr<SctpTransport> GetSctpTransport(const std::string& mid) const;
 
   DataChannelTransportInterface* GetDataChannelTransport(
       const std::string& mid) const;
@@ -217,9 +215,8 @@
    *********************/
   // Specifies the identity to use in this session.
   // Can only be called once.
-  bool SetLocalCertificate(
-      const rtc::scoped_refptr<RTCCertificate>& certificate);
-  rtc::scoped_refptr<RTCCertificate> GetLocalCertificate(
+  bool SetLocalCertificate(const scoped_refptr<RTCCertificate>& certificate);
+  scoped_refptr<RTCCertificate> GetLocalCertificate(
       const std::string& mid) const;
   // Caller owns returned certificate chain. This method mainly exists for
   // stats reporting.
@@ -249,14 +246,14 @@
 
   RTCError RollbackTransports();
 
-  // F: void(const std::string&, const std::vector<cricket::Candidate>&)
+  // F: void(const std::string&, const std::vector<webrtc::Candidate>&)
   template <typename F>
   void SubscribeIceCandidateGathered(F&& callback) {
     RTC_DCHECK_RUN_ON(network_thread_);
     signal_ice_candidates_gathered_.AddReceiver(std::forward<F>(callback));
   }
 
-  // F: void(cricket::IceConnectionState)
+  // F: void(webrtc::IceConnectionState)
   template <typename F>
   void SubscribeIceConnectionState(F&& callback) {
     RTC_DCHECK_RUN_ON(network_thread_);
@@ -278,28 +275,28 @@
         std::forward<F>(callback));
   }
 
-  // F: void(cricket::IceGatheringState)
+  // F: void(webrtc::IceGatheringState)
   template <typename F>
   void SubscribeIceGatheringState(F&& callback) {
     RTC_DCHECK_RUN_ON(network_thread_);
     signal_ice_gathering_state_.AddReceiver(std::forward<F>(callback));
   }
 
-  // F: void(const cricket::IceCandidateErrorEvent&)
+  // F: void(const webrtc::IceCandidateErrorEvent&)
   template <typename F>
   void SubscribeIceCandidateError(F&& callback) {
     RTC_DCHECK_RUN_ON(network_thread_);
     signal_ice_candidate_error_.AddReceiver(std::forward<F>(callback));
   }
 
-  // F: void(const std::vector<cricket::Candidate>&)
+  // F: void(const std::vector<webrtc::Candidate>&)
   template <typename F>
   void SubscribeIceCandidatesRemoved(F&& callback) {
     RTC_DCHECK_RUN_ON(network_thread_);
     signal_ice_candidates_removed_.AddReceiver(std::forward<F>(callback));
   }
 
-  // F: void(const cricket::CandidatePairChangeEvent&)
+  // F: void(const webrtc::CandidatePairChangeEvent&)
   template <typename F>
   void SubscribeIceCandidatePairChanged(F&& callback) {
     RTC_DCHECK_RUN_ON(network_thread_);
@@ -313,7 +310,7 @@
   // Else if all completed => completed,
   // Else if all connected => connected,
   // Else => connecting
-  CallbackList<cricket::IceConnectionState> signal_ice_connection_state_
+  CallbackList<IceConnectionState> signal_ice_connection_state_
       RTC_GUARDED_BY(network_thread_);
 
   CallbackList<PeerConnectionInterface::PeerConnectionState>
@@ -420,7 +417,7 @@
   std::unique_ptr<DtlsTransportInternal> CreateDtlsTransport(
       const ContentInfo& content_info,
       IceTransportInternal* ice);
-  rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
+  scoped_refptr<IceTransportInterface> CreateIceTransport(
       const std::string& transport_name,
       bool rtcp);
 
@@ -460,7 +457,7 @@
                                    const IceCandidateErrorEvent& event)
       RTC_RUN_ON(network_thread_);
   void OnTransportCandidatesRemoved_n(IceTransportInternal* transport,
-                                      const cricket::Candidates& candidates)
+                                      const Candidates& candidates)
       RTC_RUN_ON(network_thread_);
   void OnTransportRoleConflict_n(IceTransportInternal* transport)
       RTC_RUN_ON(network_thread_);
@@ -470,8 +467,7 @@
       RTC_RUN_ON(network_thread_);
   void UpdateAggregateStates_n() RTC_RUN_ON(network_thread_);
 
-  void OnRtcpPacketReceived_n(rtc::CopyOnWriteBuffer* packet,
-                              int64_t packet_time_us)
+  void OnRtcpPacketReceived_n(CopyOnWriteBuffer* packet, int64_t packet_time_us)
       RTC_RUN_ON(network_thread_);
   void OnUnDemuxableRtpPacketReceived_n(const RtpPacketReceived& packet)
       RTC_RUN_ON(network_thread_);
@@ -489,8 +485,7 @@
   // Aggregate states for Transports.
   // standardized_ice_connection_state_ is intended to replace
   // ice_connection_state, see bugs.webrtc.org/9308
-  cricket::IceConnectionState ice_connection_state_ =
-      cricket::kIceConnectionConnecting;
+  IceConnectionState ice_connection_state_ = kIceConnectionConnecting;
   PeerConnectionInterface::IceConnectionState
       standardized_ice_connection_state_ =
           PeerConnectionInterface::kIceConnectionNew;
@@ -505,7 +500,7 @@
 
   IceConfig ice_config_;
   IceRole ice_role_ = ICEROLE_CONTROLLING;
-  rtc::scoped_refptr<RTCCertificate> certificate_;
+  scoped_refptr<RTCCertificate> certificate_;
 
   BundleManager bundles_;
   // Reference to the SdpOfferAnswerHandler's payload type picker.
diff --git a/pc/jsep_transport_controller_unittest.cc b/pc/jsep_transport_controller_unittest.cc
index 0ec608c..e8d8117 100644
--- a/pc/jsep_transport_controller_unittest.cc
+++ b/pc/jsep_transport_controller_unittest.cc
@@ -69,7 +69,7 @@
 #include "test/scoped_key_value_config.h"
 #include "test/wait_until.h"
 
-using cricket::Candidate;
+using webrtc::Candidate;
 using ::webrtc::Candidates;
 using ::webrtc::FakeDtlsTransport;
 
@@ -93,11 +93,11 @@
 class FakeIceTransportFactory : public IceTransportFactory {
  public:
   ~FakeIceTransportFactory() override = default;
-  rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
+  scoped_refptr<IceTransportInterface> CreateIceTransport(
       const std::string& transport_name,
       int component,
       IceTransportInit init) override {
-    return rtc::make_ref_counted<FakeIceTransportWrapper>(
+    return make_ref_counted<FakeIceTransportWrapper>(
         std::make_unique<FakeIceTransport>(transport_name, component));
   }
 };
@@ -128,13 +128,13 @@
                                      Thread* network_thread = Thread::Current(),
                                      PortAllocator* port_allocator = nullptr) {
     config.transport_observer = this;
-    config.rtcp_handler = [](const rtc::CopyOnWriteBuffer& packet,
+    config.rtcp_handler = [](const CopyOnWriteBuffer& packet,
                              int64_t packet_time_us) {
       RTC_DCHECK_NOTREACHED();
     };
     config.ice_transport_factory = fake_ice_transport_factory_.get();
     config.dtls_transport_factory = fake_dtls_transport_factory_.get();
-    config.on_dtls_handshake_error_ = [](rtc::SSLHandshakeError s) {};
+    config.on_dtls_handshake_error_ = [](SSLHandshakeError s) {};
     transport_controller_ = std::make_unique<JsepTransportController>(
         env_, network_thread, port_allocator,
         nullptr /* async_resolver_factory */, payload_type_picker_,
@@ -144,7 +144,7 @@
 
   void ConnectTransportControllerSignals() {
     transport_controller_->SubscribeIceConnectionState(
-        [this](cricket::IceConnectionState s) {
+        [this](IceConnectionState s) {
           JsepTransportControllerTest::OnConnectionState(s);
         });
     transport_controller_->SubscribeConnectionState(
@@ -156,12 +156,12 @@
           JsepTransportControllerTest::OnStandardizedIceConnectionState(s);
         });
     transport_controller_->SubscribeIceGatheringState(
-        [this](cricket::IceGatheringState s) {
+        [this](IceGatheringState s) {
           JsepTransportControllerTest::OnGatheringState(s);
         });
     transport_controller_->SubscribeIceCandidateGathered(
         [this](const std::string& transport,
-               const std::vector<cricket::Candidate>& candidates) {
+               const std::vector<Candidate>& candidates) {
           JsepTransportControllerTest::OnCandidatesGathered(transport,
                                                             candidates);
         });
@@ -207,7 +207,7 @@
                        const std::string& pwd,
                        IceMode ice_mode,
                        ConnectionRole conn_role,
-                       rtc::scoped_refptr<RTCCertificate> cert) {
+                       scoped_refptr<RTCCertificate> cert) {
     std::unique_ptr<AudioContentDescription> audio(
         new AudioContentDescription());
     // Set RTCP-mux to be true because the default policy is "mux required".
@@ -223,7 +223,7 @@
                        const std::string& pwd,
                        IceMode ice_mode,
                        ConnectionRole conn_role,
-                       rtc::scoped_refptr<RTCCertificate> cert) {
+                       scoped_refptr<RTCCertificate> cert) {
     std::unique_ptr<VideoContentDescription> video(
         new VideoContentDescription());
     // Set RTCP-mux to be true because the default policy is "mux required".
@@ -240,7 +240,7 @@
                       const std::string& pwd,
                       IceMode ice_mode,
                       ConnectionRole conn_role,
-                      rtc::scoped_refptr<RTCCertificate> cert) {
+                      scoped_refptr<RTCCertificate> cert) {
     RTC_CHECK(protocol_type == MediaProtocolType::kSctp);
     std::unique_ptr<SctpDataContentDescription> data(
         new SctpDataContentDescription());
@@ -256,7 +256,7 @@
                         const std::string& pwd,
                         IceMode ice_mode,
                         ConnectionRole conn_role,
-                        rtc::scoped_refptr<RTCCertificate> cert) {
+                        scoped_refptr<RTCCertificate> cert) {
     std::unique_ptr<SSLFingerprint> fingerprint;
     if (cert) {
       fingerprint = SSLFingerprint::CreateFromCertificate(*cert);
@@ -324,7 +324,7 @@
   }
 
  protected:
-  void OnConnectionState(cricket::IceConnectionState state) {
+  void OnConnectionState(IceConnectionState state) {
     ice_signaled_on_thread_ = Thread::Current();
     connection_state_ = state;
     ++connection_state_signal_count_;
@@ -364,7 +364,7 @@
   bool OnTransportChanged(
       const std::string& mid,
       RtpTransportInternal* rtp_transport,
-      rtc::scoped_refptr<DtlsTransport> dtls_transport,
+      scoped_refptr<DtlsTransport> dtls_transport,
       DataChannelTransportInterface* data_channel_transport) override {
     changed_rtp_transport_by_mid_[mid] = rtp_transport;
     if (dtls_transport) {
@@ -379,8 +379,7 @@
   Environment env_;
   AutoThread main_thread_;
   // Information received from signals from transport controller.
-  cricket::IceConnectionState connection_state_ =
-      cricket::kIceConnectionConnecting;
+  IceConnectionState connection_state_ = kIceConnectionConnecting;
   PeerConnectionInterface::IceConnectionState ice_connection_state_ =
       PeerConnectionInterface::kIceConnectionNew;
   PeerConnectionInterface::PeerConnectionState combined_connection_state_ =
@@ -595,9 +594,9 @@
 TEST_F(JsepTransportControllerTest, SetAndGetLocalCertificate) {
   CreateJsepTransportController(JsepTransportController::Config());
 
-  rtc::scoped_refptr<RTCCertificate> certificate1 =
+  scoped_refptr<RTCCertificate> certificate1 =
       RTCCertificate::Create(SSLIdentity::Create("session1", KT_DEFAULT));
-  rtc::scoped_refptr<RTCCertificate> returned_certificate;
+  scoped_refptr<RTCCertificate> returned_certificate;
 
   auto description = std::make_unique<SessionDescription>();
   AddAudioSection(description.get(), kAudioMid1, kIceUfrag1, kIcePwd1,
@@ -619,7 +618,7 @@
   EXPECT_EQ(nullptr, transport_controller_->GetLocalCertificate(kVideoMid1));
 
   // Shouldn't be able to change the identity once set.
-  rtc::scoped_refptr<RTCCertificate> certificate2 =
+  scoped_refptr<RTCCertificate> certificate2 =
       RTCCertificate::Create(SSLIdentity::Create("session2", KT_DEFAULT));
   EXPECT_FALSE(transport_controller_->SetLocalCertificate(certificate2));
 }
@@ -710,7 +709,7 @@
   fake_ice->SetConnectionCount(1);
   // The connection stats will be failed if there is no active connection.
   fake_ice->SetConnectionCount(0);
-  EXPECT_THAT(WaitUntil([&] { return cricket::kIceConnectionFailed; },
+  EXPECT_THAT(WaitUntil([&] { return kIceConnectionFailed; },
                         ::testing::Eq(connection_state_),
                         {.timeout = webrtc::TimeDelta::Millis(kTimeout)}),
               IsRtcOk());
@@ -755,7 +754,7 @@
   fake_video_dtls->fake_ice_transport()->SetConnectionCount(0);
   fake_video_dtls->fake_ice_transport()->SetCandidatesGatheringComplete();
 
-  EXPECT_THAT(WaitUntil([&] { return cricket::kIceConnectionFailed; },
+  EXPECT_THAT(WaitUntil([&] { return kIceConnectionFailed; },
                         ::testing::Eq(connection_state_),
                         {.timeout = webrtc::TimeDelta::Millis(kTimeout)}),
               IsRtcOk());
@@ -776,11 +775,11 @@
 
   fake_audio_dtls->SetDtlsState(DtlsTransportState::kConnected);
   fake_video_dtls->SetDtlsState(DtlsTransportState::kConnected);
-  // Set the connection count to be 2 and the cricket::FakeIceTransport will set
+  // Set the connection count to be 2 and the webrtc::FakeIceTransport will set
   // the transport state to be STATE_CONNECTING.
   fake_video_dtls->fake_ice_transport()->SetConnectionCount(2);
   fake_video_dtls->SetWritable(true);
-  EXPECT_THAT(WaitUntil([&] { return cricket::kIceConnectionConnected; },
+  EXPECT_THAT(WaitUntil([&] { return kIceConnectionConnected; },
                         ::testing::Eq(connection_state_),
                         {.timeout = webrtc::TimeDelta::Millis(kTimeout)}),
               IsRtcOk());
@@ -821,7 +820,7 @@
   // We should only get a signal when all are connected.
   fake_audio_dtls->fake_ice_transport()->SetTransportState(
       IceTransportState::kCompleted,
-      cricket::IceTransportState::STATE_COMPLETED);
+      IceTransportStateInternal::STATE_COMPLETED);
   fake_audio_dtls->SetWritable(true);
   fake_audio_dtls->fake_ice_transport()->SetCandidatesGatheringComplete();
 
@@ -842,10 +841,10 @@
   EXPECT_EQ(1, combined_connection_state_signal_count_);
 
   fake_video_dtls->fake_ice_transport()->SetTransportState(
-      IceTransportState::kFailed, cricket::IceTransportState::STATE_FAILED);
+      IceTransportState::kFailed, IceTransportStateInternal::STATE_FAILED);
   fake_video_dtls->fake_ice_transport()->SetCandidatesGatheringComplete();
 
-  EXPECT_THAT(WaitUntil([&] { return cricket::kIceConnectionFailed; },
+  EXPECT_THAT(WaitUntil([&] { return kIceConnectionFailed; },
                         ::testing::Eq(connection_state_),
                         {.timeout = webrtc::TimeDelta::Millis(kTimeout)}),
               IsRtcOk());
@@ -866,13 +865,13 @@
 
   fake_audio_dtls->SetDtlsState(DtlsTransportState::kConnected);
   fake_video_dtls->SetDtlsState(DtlsTransportState::kConnected);
-  // Set the connection count to be 1 and the cricket::FakeIceTransport will set
+  // Set the connection count to be 1 and the webrtc::FakeIceTransport will set
   // the transport state to be STATE_COMPLETED.
   fake_video_dtls->fake_ice_transport()->SetTransportState(
       IceTransportState::kCompleted,
-      cricket::IceTransportState::STATE_COMPLETED);
+      IceTransportStateInternal::STATE_COMPLETED);
   fake_video_dtls->SetWritable(true);
-  EXPECT_THAT(WaitUntil([&] { return cricket::kIceConnectionCompleted; },
+  EXPECT_THAT(WaitUntil([&] { return kIceConnectionCompleted; },
                         ::testing::Eq(connection_state_),
                         {.timeout = webrtc::TimeDelta::Millis(kTimeout)}),
               IsRtcOk());
@@ -997,7 +996,7 @@
   fake_video_dtls = static_cast<FakeDtlsTransport*>(
       transport_controller_->GetDtlsTransport(kVideoMid1));
   EXPECT_EQ(fake_audio_dtls, fake_video_dtls);
-  EXPECT_THAT(WaitUntil([&] { return cricket::kIceConnectionCompleted; },
+  EXPECT_THAT(WaitUntil([&] { return kIceConnectionCompleted; },
                         ::testing::Eq(connection_state_),
                         {.timeout = webrtc::TimeDelta::Millis(kTimeout)}),
               IsRtcOk());
@@ -1036,7 +1035,7 @@
   fake_audio_dtls->fake_ice_transport()->MaybeStartGathering();
   fake_audio_dtls->fake_ice_transport()->SetTransportState(
       IceTransportState::kChecking,
-      cricket::IceTransportState::STATE_CONNECTING);
+      IceTransportStateInternal::STATE_CONNECTING);
   EXPECT_THAT(
       WaitUntil([&] { return PeerConnectionInterface::kIceConnectionChecking; },
                 ::testing::Eq(ice_connection_state_),
@@ -1139,7 +1138,7 @@
   CreateLocalDescriptionAndCompleteConnectionOnNetworkThread();
 
   // connecting --> connected --> completed
-  EXPECT_THAT(WaitUntil([&] { return cricket::kIceConnectionCompleted; },
+  EXPECT_THAT(WaitUntil([&] { return kIceConnectionCompleted; },
                         ::testing::Eq(connection_state_),
                         {.timeout = webrtc::TimeDelta::Millis(kTimeout)}),
               IsRtcOk());
diff --git a/pc/jsep_transport_unittest.cc b/pc/jsep_transport_unittest.cc
index ad48071..ca4a064 100644
--- a/pc/jsep_transport_unittest.cc
+++ b/pc/jsep_transport_unittest.cc
@@ -96,7 +96,7 @@
     return nullptr;
   }
 
-  return rtc::make_ref_counted<FakeIceTransportWrapper>(std::move(internal));
+  return make_ref_counted<FakeIceTransportWrapper>(std::move(internal));
 }
 
 class JsepTransport2Test : public ::testing::Test, public sigslot::has_slots<> {
@@ -1050,13 +1050,13 @@
         static_cast<FakeDtlsTransport*>(jsep_transport2_->rtp_dtls_transport());
 
     fake_dtls1->fake_ice_transport()->RegisterReceivedPacketCallback(
-        this, [&](rtc::PacketTransportInternal* transport,
-                  const rtc::ReceivedPacket& packet) {
+        this, [&](PacketTransportInternal* transport,
+                  const ReceivedIpPacket& packet) {
           OnReadPacket1(transport, packet);
         });
     fake_dtls2->fake_ice_transport()->RegisterReceivedPacketCallback(
-        this, [&](rtc::PacketTransportInternal* transport,
-                  const rtc::ReceivedPacket& packet) {
+        this, [&](PacketTransportInternal* transport,
+                  const ReceivedIpPacket& packet) {
           OnReadPacket2(transport, packet);
         });
 
@@ -1069,7 +1069,7 @@
   }
 
   void OnReadPacket1(PacketTransportInternal* transport,
-                     const rtc::ReceivedPacket& packet) {
+                     const ReceivedIpPacket& packet) {
     RTC_LOG(LS_INFO) << "JsepTransport 1 Received a packet.";
     CompareHeaderExtensions(
         reinterpret_cast<const char*>(kPcmuFrameWithExtensions),
@@ -1080,7 +1080,7 @@
   }
 
   void OnReadPacket2(PacketTransportInternal* transport,
-                     const rtc::ReceivedPacket& packet) {
+                     const ReceivedIpPacket& packet) {
     RTC_LOG(LS_INFO) << "JsepTransport 2 Received a packet.";
     CompareHeaderExtensions(
         reinterpret_cast<const char*>(kPcmuFrameWithExtensions),
@@ -1127,7 +1127,7 @@
     CopyOnWriteBuffer rtp_packet(rtp_packet_data, rtp_len, packet_size);
 
     int packet_count_before = received_packet_count_;
-    rtc::PacketOptions options;
+    AsyncSocketPacketOptions options;
     // Send a packet and verify that the packet can be successfully received and
     // decrypted.
     ASSERT_TRUE(sender_transport->rtp_transport()->SendRtpPacket(
diff --git a/pc/legacy_stats_collector.cc b/pc/legacy_stats_collector.cc
index e99dd7c..87cc3eb 100644
--- a/pc/legacy_stats_collector.cc
+++ b/pc/legacy_stats_collector.cc
@@ -907,7 +907,7 @@
 }
 
 LegacyStatsCollector::SessionStats LegacyStatsCollector::ExtractSessionInfo_n(
-    const std::vector<rtc::scoped_refptr<
+    const std::vector<scoped_refptr<
         RtpTransceiverProxyWithInternal<RtpTransceiver>>>& transceivers,
     std::optional<std::string> sctp_transport_name,
     std::optional<std::string> sctp_mid) {
@@ -946,7 +946,7 @@
     // same local and remote certificates.
     //
     StatsReport::Id local_cert_report_id, remote_cert_report_id;
-    rtc::scoped_refptr<RTCCertificate> certificate;
+    scoped_refptr<RTCCertificate> certificate;
     if (pc_->GetLocalCertificate(transport.name, &certificate)) {
       transport.local_cert_stats =
           certificate->GetSSLCertificateChain().GetStats();
@@ -973,7 +973,7 @@
   report->AddBoolean(StatsReport::kStatsValueNameInitiator,
                      pc_->initial_offerer());
 
-  for (const cricket::CandidateStats& stats : session_stats.candidate_stats) {
+  for (const CandidateStats& stats : session_stats.candidate_stats) {
     AddCandidateReport(stats, true);
   }
 
@@ -1029,13 +1029,13 @@
       // AddConnectionInfoReport below, and they may report candidates that are
       // not paired. Also, the candidate report generated in
       // AddConnectionInfoReport do not report port stats like StunStats.
-      for (const cricket::CandidateStats& stats :
+      for (const CandidateStats& stats :
            channel_iter.ice_transport_stats.candidate_stats_list) {
         AddCandidateReport(stats, true);
       }
 
       int connection_id = 0;
-      for (const cricket::ConnectionInfo& info :
+      for (const ConnectionInfo& info :
            channel_iter.ice_transport_stats.connection_infos) {
         StatsReport* connection_report = AddConnectionInfoReport(
             transport.name, channel_iter.component, connection_id++,
@@ -1296,7 +1296,7 @@
     if (!sender->ssrc()) {
       continue;
     }
-    const rtc::scoped_refptr<MediaStreamTrackInterface> track(sender->track());
+    const scoped_refptr<MediaStreamTrackInterface> track(sender->track());
     if (!track || track->kind() != MediaStreamTrackInterface::kVideoKind) {
       continue;
     }
diff --git a/pc/legacy_stats_collector.h b/pc/legacy_stats_collector.h
index bc15ce8..e2786b1 100644
--- a/pc/legacy_stats_collector.h
+++ b/pc/legacy_stats_collector.h
@@ -136,7 +136,7 @@
     SessionStats& operator=(SessionStats&&) = default;
     SessionStats& operator=(SessionStats&) = delete;
 
-    cricket::CandidateStatsList candidate_stats;
+    CandidateStatsList candidate_stats;
     std::vector<TransportStats> transport_stats;
     std::map<std::string, std::string> transport_names_by_mid;
   };
@@ -188,7 +188,7 @@
   void UpdateTrackReports();
 
   SessionStats ExtractSessionInfo_n(
-      const std::vector<rtc::scoped_refptr<
+      const std::vector<scoped_refptr<
           RtpTransceiverProxyWithInternal<RtpTransceiver>>>& transceivers,
       std::optional<std::string> sctp_transport_name,
       std::optional<std::string> sctp_mid);
diff --git a/pc/legacy_stats_collector_unittest.cc b/pc/legacy_stats_collector_unittest.cc
index b20a98d..7ecc5bf 100644
--- a/pc/legacy_stats_collector_unittest.cc
+++ b/pc/legacy_stats_collector_unittest.cc
@@ -108,7 +108,7 @@
  public:
   explicit FakeAudioTrack(const std::string& id)
       : MediaStreamTrack<AudioTrackInterface>(id),
-        processor_(rtc::make_ref_counted<FakeAudioProcessor>()) {}
+        processor_(make_ref_counted<FakeAudioProcessor>()) {}
   std::string kind() const override { return "audio"; }
   AudioSourceInterface* GetSource() const override { return NULL; }
   void AddSink(AudioTrackSinkInterface* sink) override {}
@@ -117,12 +117,12 @@
     *level = 1;
     return true;
   }
-  rtc::scoped_refptr<AudioProcessorInterface> GetAudioProcessor() override {
+  scoped_refptr<AudioProcessorInterface> GetAudioProcessor() override {
     return processor_;
   }
 
  private:
-  rtc::scoped_refptr<FakeAudioProcessor> processor_;
+  scoped_refptr<FakeAudioProcessor> processor_;
 };
 
 // This fake audio processor is used to verify that the undesired initial values
@@ -145,7 +145,7 @@
  public:
   explicit FakeAudioTrackWithInitValue(const std::string& id)
       : MediaStreamTrack<AudioTrackInterface>(id),
-        processor_(rtc::make_ref_counted<FakeAudioProcessorWithInitValue>()) {}
+        processor_(make_ref_counted<FakeAudioProcessorWithInitValue>()) {}
   std::string kind() const override { return "audio"; }
   AudioSourceInterface* GetSource() const override { return NULL; }
   void AddSink(AudioTrackSinkInterface* sink) override {}
@@ -154,12 +154,12 @@
     *level = 1;
     return true;
   }
-  rtc::scoped_refptr<AudioProcessorInterface> GetAudioProcessor() override {
+  scoped_refptr<AudioProcessorInterface> GetAudioProcessor() override {
     return processor_;
   }
 
  private:
-  rtc::scoped_refptr<FakeAudioProcessorWithInitValue> processor_;
+  scoped_refptr<FakeAudioProcessorWithInitValue> processor_;
 };
 
 bool GetValue(const StatsReport* report,
@@ -601,8 +601,8 @@
 
 class LegacyStatsCollectorTest : public ::testing::Test {
  protected:
-  rtc::scoped_refptr<FakePeerConnectionForStats> CreatePeerConnection() {
-    return rtc::make_ref_counted<FakePeerConnectionForStats>();
+  scoped_refptr<FakePeerConnectionForStats> CreatePeerConnection() {
+    return make_ref_counted<FakePeerConnectionForStats>();
   }
 
   std::unique_ptr<LegacyStatsCollectorForTest> CreateStatsCollector(
@@ -682,7 +682,7 @@
     pc->SetTransportStats(kTransportName, channel_stats);
 
     // Fake certificate to report.
-    rtc::scoped_refptr<RTCCertificate> local_certificate(
+    scoped_refptr<RTCCertificate> local_certificate(
         RTCCertificate::Create(local_identity.Clone()));
     pc->SetLocalCertificate(kTransportName, local_certificate);
     pc->SetRemoteCertChain(kTransportName,
@@ -736,10 +736,10 @@
   AutoThread main_thread_;
 };
 
-static rtc::scoped_refptr<MockRtpSenderInternal> CreateMockSender(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+static scoped_refptr<MockRtpSenderInternal> CreateMockSender(
+    scoped_refptr<MediaStreamTrackInterface> track,
     uint32_t ssrc) {
-  auto sender = rtc::make_ref_counted<MockRtpSenderInternal>();
+  auto sender = make_ref_counted<MockRtpSenderInternal>();
   EXPECT_CALL(*sender, track()).WillRepeatedly(Return(track));
   EXPECT_CALL(*sender, ssrc()).WillRepeatedly(Return(ssrc));
   EXPECT_CALL(*sender, media_type())
@@ -753,10 +753,10 @@
   return sender;
 }
 
-static rtc::scoped_refptr<MockRtpReceiverInternal> CreateMockReceiver(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+static scoped_refptr<MockRtpReceiverInternal> CreateMockReceiver(
+    scoped_refptr<MediaStreamTrackInterface> track,
     uint32_t ssrc) {
-  auto receiver = rtc::make_ref_counted<MockRtpReceiverInternal>();
+  auto receiver = make_ref_counted<MockRtpReceiverInternal>();
   EXPECT_CALL(*receiver, track()).WillRepeatedly(Return(track));
   EXPECT_CALL(*receiver, ssrc()).WillRepeatedly(Return(ssrc));
   EXPECT_CALL(*receiver, media_type())
@@ -809,10 +809,10 @@
   // and register it into the stats object.
   // If GetParam() returns true, the track is also inserted into the local
   // stream, which is created if necessary.
-  rtc::scoped_refptr<RtpSenderInterface> AddOutgoingAudioTrack(
+  scoped_refptr<RtpSenderInterface> AddOutgoingAudioTrack(
       FakePeerConnectionForStats* pc,
       LegacyStatsCollectorForTest* stats) {
-    audio_track_ = rtc::make_ref_counted<FakeAudioTrack>(kLocalTrackId);
+    audio_track_ = make_ref_counted<FakeAudioTrack>(kLocalTrackId);
     if (GetParam()) {
       if (!stream_)
         stream_ = MediaStream::Create("streamid");
@@ -827,7 +827,7 @@
   // Adds a incoming audio track with a given SSRC into the stats.
   void AddIncomingAudioTrack(FakePeerConnectionForStats* pc,
                              LegacyStatsCollectorForTest* stats) {
-    audio_track_ = rtc::make_ref_counted<FakeAudioTrack>(kRemoteTrackId);
+    audio_track_ = make_ref_counted<FakeAudioTrack>(kRemoteTrackId);
     if (GetParam()) {
       if (stream_ == nullptr)
         stream_ = MediaStream::Create("streamid");
@@ -839,12 +839,12 @@
     pc->AddReceiver(CreateMockReceiver(audio_track_, kSsrcOfTrack));
   }
 
-  rtc::scoped_refptr<AudioTrackInterface> audio_track() { return audio_track_; }
-  rtc::scoped_refptr<VideoTrackInterface> video_track() { return video_track_; }
+  scoped_refptr<AudioTrackInterface> audio_track() { return audio_track_; }
+  scoped_refptr<VideoTrackInterface> video_track() { return video_track_; }
 
-  rtc::scoped_refptr<MediaStream> stream_;
-  rtc::scoped_refptr<VideoTrack> video_track_;
-  rtc::scoped_refptr<FakeAudioTrack> audio_track_;
+  scoped_refptr<MediaStream> stream_;
+  scoped_refptr<VideoTrack> video_track_;
+  scoped_refptr<FakeAudioTrack> audio_track_;
 };
 
 TEST(StatsCollectionTest, DetachAndMerge) {
@@ -1538,8 +1538,8 @@
   // Create a local stream with a local audio track and adds it to the stats.
   stream_ = MediaStream::Create("streamid");
   auto local_track =
-      rtc::make_ref_counted<FakeAudioTrackWithInitValue>(kLocalTrackId);
-  stream_->AddTrack(rtc::scoped_refptr<AudioTrackInterface>(local_track.get()));
+      make_ref_counted<FakeAudioTrackWithInitValue>(kLocalTrackId);
+  stream_->AddTrack(scoped_refptr<AudioTrackInterface>(local_track.get()));
   pc->AddSender(CreateMockSender(local_track, kSsrcOfTrack));
   if (GetParam()) {
     stats->AddStream(stream_.get());
@@ -1547,10 +1547,10 @@
   stats->AddLocalAudioTrack(local_track.get(), kSsrcOfTrack);
 
   // Create a remote stream with a remote audio track and adds it to the stats.
-  rtc::scoped_refptr<MediaStream> remote_stream(
+  scoped_refptr<MediaStream> remote_stream(
       MediaStream::Create("remotestreamid"));
-  rtc::scoped_refptr<AudioTrackInterface> remote_track =
-      rtc::make_ref_counted<FakeAudioTrackWithInitValue>(kRemoteTrackId);
+  scoped_refptr<AudioTrackInterface> remote_track =
+      make_ref_counted<FakeAudioTrackWithInitValue>(kRemoteTrackId);
   remote_stream->AddTrack(remote_track);
   pc->AddReceiver(CreateMockReceiver(remote_track, kSsrcOfTrack));
   if (GetParam()) {
@@ -1722,10 +1722,10 @@
   stats->AddLocalAudioTrack(audio_track_.get(), kSsrcOfTrack);
 
   // Create a remote stream with a remote audio track and adds it to the stats.
-  rtc::scoped_refptr<MediaStream> remote_stream(
+  scoped_refptr<MediaStream> remote_stream(
       MediaStream::Create("remotestreamid"));
-  rtc::scoped_refptr<AudioTrackInterface> remote_track =
-      rtc::make_ref_counted<FakeAudioTrack>(kRemoteTrackId);
+  scoped_refptr<AudioTrackInterface> remote_track =
+      make_ref_counted<FakeAudioTrack>(kRemoteTrackId);
   pc->AddReceiver(CreateMockReceiver(remote_track, kSsrcOfTrack));
   remote_stream->AddTrack(remote_track);
   stats->AddStream(remote_stream.get());
@@ -1817,10 +1817,9 @@
 
   // Create a new audio track and adds it to the stream and stats.
   static const std::string kNewTrackId = "new_track_id";
-  auto new_audio_track = rtc::make_ref_counted<FakeAudioTrack>(kNewTrackId);
+  auto new_audio_track = make_ref_counted<FakeAudioTrack>(kNewTrackId);
   pc->AddSender(CreateMockSender(new_audio_track, kSsrcOfTrack));
-  stream_->AddTrack(
-      rtc::scoped_refptr<AudioTrackInterface>(new_audio_track.get()));
+  stream_->AddTrack(scoped_refptr<AudioTrackInterface>(new_audio_track.get()));
 
   stats->AddLocalAudioTrack(new_audio_track.get(), kSsrcOfTrack);
   stats->InvalidateCache();
@@ -1850,7 +1849,7 @@
   auto stats = CreateStatsCollector(pc.get());
 
   auto local_track =
-      rtc::make_ref_counted<FakeAudioTrackWithInitValue>(kLocalTrackId);
+      make_ref_counted<FakeAudioTrackWithInitValue>(kLocalTrackId);
   pc->AddSender(CreateMockSender(local_track, kFirstSsrc));
   stats->AddLocalAudioTrack(local_track.get(), kFirstSsrc);
   pc->AddSender(CreateMockSender(local_track, kSecondSsrc));
diff --git a/pc/local_audio_source.cc b/pc/local_audio_source.cc
index b998886..9e4f35f 100644
--- a/pc/local_audio_source.cc
+++ b/pc/local_audio_source.cc
@@ -19,9 +19,9 @@
 
 namespace webrtc {
 
-rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create(
+scoped_refptr<LocalAudioSource> LocalAudioSource::Create(
     const AudioOptions* audio_options) {
-  auto source = rtc::make_ref_counted<LocalAudioSource>();
+  auto source = make_ref_counted<LocalAudioSource>();
   source->Initialize(audio_options);
   return source;
 }
diff --git a/pc/local_audio_source.h b/pc/local_audio_source.h
index 22ee69e..84f1207 100644
--- a/pc/local_audio_source.h
+++ b/pc/local_audio_source.h
@@ -24,7 +24,7 @@
 class LocalAudioSource : public Notifier<AudioSourceInterface> {
  public:
   // Creates an instance of LocalAudioSource.
-  static rtc::scoped_refptr<LocalAudioSource> Create(
+  static scoped_refptr<LocalAudioSource> Create(
       const AudioOptions* audio_options);
 
   SourceState state() const override { return kLive; }
diff --git a/pc/local_audio_source_unittest.cc b/pc/local_audio_source_unittest.cc
index ff78664..7d0c38b 100644
--- a/pc/local_audio_source_unittest.cc
+++ b/pc/local_audio_source_unittest.cc
@@ -21,13 +21,13 @@
 TEST(LocalAudioSourceTest, InitWithAudioOptions) {
   webrtc::AudioOptions audio_options;
   audio_options.highpass_filter = true;
-  rtc::scoped_refptr<LocalAudioSource> source =
+  webrtc::scoped_refptr<LocalAudioSource> source =
       LocalAudioSource::Create(&audio_options);
   EXPECT_EQ(true, source->options().highpass_filter);
 }
 
 TEST(LocalAudioSourceTest, InitWithNoOptions) {
-  rtc::scoped_refptr<LocalAudioSource> source =
+  webrtc::scoped_refptr<LocalAudioSource> source =
       LocalAudioSource::Create(nullptr);
   EXPECT_EQ(std::nullopt, source->options().highpass_filter);
 }
diff --git a/pc/media_options.cc b/pc/media_options.cc
index 330d1fc..56afb8c 100644
--- a/pc/media_options.cc
+++ b/pc/media_options.cc
@@ -25,14 +25,12 @@
 // note: function duplicated in media_session.cc
 bool ValidateSimulcastLayers(const std::vector<RidDescription>& rids,
                              const SimulcastLayerList& simulcast_layers) {
-  return absl::c_all_of(simulcast_layers.GetAllLayers(),
-                        [&rids](const cricket::SimulcastLayer& layer) {
-                          return absl::c_any_of(
-                              rids,
-                              [&layer](const cricket::RidDescription& rid) {
-                                return rid.rid == layer.rid;
-                              });
-                        });
+  return absl::c_all_of(
+      simulcast_layers.GetAllLayers(), [&rids](const SimulcastLayer& layer) {
+        return absl::c_any_of(rids, [&layer](const RidDescription& rid) {
+          return rid.rid == layer.rid;
+        });
+      });
 }
 
 }  // namespace
diff --git a/pc/media_session.cc b/pc/media_session.cc
index 06f4be5..afff03a 100644
--- a/pc/media_session.cc
+++ b/pc/media_session.cc
@@ -54,10 +54,10 @@
 
 namespace {
 
-using rtc::UniqueRandomIdGenerator;
 using webrtc::RTCError;
 using webrtc::RTCErrorType;
 using webrtc::RtpTransceiverDirection;
+using webrtc::UniqueRandomIdGenerator;
 
 webrtc::RtpExtension RtpExtensionFromCapability(
     const webrtc::RtpHeaderExtensionCapability& capability) {
@@ -66,9 +66,9 @@
                               capability.preferred_encrypt);
 }
 
-cricket::RtpHeaderExtensions RtpHeaderExtensionsFromCapabilities(
+webrtc::RtpHeaderExtensions RtpHeaderExtensionsFromCapabilities(
     const std::vector<webrtc::RtpHeaderExtensionCapability>& capabilities) {
-  cricket::RtpHeaderExtensions exts;
+  webrtc::RtpHeaderExtensions exts;
   for (const auto& capability : capabilities) {
     exts.push_back(RtpExtensionFromCapability(capability));
   }
@@ -89,17 +89,17 @@
 }
 
 bool IsCapabilityPresent(const webrtc::RtpHeaderExtensionCapability& capability,
-                         const cricket::RtpHeaderExtensions& extensions) {
+                         const webrtc::RtpHeaderExtensions& extensions) {
   return std::find_if(extensions.begin(), extensions.end(),
                       [&capability](const webrtc::RtpExtension& extension) {
                         return capability.uri == extension.uri;
                       }) != extensions.end();
 }
 
-cricket::RtpHeaderExtensions UnstoppedOrPresentRtpHeaderExtensions(
+webrtc::RtpHeaderExtensions UnstoppedOrPresentRtpHeaderExtensions(
     const std::vector<webrtc::RtpHeaderExtensionCapability>& capabilities,
-    const cricket::RtpHeaderExtensions& all_encountered_extensions) {
-  cricket::RtpHeaderExtensions extensions;
+    const webrtc::RtpHeaderExtensions& all_encountered_extensions) {
+  webrtc::RtpHeaderExtensions extensions;
   for (const auto& capability : capabilities) {
     if (capability.direction != RtpTransceiverDirection::kStopped ||
         IsCapabilityPresent(capability, all_encountered_extensions)) {
@@ -151,12 +151,11 @@
 }
 
 // Finds all StreamParams of all media types and attach them to stream_params.
-cricket::StreamParamsVec GetCurrentStreamParams(
+StreamParamsVec GetCurrentStreamParams(
     const std::vector<const ContentInfo*>& active_local_contents) {
-  cricket::StreamParamsVec stream_params;
-  for (const cricket::ContentInfo* content : active_local_contents) {
-    for (const cricket::StreamParams& params :
-         content->media_description()->streams()) {
+  StreamParamsVec stream_params;
+  for (const ContentInfo* content : active_local_contents) {
+    for (const StreamParams& params : content->media_description()->streams()) {
       stream_params.push_back(params);
     }
   }
@@ -198,14 +197,12 @@
 
 bool ValidateSimulcastLayers(const std::vector<RidDescription>& rids,
                              const SimulcastLayerList& simulcast_layers) {
-  return absl::c_all_of(simulcast_layers.GetAllLayers(),
-                        [&rids](const cricket::SimulcastLayer& layer) {
-                          return absl::c_any_of(
-                              rids,
-                              [&layer](const cricket::RidDescription& rid) {
-                                return rid.rid == layer.rid;
-                              });
-                        });
+  return absl::c_all_of(
+      simulcast_layers.GetAllLayers(), [&rids](const SimulcastLayer& layer) {
+        return absl::c_any_of(rids, [&layer](const RidDescription& rid) {
+          return rid.rid == layer.rid;
+        });
+      });
 }
 
 StreamParams CreateStreamParamsForNewSenderWithRids(
@@ -266,7 +263,7 @@
 bool AddStreamParams(const std::vector<SenderOptions>& sender_options,
                      const std::string& rtcp_cname,
                      UniqueRandomIdGenerator* ssrc_generator,
-                     cricket::StreamParamsVec* current_streams,
+                     StreamParamsVec* current_streams,
                      MediaContentDescription* content_description,
                      const FieldTrialsView& field_trials) {
   // SCTP streams are not negotiated using SDP/ContentDescriptions.
@@ -280,7 +277,7 @@
   const bool include_flexfec_stream =
       ContainsFlexfecCodec(content_description->codecs());
 
-  for (const cricket::SenderOptions& sender : sender_options) {
+  for (const SenderOptions& sender : sender_options) {
     StreamParams* param = GetStreamByIds(*current_streams, sender.track_id);
     if (!param) {
       // This is a new sender.
@@ -337,7 +334,7 @@
       selected_transport_info->description.ice_pwd;
   ConnectionRole selected_connection_role =
       selected_transport_info->description.connection_role;
-  for (cricket::TransportInfo& transport_info : sdesc->transport_infos()) {
+  for (TransportInfo& transport_info : sdesc->transport_infos()) {
     if (bundle_group.HasContentName(transport_info.content_name) &&
         transport_info.content_name != selected_content_name) {
       transport_info.description.ice_ufrag = selected_ufrag;
@@ -374,16 +371,16 @@
 RTCError CreateContentOffer(
     const MediaDescriptionOptions& media_description_options,
     const MediaSessionOptions& session_options,
-    const cricket::RtpHeaderExtensions& rtp_extensions,
+    const RtpHeaderExtensions& rtp_extensions,
     UniqueRandomIdGenerator* ssrc_generator,
-    cricket::StreamParamsVec* current_streams,
+    StreamParamsVec* current_streams,
     MediaContentDescription* offer) {
   offer->set_rtcp_mux(session_options.rtcp_mux_enabled);
   offer->set_rtcp_reduced_size(true);
 
   // Build the vector of header extensions with directions for this
   // media_description's options.
-  cricket::RtpHeaderExtensions extensions;
+  RtpHeaderExtensions extensions;
   for (const auto& extension_with_id : rtp_extensions) {
     for (const auto& extension : media_description_options.header_extensions) {
       if (extension_with_id.uri == extension.uri &&
@@ -408,9 +405,9 @@
     const MediaDescriptionOptions& media_description_options,
     const MediaSessionOptions& session_options,
     const std::vector<Codec>& codecs,
-    const cricket::RtpHeaderExtensions& rtp_extensions,
+    const RtpHeaderExtensions& rtp_extensions,
     UniqueRandomIdGenerator* ssrc_generator,
-    cricket::StreamParamsVec* current_streams,
+    StreamParamsVec* current_streams,
     MediaContentDescription* offer,
     const FieldTrialsView& field_trials) {
   offer->AddCodecs(codecs);
@@ -433,10 +430,10 @@
 // for that extension. `offered_extensions` is for either audio or video while
 // `all_encountered_extensions` is used for both audio and video. There could be
 // overlap between audio extensions and video extensions.
-void MergeRtpHdrExts(const cricket::RtpHeaderExtensions& reference_extensions,
+void MergeRtpHdrExts(const RtpHeaderExtensions& reference_extensions,
                      bool enable_encrypted_rtp_header_extensions,
-                     cricket::RtpHeaderExtensions* offered_extensions,
-                     cricket::RtpHeaderExtensions* all_encountered_extensions,
+                     RtpHeaderExtensions* offered_extensions,
+                     RtpHeaderExtensions* all_encountered_extensions,
                      UsedRtpHeaderExtensionIds* used_ids) {
   for (auto reference_extension : reference_extensions) {
     if (!RtpExtension::FindHeaderExtensionByUriAndEncryption(
@@ -489,11 +486,10 @@
   return RtpExtension::FindHeaderExtensionByUri(extensions, uri, filter);
 }
 
-void NegotiateRtpHeaderExtensions(
-    const cricket::RtpHeaderExtensions& local_extensions,
-    const cricket::RtpHeaderExtensions& offered_extensions,
-    RtpExtension::Filter filter,
-    cricket::RtpHeaderExtensions* negotiated_extensions) {
+void NegotiateRtpHeaderExtensions(const RtpHeaderExtensions& local_extensions,
+                                  const RtpHeaderExtensions& offered_extensions,
+                                  RtpExtension::Filter filter,
+                                  RtpHeaderExtensions* negotiated_extensions) {
   bool frame_descriptor_in_local = false;
   bool dependency_descriptor_in_local = false;
   bool abs_capture_time_in_local = false;
@@ -547,7 +543,7 @@
                        const MediaDescriptionOptions& media_description_options,
                        const MediaSessionOptions& session_options,
                        UniqueRandomIdGenerator* ssrc_generator,
-                       cricket::StreamParamsVec* current_streams,
+                       StreamParamsVec* current_streams,
                        MediaContentDescription* answer,
                        const FieldTrialsView& field_trials) {
   RTC_DCHECK(offer->type() == webrtc::MediaType::AUDIO ||
@@ -573,10 +569,10 @@
     const MediaContentDescription* offer,
     const MediaDescriptionOptions& media_description_options,
     const MediaSessionOptions& session_options,
-    const cricket::RtpHeaderExtensions& local_rtp_extensions,
+    const RtpHeaderExtensions& local_rtp_extensions,
     UniqueRandomIdGenerator* ssrc_generator,
     bool enable_encrypted_rtp_header_extensions,
-    cricket::StreamParamsVec* current_streams,
+    StreamParamsVec* current_streams,
     bool bundle_enabled,
     MediaContentDescription* answer) {
   answer->set_extmap_allow_mixed_enum(offer->extmap_allow_mixed_enum());
@@ -586,7 +582,7 @@
           : RtpExtension::Filter::kDiscardEncryptedExtension;
 
   // Filter local extensions by capabilities and direction.
-  cricket::RtpHeaderExtensions local_rtp_extensions_to_reply_with;
+  RtpHeaderExtensions local_rtp_extensions_to_reply_with;
   for (const auto& extension_with_id : local_rtp_extensions) {
     for (const auto& extension : media_description_options.header_extensions) {
       if (extension_with_id.uri == extension.uri &&
@@ -601,7 +597,7 @@
       }
     }
   }
-  cricket::RtpHeaderExtensions negotiated_rtp_extensions;
+  RtpHeaderExtensions negotiated_rtp_extensions;
   NegotiateRtpHeaderExtensions(local_rtp_extensions_to_reply_with,
                                offer->rtp_header_extensions(),
                                extensions_filter, &negotiated_rtp_extensions);
@@ -689,9 +685,9 @@
   RTC_CHECK(codec_lookup_helper_);
 }
 
-cricket::RtpHeaderExtensions
+RtpHeaderExtensions
 MediaSessionDescriptionFactory::filtered_rtp_header_extensions(
-    cricket::RtpHeaderExtensions extensions) const {
+    RtpHeaderExtensions extensions) const {
   if (!is_unified_plan_) {
     // Remove extensions only supported with unified-plan.
     extensions.erase(
@@ -725,7 +721,7 @@
         GetActiveContents(*current_description, session_options);
   }
 
-  cricket::StreamParamsVec current_streams =
+  StreamParamsVec current_streams =
       GetCurrentStreamParams(current_active_contents);
 
   AudioVideoRtpHeaderExtensions extensions_with_ids =
@@ -738,7 +734,7 @@
   // Iterate through the media description options, matching with existing media
   // descriptions in `current_description`.
   size_t msection_index = 0;
-  for (const cricket::MediaDescriptionOptions& media_description_options :
+  for (const MediaDescriptionOptions& media_description_options :
        session_options.media_description_options) {
     const ContentInfo* current_content = nullptr;
     if (current_description &&
@@ -782,7 +778,7 @@
   // parameters that need to be tweaked for BUNDLE.
   if (session_options.bundle_enabled) {
     ContentGroup offer_bundle(GROUP_TYPE_BUNDLE);
-    for (const cricket::ContentInfo& content : offer->contents()) {
+    for (const ContentInfo& content : offer->contents()) {
       if (content.rejected) {
         continue;
       }
@@ -845,7 +841,7 @@
         GetActiveContents(*current_description, session_options);
   }
 
-  cricket::StreamParamsVec current_streams =
+  StreamParamsVec current_streams =
       GetCurrentStreamParams(current_active_contents);
 
   // Decide what congestion control feedback format we're using.
@@ -887,7 +883,7 @@
   // Iterate through the media description options, matching with existing
   // media descriptions in `current_description`.
   size_t msection_index = 0;
-  for (const cricket::MediaDescriptionOptions& media_description_options :
+  for (const MediaDescriptionOptions& media_description_options :
        session_options.media_description_options) {
     const ContentInfo* offer_content = &offer->contents()[msection_index];
     // Media types and MIDs must match between the remote offer and the
@@ -921,9 +917,8 @@
         }
       }
     }
-    cricket::RtpHeaderExtensions header_extensions =
-        RtpHeaderExtensionsFromCapabilities(
-            UnstoppedRtpHeaderExtensionCapabilities(header_extensions_in));
+    RtpHeaderExtensions header_extensions = RtpHeaderExtensionsFromCapabilities(
+        UnstoppedRtpHeaderExtensionCapabilities(header_extensions_in));
     RTCError error;
     switch (media_description_options.type) {
       case webrtc::MediaType::AUDIO:
@@ -973,7 +968,7 @@
   //   with semantics that are understood MUST return an answer that
   //   contains an "a=group" line with the same semantics.
   if (!offer_bundles.empty()) {
-    for (const cricket::ContentGroup& answer_bundle : answer_bundles) {
+    for (const ContentGroup& answer_bundle : answer_bundles) {
       answer->AddGroup(answer_bundle);
 
       if (answer_bundle.FirstContentName()) {
@@ -1049,14 +1044,14 @@
       extmap_allow_mixed ? UsedRtpHeaderExtensionIds::IdDomain::kTwoByteAllowed
                          : UsedRtpHeaderExtensionIds::IdDomain::kOneByteOnly);
 
-  cricket::RtpHeaderExtensions all_encountered_extensions;
+  RtpHeaderExtensions all_encountered_extensions;
 
   AudioVideoRtpHeaderExtensions offered_extensions;
   // First - get all extensions from the current description if the media type
   // is used.
   // Add them to `used_ids` so the local ids are not reused if a new media
   // type is added.
-  for (const cricket::ContentInfo* content : current_active_contents) {
+  for (const ContentInfo* content : current_active_contents) {
     if (IsMediaContentOfType(content, webrtc::MediaType::AUDIO)) {
       MergeRtpHdrExts(content->media_description()->rtp_header_extensions(),
                       enable_encrypted_rtp_header_extensions_,
@@ -1074,7 +1069,7 @@
   // are not in the current description.
 
   for (const auto& entry : media_description_options) {
-    cricket::RtpHeaderExtensions filtered_extensions =
+    RtpHeaderExtensions filtered_extensions =
         filtered_rtp_header_extensions(UnstoppedOrPresentRtpHeaderExtensions(
             entry.header_extensions, all_encountered_extensions));
     if (entry.type == webrtc::MediaType::AUDIO)
@@ -1155,8 +1150,8 @@
     const MediaSessionOptions& session_options,
     const ContentInfo* current_content,
     const SessionDescription* current_description,
-    const cricket::RtpHeaderExtensions& header_extensions,
-    cricket::StreamParamsVec* current_streams,
+    const RtpHeaderExtensions& header_extensions,
+    StreamParamsVec* current_streams,
     SessionDescription* session_description,
     IceCredentialsIterator* ice_credentials) const {
   RTC_DCHECK(media_description_options.type == webrtc::MediaType::AUDIO ||
@@ -1212,7 +1207,7 @@
     const MediaSessionOptions& session_options,
     const ContentInfo* current_content,
     const SessionDescription* current_description,
-    cricket::StreamParamsVec* current_streams,
+    StreamParamsVec* current_streams,
     SessionDescription* desc,
     IceCredentialsIterator* ice_credentials) const {
   auto data = std::make_unique<SctpDataContentDescription>();
@@ -1229,10 +1224,9 @@
   data->set_use_sctpmap(session_options.use_obsolete_sctp_sdp);
   data->set_max_message_size(webrtc::kSctpSendBufferSize);
 
-  auto error =
-      CreateContentOffer(media_description_options, session_options,
-                         cricket::RtpHeaderExtensions(), ssrc_generator(),
-                         current_streams, data.get());
+  auto error = CreateContentOffer(media_description_options, session_options,
+                                  RtpHeaderExtensions(), ssrc_generator(),
+                                  current_streams, data.get());
   if (!error.ok()) {
     return error;
   }
@@ -1287,8 +1281,8 @@
     const ContentInfo* current_content,
     const SessionDescription* current_description,
     const TransportInfo* bundle_transport,
-    const cricket::RtpHeaderExtensions& header_extensions,
-    cricket::StreamParamsVec* current_streams,
+    const RtpHeaderExtensions& header_extensions,
+    StreamParamsVec* current_streams,
     SessionDescription* answer,
     IceCredentialsIterator* ice_credentials) const {
   RTC_DCHECK(media_description_options.type == webrtc::MediaType::AUDIO ||
@@ -1405,7 +1399,7 @@
     const ContentInfo* current_content,
     const SessionDescription* current_description,
     const TransportInfo* bundle_transport,
-    cricket::StreamParamsVec* current_streams,
+    StreamParamsVec* current_streams,
     SessionDescription* answer,
     IceCredentialsIterator* ice_credentials) const {
   std::unique_ptr<TransportDescription> data_transport = CreateTransportAnswer(
@@ -1443,7 +1437,7 @@
     }
     if (!CreateMediaContentAnswer(
             offer_data_description, media_description_options, session_options,
-            cricket::RtpHeaderExtensions(), ssrc_generator(),
+            RtpHeaderExtensions(), ssrc_generator(),
             enable_encrypted_rtp_header_extensions_, current_streams,
             bundle_enabled, data_answer.get())) {
       LOG_AND_RETURN_ERROR(RTCErrorType::INTERNAL_ERROR,
@@ -1536,9 +1530,9 @@
   return IsMediaContentOfType(content, webrtc::MediaType::UNSUPPORTED);
 }
 
-const ContentInfo* GetFirstMediaContent(const cricket::ContentInfos& contents,
+const ContentInfo* GetFirstMediaContent(const ContentInfos& contents,
                                         webrtc::MediaType media_type) {
-  for (const cricket::ContentInfo& content : contents) {
+  for (const ContentInfo& content : contents) {
     if (IsMediaContentOfType(&content, media_type)) {
       return &content;
     }
@@ -1546,15 +1540,15 @@
   return nullptr;
 }
 
-const ContentInfo* GetFirstAudioContent(const cricket::ContentInfos& contents) {
+const ContentInfo* GetFirstAudioContent(const ContentInfos& contents) {
   return GetFirstMediaContent(contents, webrtc::MediaType::AUDIO);
 }
 
-const ContentInfo* GetFirstVideoContent(const cricket::ContentInfos& contents) {
+const ContentInfo* GetFirstVideoContent(const ContentInfos& contents) {
   return GetFirstMediaContent(contents, webrtc::MediaType::VIDEO);
 }
 
-const ContentInfo* GetFirstDataContent(const cricket::ContentInfos& contents) {
+const ContentInfo* GetFirstDataContent(const ContentInfos& contents) {
   return GetFirstMediaContent(contents, webrtc::MediaType::DATA);
 }
 
@@ -1608,9 +1602,9 @@
 // Non-const versions of the above functions.
 //
 
-ContentInfo* GetFirstMediaContent(cricket::ContentInfos* contents,
+ContentInfo* GetFirstMediaContent(ContentInfos* contents,
                                   webrtc::MediaType media_type) {
-  for (cricket::ContentInfo& content : *contents) {
+  for (ContentInfo& content : *contents) {
     if (IsMediaContentOfType(&content, media_type)) {
       return &content;
     }
@@ -1618,15 +1612,15 @@
   return nullptr;
 }
 
-ContentInfo* GetFirstAudioContent(cricket::ContentInfos* contents) {
+ContentInfo* GetFirstAudioContent(ContentInfos* contents) {
   return GetFirstMediaContent(contents, webrtc::MediaType::AUDIO);
 }
 
-ContentInfo* GetFirstVideoContent(cricket::ContentInfos* contents) {
+ContentInfo* GetFirstVideoContent(ContentInfos* contents) {
   return GetFirstMediaContent(contents, webrtc::MediaType::VIDEO);
 }
 
-ContentInfo* GetFirstDataContent(cricket::ContentInfos* contents) {
+ContentInfo* GetFirstDataContent(ContentInfos* contents) {
   return GetFirstMediaContent(contents, webrtc::MediaType::DATA);
 }
 
diff --git a/pc/media_session.h b/pc/media_session.h
index 40f966e..4257bfb 100644
--- a/pc/media_session.h
+++ b/pc/media_session.h
@@ -57,8 +57,8 @@
                                  const TransportDescriptionFactory* factory,
                                  CodecLookupHelper* codec_lookup_helper);
 
-  cricket::RtpHeaderExtensions filtered_rtp_header_extensions(
-      cricket::RtpHeaderExtensions extensions) const;
+  RtpHeaderExtensions filtered_rtp_header_extensions(
+      RtpHeaderExtensions extensions) const;
 
   void set_enable_encrypted_rtp_header_extensions(bool enable) {
     enable_encrypted_rtp_header_extensions_ = enable;
@@ -78,8 +78,8 @@
 
  private:
   struct AudioVideoRtpHeaderExtensions {
-    cricket::RtpHeaderExtensions audio;
-    cricket::RtpHeaderExtensions video;
+    RtpHeaderExtensions audio;
+    RtpHeaderExtensions video;
   };
 
   AudioVideoRtpHeaderExtensions GetOfferedRtpHeaderExtensionsWithIds(
@@ -111,8 +111,8 @@
       const MediaSessionOptions& session_options,
       const ContentInfo* current_content,
       const SessionDescription* current_description,
-      const cricket::RtpHeaderExtensions& header_extensions,
-      cricket::StreamParamsVec* current_streams,
+      const RtpHeaderExtensions& header_extensions,
+      StreamParamsVec* current_streams,
       SessionDescription* desc,
       IceCredentialsIterator* ice_credentials) const;
 
@@ -121,7 +121,7 @@
       const MediaSessionOptions& session_options,
       const ContentInfo* current_content,
       const SessionDescription* current_description,
-      cricket::StreamParamsVec* current_streams,
+      StreamParamsVec* current_streams,
       SessionDescription* desc,
       IceCredentialsIterator* ice_credentials) const;
 
@@ -141,8 +141,8 @@
       const ContentInfo* current_content,
       const SessionDescription* current_description,
       const TransportInfo* bundle_transport,
-      const cricket::RtpHeaderExtensions& header_extensions,
-      cricket::StreamParamsVec* current_streams,
+      const RtpHeaderExtensions& header_extensions,
+      StreamParamsVec* current_streams,
       SessionDescription* answer,
       IceCredentialsIterator* ice_credentials) const;
 
@@ -154,7 +154,7 @@
       const ContentInfo* current_content,
       const SessionDescription* current_description,
       const TransportInfo* bundle_transport,
-      cricket::StreamParamsVec* current_streams,
+      StreamParamsVec* current_streams,
       SessionDescription* answer,
       IceCredentialsIterator* ice_credentials) const;
 
@@ -188,11 +188,11 @@
 bool IsVideoContent(const ContentInfo* content);
 bool IsDataContent(const ContentInfo* content);
 bool IsUnsupportedContent(const ContentInfo* content);
-const ContentInfo* GetFirstMediaContent(const cricket::ContentInfos& contents,
+const ContentInfo* GetFirstMediaContent(const ContentInfos& contents,
                                         webrtc::MediaType media_type);
-const ContentInfo* GetFirstAudioContent(const cricket::ContentInfos& contents);
-const ContentInfo* GetFirstVideoContent(const cricket::ContentInfos& contents);
-const ContentInfo* GetFirstDataContent(const cricket::ContentInfos& contents);
+const ContentInfo* GetFirstAudioContent(const ContentInfos& contents);
+const ContentInfo* GetFirstVideoContent(const ContentInfos& contents);
+const ContentInfo* GetFirstDataContent(const ContentInfos& contents);
 const ContentInfo* GetFirstMediaContent(const SessionDescription* sdesc,
                                         webrtc::MediaType media_type);
 const ContentInfo* GetFirstAudioContent(const SessionDescription* sdesc);
@@ -206,11 +206,11 @@
     const SessionDescription* sdesc);
 // Non-const versions of the above functions.
 // Useful when modifying an existing description.
-ContentInfo* GetFirstMediaContent(cricket::ContentInfos* contents,
+ContentInfo* GetFirstMediaContent(ContentInfos* contents,
                                   webrtc::MediaType media_type);
-ContentInfo* GetFirstAudioContent(cricket::ContentInfos* contents);
-ContentInfo* GetFirstVideoContent(cricket::ContentInfos* contents);
-ContentInfo* GetFirstDataContent(cricket::ContentInfos* contents);
+ContentInfo* GetFirstAudioContent(ContentInfos* contents);
+ContentInfo* GetFirstVideoContent(ContentInfos* contents);
+ContentInfo* GetFirstDataContent(ContentInfos* contents);
 ContentInfo* GetFirstMediaContent(SessionDescription* sdesc,
                                   webrtc::MediaType media_type);
 ContentInfo* GetFirstAudioContent(SessionDescription* sdesc);
diff --git a/pc/media_session_unittest.cc b/pc/media_session_unittest.cc
index eef2044..ea8c045 100644
--- a/pc/media_session_unittest.cc
+++ b/pc/media_session_unittest.cc
@@ -66,7 +66,6 @@
 namespace webrtc {
 namespace {
 
-using ::rtc::UniqueRandomIdGenerator;
 using ::testing::Bool;
 using ::testing::Combine;
 using ::testing::Contains;
@@ -82,6 +81,7 @@
 using ::testing::UnorderedElementsAreArray;
 using ::testing::Values;
 using ::testing::ValuesIn;
+using ::webrtc::UniqueRandomIdGenerator;
 using ::webrtc::test::ScopedKeyValueConfig;
 
 using Candidates = std::vector<Candidate>;
@@ -189,8 +189,8 @@
 const Codec kVideoCodecsH265Level6[] = {
     CreateVideoCodec(96, kH265MainProfileLevel6Sdp)};
 // Match two codec lists for content, but ignore the ID.
-bool CodecListsMatch(rtc::ArrayView<const Codec> list1,
-                     rtc::ArrayView<const Codec> list2) {
+bool CodecListsMatch(ArrayView<const Codec> list1,
+                     ArrayView<const Codec> list2) {
   if (list1.size() != list2.size()) {
     return false;
   }
@@ -428,19 +428,17 @@
 std::vector<MediaDescriptionOptions>::iterator FindFirstMediaDescriptionByMid(
     const std::string& mid,
     MediaSessionOptions* opts) {
-  return absl::c_find_if(opts->media_description_options,
-                         [&mid](const cricket::MediaDescriptionOptions& t) {
-                           return t.mid == mid;
-                         });
+  return absl::c_find_if(
+      opts->media_description_options,
+      [&mid](const MediaDescriptionOptions& t) { return t.mid == mid; });
 }
 
 std::vector<MediaDescriptionOptions>::const_iterator
 FindFirstMediaDescriptionByMid(const std::string& mid,
                                const MediaSessionOptions& opts) {
-  return absl::c_find_if(opts.media_description_options,
-                         [&mid](const cricket::MediaDescriptionOptions& t) {
-                           return t.mid == mid;
-                         });
+  return absl::c_find_if(
+      opts.media_description_options,
+      [&mid](const MediaDescriptionOptions& t) { return t.mid == mid; });
 }
 
 // Add a media section to the `session_options`.
@@ -507,11 +505,10 @@
                                   MediaSessionOptions* session_options) {
   std::vector<SenderOptions>& sender_options_list =
       FindFirstMediaDescriptionByMid(mid, session_options)->sender_options;
-  auto sender_it =
-      absl::c_find_if(sender_options_list,
-                      [track_id](const cricket::SenderOptions& sender_options) {
-                        return sender_options.track_id == track_id;
-                      });
+  auto sender_it = absl::c_find_if(
+      sender_options_list, [track_id](const SenderOptions& sender_options) {
+        return sender_options.track_id == track_id;
+      });
   RTC_DCHECK(sender_it != sender_options_list.end());
   sender_options_list.erase(sender_it);
 }
@@ -554,7 +551,7 @@
 
   // Create a video StreamParamsVec object with:
   // - one video stream with 3 simulcast streams and FEC,
-  cricket::StreamParamsVec CreateComplexVideoStreamParamsVec() {
+  StreamParamsVec CreateComplexVideoStreamParamsVec() {
     SsrcGroup sim_group("SIM", MAKE_VECTOR(kSimSsrc));
     SsrcGroup fec_group1("FEC", MAKE_VECTOR(kFec1Ssrc));
     SsrcGroup fec_group2("FEC", MAKE_VECTOR(kFec2Ssrc));
@@ -573,7 +570,7 @@
     simulcast_params.cname = "Video_SIM_FEC";
     simulcast_params.set_stream_ids({kMediaStream1});
 
-    cricket::StreamParamsVec video_streams;
+    StreamParamsVec video_streams;
     video_streams.push_back(simulcast_params);
 
     return video_streams;
@@ -724,9 +721,9 @@
   }
 
   void TestTransportSequenceNumberNegotiation(
-      const cricket::RtpHeaderExtensions& local,
-      const cricket::RtpHeaderExtensions& offered,
-      const cricket::RtpHeaderExtensions& expectedAnswer) {
+      const RtpHeaderExtensions& local,
+      const RtpHeaderExtensions& offered,
+      const RtpHeaderExtensions& expectedAnswer) {
     MediaSessionOptions opts;
     AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts);
     SetAudioVideoRtpHeaderExtensions(offered, offered, &opts);
@@ -748,8 +745,7 @@
   }
 
   std::vector<RtpHeaderExtensionCapability>
-  HeaderExtensionCapabilitiesFromRtpExtensions(
-      cricket::RtpHeaderExtensions extensions) {
+  HeaderExtensionCapabilitiesFromRtpExtensions(RtpHeaderExtensions extensions) {
     std::vector<RtpHeaderExtensionCapability> capabilities;
     for (const auto& extension : extensions) {
       RtpHeaderExtensionCapability capability(
@@ -760,8 +756,8 @@
     return capabilities;
   }
 
-  void SetAudioVideoRtpHeaderExtensions(cricket::RtpHeaderExtensions audio_exts,
-                                        cricket::RtpHeaderExtensions video_exts,
+  void SetAudioVideoRtpHeaderExtensions(RtpHeaderExtensions audio_exts,
+                                        RtpHeaderExtensions video_exts,
                                         MediaSessionOptions* opts) {
     std::vector<RtpHeaderExtensionCapability> audio_caps =
         HeaderExtensionCapabilitiesFromRtpExtensions(audio_exts);
@@ -1931,9 +1927,9 @@
   MediaSessionOptions opts;
   AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts);
 
-  const cricket::RtpHeaderExtensions offered_extensions = {
+  const RtpHeaderExtensions offered_extensions = {
       RtpExtension(RtpExtension::kAbsoluteCaptureTimeUri, 7)};
-  const cricket::RtpHeaderExtensions local_extensions = {
+  const RtpHeaderExtensions local_extensions = {
       RtpExtension(RtpExtension::kTransportSequenceNumberUri, 5)};
   SetAudioVideoRtpHeaderExtensions(offered_extensions, offered_extensions,
                                    &opts);
@@ -1955,9 +1951,9 @@
   MediaSessionOptions opts;
   AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts);
 
-  const cricket::RtpHeaderExtensions offered_extensions = {
+  const RtpHeaderExtensions offered_extensions = {
       RtpExtension(RtpExtension::kAbsoluteCaptureTimeUri, 7)};
-  const cricket::RtpHeaderExtensions local_extensions = {
+  const RtpHeaderExtensions local_extensions = {
       RtpExtension(RtpExtension::kAbsoluteCaptureTimeUri, 5)};
   SetAudioVideoRtpHeaderExtensions(offered_extensions, offered_extensions,
                                    &opts);
@@ -1979,9 +1975,9 @@
   MediaSessionOptions opts;
   AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts);
 
-  const cricket::RtpHeaderExtensions offered_extensions = {
+  const RtpHeaderExtensions offered_extensions = {
       RtpExtension(RtpExtension::kTransportSequenceNumberUri, 7)};
-  const cricket::RtpHeaderExtensions local_extensions = {
+  const RtpHeaderExtensions local_extensions = {
       RtpExtension(RtpExtension::kAbsoluteCaptureTimeUri, 5)};
   SetAudioVideoRtpHeaderExtensions(offered_extensions, offered_extensions,
                                    &opts);
@@ -2687,7 +2683,7 @@
       codec_lookup_helper_1_.CodecVendor("")->audio_sendrecv_codecs().codecs(),
       acd->codecs());
 
-  const cricket::StreamParamsVec& audio_streams = acd->streams();
+  const StreamParamsVec& audio_streams = acd->streams();
   ASSERT_EQ(2U, audio_streams.size());
   EXPECT_EQ(audio_streams[0].cname, audio_streams[1].cname);
   EXPECT_EQ(kAudioTrack1, audio_streams[0].id);
@@ -2706,7 +2702,7 @@
       codec_lookup_helper_1_.CodecVendor("")->video_sendrecv_codecs().codecs(),
       vcd->codecs());
 
-  const cricket::StreamParamsVec& video_streams = vcd->streams();
+  const StreamParamsVec& video_streams = vcd->streams();
   ASSERT_EQ(1U, video_streams.size());
   EXPECT_EQ(video_streams[0].cname, audio_streams[0].cname);
   EXPECT_EQ(kVideoTrack1, video_streams[0].id);
@@ -2739,8 +2735,7 @@
   EXPECT_EQ(vcd->type(), updated_vcd->type());
   EXPECT_EQ(vcd->codecs(), updated_vcd->codecs());
 
-  const cricket::StreamParamsVec& updated_audio_streams =
-      updated_acd->streams();
+  const StreamParamsVec& updated_audio_streams = updated_acd->streams();
   ASSERT_EQ(2U, updated_audio_streams.size());
   EXPECT_EQ(audio_streams[0], updated_audio_streams[0]);
   EXPECT_EQ(kAudioTrack3, updated_audio_streams[1].id);  // New audio track.
@@ -2748,8 +2743,7 @@
   EXPECT_NE(0U, updated_audio_streams[1].ssrcs[0]);
   EXPECT_EQ(updated_audio_streams[0].cname, updated_audio_streams[1].cname);
 
-  const cricket::StreamParamsVec& updated_video_streams =
-      updated_vcd->streams();
+  const StreamParamsVec& updated_video_streams = updated_vcd->streams();
   ASSERT_EQ(2U, updated_video_streams.size());
   EXPECT_EQ(video_streams[0], updated_video_streams[0]);
   EXPECT_EQ(kVideoTrack2, updated_video_streams[1].id);
@@ -2778,7 +2772,7 @@
   ASSERT_TRUE(vc);
   const MediaContentDescription* vcd = vc->media_description();
 
-  const cricket::StreamParamsVec& video_streams = vcd->streams();
+  const StreamParamsVec& video_streams = vcd->streams();
   ASSERT_EQ(1U, video_streams.size());
   EXPECT_EQ(kVideoTrack1, video_streams[0].id);
   const SsrcGroup* sim_ssrc_group =
@@ -2803,7 +2797,7 @@
   ASSERT_NE(content, nullptr);
   const MediaContentDescription* cd = content->media_description();
   ASSERT_NE(cd, nullptr);
-  const cricket::StreamParamsVec& streams = cd->streams();
+  const StreamParamsVec& streams = cd->streams();
   ASSERT_THAT(streams, SizeIs(1));
   const StreamParams& stream = streams[0];
   ASSERT_THAT(stream.ssrcs, IsEmpty());
@@ -2863,7 +2857,7 @@
   ASSERT_NE(content, nullptr);
   const MediaContentDescription* cd = content->media_description();
   ASSERT_NE(cd, nullptr);
-  const cricket::StreamParamsVec& streams = cd->streams();
+  const StreamParamsVec& streams = cd->streams();
   ASSERT_THAT(streams, SizeIs(1));
   const StreamParams& stream = streams[0];
   ASSERT_THAT(stream.ssrcs, IsEmpty());
@@ -2940,7 +2934,7 @@
   ASSERT_NE(content, nullptr);
   const MediaContentDescription* cd = content->media_description();
   ASSERT_NE(cd, nullptr);
-  const cricket::StreamParamsVec& streams = cd->streams();
+  const StreamParamsVec& streams = cd->streams();
   ASSERT_THAT(streams, SizeIs(1));
   const StreamParams& stream = streams[0];
   ASSERT_THAT(stream.ssrcs, IsEmpty());
@@ -2996,7 +2990,7 @@
   EXPECT_EQ(webrtc::MediaType::AUDIO, acd->type());
   EXPECT_THAT(acd->codecs(), ElementsAreArray(kAudioCodecsAnswer));
 
-  const cricket::StreamParamsVec& audio_streams = acd->streams();
+  const StreamParamsVec& audio_streams = acd->streams();
   ASSERT_EQ(2U, audio_streams.size());
   EXPECT_TRUE(audio_streams[0].cname == audio_streams[1].cname);
   EXPECT_EQ(kAudioTrack1, audio_streams[0].id);
@@ -3013,7 +3007,7 @@
   EXPECT_EQ(webrtc::MediaType::VIDEO, vcd->type());
   EXPECT_THAT(vcd->codecs(), ElementsAreArray(kVideoCodecsAnswer));
 
-  const cricket::StreamParamsVec& video_streams = vcd->streams();
+  const StreamParamsVec& video_streams = vcd->streams();
   ASSERT_EQ(1U, video_streams.size());
   EXPECT_EQ(video_streams[0].cname, audio_streams[0].cname);
   EXPECT_EQ(kVideoTrack1, video_streams[0].id);
@@ -3044,13 +3038,11 @@
   EXPECT_EQ(vcd->type(), updated_vcd->type());
   EXPECT_EQ(vcd->codecs(), updated_vcd->codecs());
 
-  const cricket::StreamParamsVec& updated_audio_streams =
-      updated_acd->streams();
+  const StreamParamsVec& updated_audio_streams = updated_acd->streams();
   ASSERT_EQ(1U, updated_audio_streams.size());
   EXPECT_TRUE(audio_streams[0] == updated_audio_streams[0]);
 
-  const cricket::StreamParamsVec& updated_video_streams =
-      updated_vcd->streams();
+  const StreamParamsVec& updated_video_streams = updated_vcd->streams();
   ASSERT_EQ(2U, updated_video_streams.size());
   EXPECT_EQ(video_streams[0], updated_video_streams[0]);
   EXPECT_EQ(kVideoTrack2, updated_video_streams[1].id);
@@ -3636,7 +3628,7 @@
   MediaContentDescription* media_desc =
       offer->GetContentDescriptionByName(CN_VIDEO);
   ASSERT_TRUE(media_desc);
-  const cricket::StreamParamsVec& streams = media_desc->streams();
+  const StreamParamsVec& streams = media_desc->streams();
   // Single stream.
   ASSERT_EQ(1u, streams.size());
   // Stream should have 6 ssrcs: 3 for video, 3 for RTX.
@@ -3681,7 +3673,7 @@
   MediaContentDescription* media_desc =
       offer->GetContentDescriptionByName(CN_VIDEO);
   ASSERT_TRUE(media_desc);
-  const cricket::StreamParamsVec& streams = media_desc->streams();
+  const StreamParamsVec& streams = media_desc->streams();
   // Single stream.
   ASSERT_EQ(1u, streams.size());
   // Stream should have 2 ssrcs: 1 for video, 1 for FlexFEC.
@@ -3725,7 +3717,7 @@
   MediaContentDescription* media_desc =
       offer->GetContentDescriptionByName(CN_VIDEO);
   ASSERT_TRUE(media_desc);
-  const cricket::StreamParamsVec& streams = media_desc->streams();
+  const StreamParamsVec& streams = media_desc->streams();
   // Single stream.
   ASSERT_EQ(1u, streams.size());
   // Stream should have 3 ssrcs: 3 for video, 0 for FlexFEC.
diff --git a/pc/media_stream.cc b/pc/media_stream.cc
index b8366af..7c62bff 100644
--- a/pc/media_stream.cc
+++ b/pc/media_stream.cc
@@ -33,29 +33,29 @@
   return it;
 }
 
-rtc::scoped_refptr<MediaStream> MediaStream::Create(const std::string& id) {
-  return rtc::make_ref_counted<MediaStream>(id);
+scoped_refptr<MediaStream> MediaStream::Create(const std::string& id) {
+  return make_ref_counted<MediaStream>(id);
 }
 
 MediaStream::MediaStream(const std::string& id) : id_(id) {}
 
-bool MediaStream::AddTrack(rtc::scoped_refptr<AudioTrackInterface> track) {
+bool MediaStream::AddTrack(scoped_refptr<AudioTrackInterface> track) {
   return AddTrack<AudioTrackVector, AudioTrackInterface>(&audio_tracks_, track);
 }
 
-bool MediaStream::AddTrack(rtc::scoped_refptr<VideoTrackInterface> track) {
+bool MediaStream::AddTrack(scoped_refptr<VideoTrackInterface> track) {
   return AddTrack<VideoTrackVector, VideoTrackInterface>(&video_tracks_, track);
 }
 
-bool MediaStream::RemoveTrack(rtc::scoped_refptr<AudioTrackInterface> track) {
+bool MediaStream::RemoveTrack(scoped_refptr<AudioTrackInterface> track) {
   return RemoveTrack<AudioTrackVector>(&audio_tracks_, track);
 }
 
-bool MediaStream::RemoveTrack(rtc::scoped_refptr<VideoTrackInterface> track) {
+bool MediaStream::RemoveTrack(scoped_refptr<VideoTrackInterface> track) {
   return RemoveTrack<VideoTrackVector>(&video_tracks_, track);
 }
 
-rtc::scoped_refptr<AudioTrackInterface> MediaStream::FindAudioTrack(
+scoped_refptr<AudioTrackInterface> MediaStream::FindAudioTrack(
     const std::string& track_id) {
   AudioTrackVector::iterator it = FindTrack(&audio_tracks_, track_id);
   if (it == audio_tracks_.end())
@@ -63,7 +63,7 @@
   return *it;
 }
 
-rtc::scoped_refptr<VideoTrackInterface> MediaStream::FindVideoTrack(
+scoped_refptr<VideoTrackInterface> MediaStream::FindVideoTrack(
     const std::string& track_id) {
   VideoTrackVector::iterator it = FindTrack(&video_tracks_, track_id);
   if (it == video_tracks_.end())
@@ -72,8 +72,7 @@
 }
 
 template <typename TrackVector, typename Track>
-bool MediaStream::AddTrack(TrackVector* tracks,
-                           rtc::scoped_refptr<Track> track) {
+bool MediaStream::AddTrack(TrackVector* tracks, scoped_refptr<Track> track) {
   typename TrackVector::iterator it = FindTrack(tracks, track->id());
   if (it != tracks->end())
     return false;
@@ -83,9 +82,8 @@
 }
 
 template <typename TrackVector>
-bool MediaStream::RemoveTrack(
-    TrackVector* tracks,
-    rtc::scoped_refptr<MediaStreamTrackInterface> track) {
+bool MediaStream::RemoveTrack(TrackVector* tracks,
+                              scoped_refptr<MediaStreamTrackInterface> track) {
   RTC_DCHECK(tracks != NULL);
   if (!track)
     return false;
diff --git a/pc/media_stream.h b/pc/media_stream.h
index c033cf6..108a4b6 100644
--- a/pc/media_stream.h
+++ b/pc/media_stream.h
@@ -23,17 +23,17 @@
 
 class MediaStream : public Notifier<MediaStreamInterface> {
  public:
-  static rtc::scoped_refptr<MediaStream> Create(const std::string& id);
+  static scoped_refptr<MediaStream> Create(const std::string& id);
 
   std::string id() const override { return id_; }
 
-  bool AddTrack(rtc::scoped_refptr<AudioTrackInterface> track) override;
-  bool AddTrack(rtc::scoped_refptr<VideoTrackInterface> track) override;
-  bool RemoveTrack(rtc::scoped_refptr<AudioTrackInterface> track) override;
-  bool RemoveTrack(rtc::scoped_refptr<VideoTrackInterface> track) override;
-  rtc::scoped_refptr<AudioTrackInterface> FindAudioTrack(
+  bool AddTrack(scoped_refptr<AudioTrackInterface> track) override;
+  bool AddTrack(scoped_refptr<VideoTrackInterface> track) override;
+  bool RemoveTrack(scoped_refptr<AudioTrackInterface> track) override;
+  bool RemoveTrack(scoped_refptr<VideoTrackInterface> track) override;
+  scoped_refptr<AudioTrackInterface> FindAudioTrack(
       const std::string& track_id) override;
-  rtc::scoped_refptr<VideoTrackInterface> FindVideoTrack(
+  scoped_refptr<VideoTrackInterface> FindVideoTrack(
       const std::string& track_id) override;
 
   AudioTrackVector GetAudioTracks() override { return audio_tracks_; }
@@ -44,10 +44,10 @@
 
  private:
   template <typename TrackVector, typename Track>
-  bool AddTrack(TrackVector* Tracks, rtc::scoped_refptr<Track> track);
+  bool AddTrack(TrackVector* Tracks, scoped_refptr<Track> track);
   template <typename TrackVector>
   bool RemoveTrack(TrackVector* Tracks,
-                   rtc::scoped_refptr<MediaStreamTrackInterface> track);
+                   scoped_refptr<MediaStreamTrackInterface> track);
 
   const std::string id_;
   AudioTrackVector audio_tracks_;
diff --git a/pc/media_stream_observer.h b/pc/media_stream_observer.h
index 83bbd20..c60f766 100644
--- a/pc/media_stream_observer.h
+++ b/pc/media_stream_observer.h
@@ -39,7 +39,7 @@
   void OnChanged() override;
 
  private:
-  rtc::scoped_refptr<MediaStreamInterface> stream_;
+  scoped_refptr<MediaStreamInterface> stream_;
   AudioTrackVector cached_audio_tracks_;
   VideoTrackVector cached_video_tracks_;
   const std::function<void(AudioTrackInterface*, MediaStreamInterface*)>
diff --git a/pc/media_stream_proxy.h b/pc/media_stream_proxy.h
index 3e263bf..11ea22b 100644
--- a/pc/media_stream_proxy.h
+++ b/pc/media_stream_proxy.h
@@ -25,16 +25,16 @@
 BYPASS_PROXY_CONSTMETHOD0(std::string, id)
 PROXY_METHOD0(AudioTrackVector, GetAudioTracks)
 PROXY_METHOD0(VideoTrackVector, GetVideoTracks)
-PROXY_METHOD1(rtc::scoped_refptr<AudioTrackInterface>,
+PROXY_METHOD1(scoped_refptr<AudioTrackInterface>,
               FindAudioTrack,
               const std::string&)
-PROXY_METHOD1(rtc::scoped_refptr<VideoTrackInterface>,
+PROXY_METHOD1(scoped_refptr<VideoTrackInterface>,
               FindVideoTrack,
               const std::string&)
-PROXY_METHOD1(bool, AddTrack, rtc::scoped_refptr<AudioTrackInterface>)
-PROXY_METHOD1(bool, AddTrack, rtc::scoped_refptr<VideoTrackInterface>)
-PROXY_METHOD1(bool, RemoveTrack, rtc::scoped_refptr<AudioTrackInterface>)
-PROXY_METHOD1(bool, RemoveTrack, rtc::scoped_refptr<VideoTrackInterface>)
+PROXY_METHOD1(bool, AddTrack, scoped_refptr<AudioTrackInterface>)
+PROXY_METHOD1(bool, AddTrack, scoped_refptr<VideoTrackInterface>)
+PROXY_METHOD1(bool, RemoveTrack, scoped_refptr<AudioTrackInterface>)
+PROXY_METHOD1(bool, RemoveTrack, scoped_refptr<VideoTrackInterface>)
 PROXY_METHOD1(void, RegisterObserver, ObserverInterface*)
 PROXY_METHOD1(void, UnregisterObserver, ObserverInterface*)
 END_PROXY_MAP(MediaStream)
diff --git a/pc/media_stream_track_proxy.h b/pc/media_stream_track_proxy.h
index 4234d5e..8775ecd 100644
--- a/pc/media_stream_track_proxy.h
+++ b/pc/media_stream_track_proxy.h
@@ -33,7 +33,7 @@
 PROXY_METHOD1(void, AddSink, AudioTrackSinkInterface*)
 PROXY_METHOD1(void, RemoveSink, AudioTrackSinkInterface*)
 PROXY_METHOD1(bool, GetSignalLevel, int*)
-PROXY_METHOD0(rtc::scoped_refptr<AudioProcessorInterface>, GetAudioProcessor)
+PROXY_METHOD0(scoped_refptr<AudioProcessorInterface>, GetAudioProcessor)
 PROXY_METHOD1(bool, set_enabled, bool)
 PROXY_METHOD1(void, RegisterObserver, ObserverInterface*)
 PROXY_METHOD1(void, UnregisterObserver, ObserverInterface*)
diff --git a/pc/media_stream_unittest.cc b/pc/media_stream_unittest.cc
index fd1192e..9647080 100644
--- a/pc/media_stream_unittest.cc
+++ b/pc/media_stream_unittest.cc
@@ -25,8 +25,8 @@
 static const char kVideoTrackId[] = "dummy_video_cam_1";
 static const char kAudioTrackId[] = "dummy_microphone_1";
 
-using rtc::scoped_refptr;
 using ::testing::Exactly;
+using webrtc::scoped_refptr;
 
 namespace webrtc {
 
@@ -136,8 +136,8 @@
   EXPECT_EQ(0u, stream_->GetVideoTracks().size());
   EXPECT_EQ(0u, stream_->GetVideoTracks().size());
 
-  EXPECT_FALSE(stream_->RemoveTrack(rtc::scoped_refptr<AudioTrackInterface>()));
-  EXPECT_FALSE(stream_->RemoveTrack(rtc::scoped_refptr<VideoTrackInterface>()));
+  EXPECT_FALSE(stream_->RemoveTrack(scoped_refptr<AudioTrackInterface>()));
+  EXPECT_FALSE(stream_->RemoveTrack(scoped_refptr<VideoTrackInterface>()));
 }
 
 TEST_F(MediaStreamTest, ChangeVideoTrack) {
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc
index bc5b24e..a952650 100644
--- a/pc/peer_connection.cc
+++ b/pc/peer_connection.cc
@@ -124,19 +124,6 @@
 #include "rtc_base/unique_id_generator.h"
 #include "system_wrappers/include/metrics.h"
 
-using cricket::MediaContentDescription;
-using ::webrtc::ContentInfo;
-using ::webrtc::ContentInfos;
-using ::webrtc::MediaProtocolType;
-using ::webrtc::RidDescription;
-using ::webrtc::RidDirection;
-using ::webrtc::SessionDescription;
-using ::webrtc::SimulcastDescription;
-using ::webrtc::SimulcastLayer;
-using ::webrtc::SimulcastLayerList;
-using ::webrtc::StreamParams;
-using ::webrtc::TransportInfo;
-
 namespace webrtc {
 
 namespace {
@@ -371,7 +358,7 @@
 }
 
 void NoteServerUsage(UsagePattern& usage_pattern,
-                     const cricket::ServerAddresses& stun_servers,
+                     const ServerAddresses& stun_servers,
                      const std::vector<RelayServerConfig>& turn_servers) {
   if (!stun_servers.empty()) {
     usage_pattern.NoteUsageEvent(UsageEvent::STUN_SERVER_ADDED);
@@ -392,7 +379,7 @@
     IceTransportsType type;
     BundlePolicy bundle_policy;
     RtcpMuxPolicy rtcp_mux_policy;
-    std::vector<rtc::scoped_refptr<RTCCertificate>> certificates;
+    std::vector<scoped_refptr<RTCCertificate>> certificates;
     int ice_candidate_pool_size;
     bool disable_ipv6_on_wifi;
     int max_ipv6_networks;
@@ -423,7 +410,7 @@
     std::optional<int> stun_candidate_keepalive_interval;
     TurnCustomizer* turn_customizer;
     SdpSemantics sdp_semantics;
-    std::optional<rtc::AdapterType> network_preference;
+    std::optional<AdapterType> network_preference;
     bool active_reset_srtp_params;
     std::optional<CryptoOptions> crypto_options;
     bool offer_extmap_allow_mixed;
@@ -504,14 +491,14 @@
   return !(*this == o);
 }
 
-rtc::scoped_refptr<PeerConnection> PeerConnection::Create(
+scoped_refptr<PeerConnection> PeerConnection::Create(
     const Environment& env,
-    rtc::scoped_refptr<ConnectionContext> context,
+    scoped_refptr<ConnectionContext> context,
     const PeerConnectionFactoryInterface::Options& options,
     std::unique_ptr<Call> call,
     const PeerConnectionInterface::RTCConfiguration& configuration,
     PeerConnectionDependencies& dependencies,
-    const cricket::ServerAddresses& stun_servers,
+    const ServerAddresses& stun_servers,
     const std::vector<RelayServerConfig>& turn_servers) {
   RTC_DCHECK(IceConfig(configuration).IsValid().ok());
   RTC_DCHECK(dependencies.observer);
@@ -523,7 +510,7 @@
   bool dtls_enabled = DtlsEnabled(configuration, options, dependencies);
 
   TRACE_EVENT0("webrtc", "PeerConnection::Create");
-  return rtc::make_ref_counted<PeerConnection>(
+  return make_ref_counted<PeerConnection>(
       configuration, env, context, options, is_unified_plan, std::move(call),
       dependencies, stun_servers, turn_servers, dtls_enabled);
 }
@@ -531,12 +518,12 @@
 PeerConnection::PeerConnection(
     const PeerConnectionInterface::RTCConfiguration& configuration,
     const Environment& env,
-    rtc::scoped_refptr<ConnectionContext> context,
+    scoped_refptr<ConnectionContext> context,
     const PeerConnectionFactoryInterface::Options& options,
     bool is_unified_plan,
     std::unique_ptr<Call> call,
     PeerConnectionDependencies& dependencies,
-    const cricket::ServerAddresses& stun_servers,
+    const ServerAddresses& stun_servers,
     const std::vector<RelayServerConfig>& turn_servers,
     bool dtls_enabled)
     : env_(env),
@@ -598,12 +585,12 @@
   if (!IsUnifiedPlan()) {
     rtp_manager_->transceivers()->Add(
         RtpTransceiverProxyWithInternal<RtpTransceiver>::Create(
-            signaling_thread(), rtc::make_ref_counted<RtpTransceiver>(
+            signaling_thread(), make_ref_counted<RtpTransceiver>(
                                     webrtc::MediaType::AUDIO, context_.get(),
                                     codec_lookup_helper_.get())));
     rtp_manager_->transceivers()->Add(
         RtpTransceiverProxyWithInternal<RtpTransceiver>::Create(
-            signaling_thread(), rtc::make_ref_counted<RtpTransceiver>(
+            signaling_thread(), make_ref_counted<RtpTransceiver>(
                                     webrtc::MediaType::VIDEO, context_.get(),
                                     codec_lookup_helper_.get())));
   }
@@ -679,7 +666,7 @@
 }
 
 JsepTransportController* PeerConnection::InitializeNetworkThread(
-    const cricket::ServerAddresses& stun_servers,
+    const ServerAddresses& stun_servers,
     const std::vector<RelayServerConfig>& turn_servers) {
   RTC_DCHECK_RUN_ON(signaling_thread());
 
@@ -728,7 +715,7 @@
 
   config.ice_transport_factory = ice_transport_factory_.get();
   config.on_dtls_handshake_error_ =
-      [weak_ptr = weak_factory_.GetWeakPtr()](rtc::SSLHandshakeError s) {
+      [weak_ptr = weak_factory_.GetWeakPtr()](SSLHandshakeError s) {
         if (weak_ptr) {
           weak_ptr->OnTransportControllerDtlsHandshakeError(s);
         }
@@ -740,7 +727,7 @@
                                   payload_type_picker_, std::move(config)));
 
   transport_controller_->SubscribeIceConnectionState(
-      [this](cricket::IceConnectionState s) {
+      [this](::webrtc::IceConnectionState s) {
         RTC_DCHECK_RUN_ON(network_thread());
         signaling_thread()->PostTask(
             SafeTask(signaling_thread_safety_.flag(), [this, s]() {
@@ -777,7 +764,7 @@
       });
   transport_controller_->SubscribeIceCandidateGathered(
       [this](const std::string& transport,
-             const std::vector<cricket::Candidate>& candidates) {
+             const std::vector<Candidate>& candidates) {
         RTC_DCHECK_RUN_ON(network_thread());
         signaling_thread()->PostTask(
             SafeTask(signaling_thread_safety_.flag(),
@@ -787,7 +774,7 @@
                      }));
       });
   transport_controller_->SubscribeIceCandidateError(
-      [this](const cricket::IceCandidateErrorEvent& event) {
+      [this](const IceCandidateErrorEvent& event) {
         RTC_DCHECK_RUN_ON(network_thread());
         signaling_thread()->PostTask(
             SafeTask(signaling_thread_safety_.flag(), [this, event = event]() {
@@ -796,7 +783,7 @@
             }));
       });
   transport_controller_->SubscribeIceCandidatesRemoved(
-      [this](const std::vector<cricket::Candidate>& c) {
+      [this](const std::vector<Candidate>& c) {
         RTC_DCHECK_RUN_ON(network_thread());
         signaling_thread()->PostTask(
             SafeTask(signaling_thread_safety_.flag(), [this, c = c]() {
@@ -805,7 +792,7 @@
             }));
       });
   transport_controller_->SubscribeIceCandidatePairChanged(
-      [this](const cricket::CandidatePairChangeEvent& event) {
+      [this](const CandidatePairChangeEvent& event) {
         RTC_DCHECK_RUN_ON(network_thread());
         signaling_thread()->PostTask(
             SafeTask(signaling_thread_safety_.flag(), [this, event = event]() {
@@ -822,7 +809,7 @@
   return transport_controller_.get();
 }
 
-rtc::scoped_refptr<StreamCollectionInterface> PeerConnection::local_streams() {
+scoped_refptr<StreamCollectionInterface> PeerConnection::local_streams() {
   RTC_DCHECK_RUN_ON(signaling_thread());
   RTC_CHECK(!IsUnifiedPlan()) << "local_streams is not available with Unified "
                                  "Plan SdpSemantics. Please use GetSenders "
@@ -830,7 +817,7 @@
   return sdp_handler_->local_streams();
 }
 
-rtc::scoped_refptr<StreamCollectionInterface> PeerConnection::remote_streams() {
+scoped_refptr<StreamCollectionInterface> PeerConnection::remote_streams() {
   RTC_DCHECK_RUN_ON(signaling_thread());
   RTC_CHECK(!IsUnifiedPlan()) << "remote_streams is not available with Unified "
                                  "Plan SdpSemantics. Please use GetReceivers "
@@ -860,21 +847,21 @@
   sdp_handler_->RemoveStream(local_stream);
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> PeerConnection::AddTrack(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+RTCErrorOr<scoped_refptr<RtpSenderInterface>> PeerConnection::AddTrack(
+    scoped_refptr<MediaStreamTrackInterface> track,
     const std::vector<std::string>& stream_ids) {
   return AddTrack(std::move(track), stream_ids, nullptr);
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> PeerConnection::AddTrack(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+RTCErrorOr<scoped_refptr<RtpSenderInterface>> PeerConnection::AddTrack(
+    scoped_refptr<MediaStreamTrackInterface> track,
     const std::vector<std::string>& stream_ids,
     const std::vector<RtpEncodingParameters>& init_send_encodings) {
   return AddTrack(std::move(track), stream_ids, &init_send_encodings);
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> PeerConnection::AddTrack(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+RTCErrorOr<scoped_refptr<RtpSenderInterface>> PeerConnection::AddTrack(
+    scoped_refptr<MediaStreamTrackInterface> track,
     const std::vector<std::string>& stream_ids,
     const std::vector<RtpEncodingParameters>* init_send_encodings) {
   RTC_DCHECK_RUN_ON(signaling_thread());
@@ -910,7 +897,7 @@
 }
 
 RTCError PeerConnection::RemoveTrackOrError(
-    rtc::scoped_refptr<RtpSenderInterface> sender) {
+    scoped_refptr<RtpSenderInterface> sender) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   if (!ConfiguredForMedia()) {
     LOG_AND_RETURN_ERROR(RTCErrorType::UNSUPPORTED_OPERATION,
@@ -956,15 +943,14 @@
   return RTCError::OK();
 }
 
-rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
 PeerConnection::FindTransceiverBySender(
-    rtc::scoped_refptr<RtpSenderInterface> sender) {
+    scoped_refptr<RtpSenderInterface> sender) {
   return rtp_manager()->transceivers()->FindBySender(sender);
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
-PeerConnection::AddTransceiver(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track) {
+RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>
+PeerConnection::AddTransceiver(scoped_refptr<MediaStreamTrackInterface> track) {
   if (!ConfiguredForMedia()) {
     LOG_AND_RETURN_ERROR(RTCErrorType::UNSUPPORTED_OPERATION,
                          "Not configured for media");
@@ -973,10 +959,9 @@
   return AddTransceiver(track, RtpTransceiverInit());
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
-PeerConnection::AddTransceiver(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
-    const RtpTransceiverInit& init) {
+RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>
+PeerConnection::AddTransceiver(scoped_refptr<MediaStreamTrackInterface> track,
+                               const RtpTransceiverInit& init) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   if (!ConfiguredForMedia()) {
     LOG_AND_RETURN_ERROR(RTCErrorType::UNSUPPORTED_OPERATION,
@@ -999,12 +984,12 @@
   return AddTransceiver(media_type, track, init);
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
+RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>
 PeerConnection::AddTransceiver(webrtc::MediaType media_type) {
   return AddTransceiver(media_type, RtpTransceiverInit());
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
+RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>
 PeerConnection::AddTransceiver(webrtc::MediaType media_type,
                                const RtpTransceiverInit& init) {
   RTC_DCHECK_RUN_ON(signaling_thread());
@@ -1022,12 +1007,11 @@
   return AddTransceiver(media_type, nullptr, init);
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
-PeerConnection::AddTransceiver(
-    webrtc::MediaType media_type,
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
-    const RtpTransceiverInit& init,
-    bool update_negotiation_needed) {
+RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>
+PeerConnection::AddTransceiver(webrtc::MediaType media_type,
+                               scoped_refptr<MediaStreamTrackInterface> track,
+                               const RtpTransceiverInit& init,
+                               bool update_negotiation_needed) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   if (!ConfiguredForMedia()) {
     LOG_AND_RETURN_ERROR(RTCErrorType::UNSUPPORTED_OPERATION,
@@ -1144,7 +1128,7 @@
     sdp_handler_->UpdateNegotiationNeeded();
   }
 
-  return rtc::scoped_refptr<RtpTransceiverInterface>(transceiver);
+  return scoped_refptr<RtpTransceiverInterface>(transceiver);
 }
 
 void PeerConnection::OnNegotiationNeeded() {
@@ -1153,7 +1137,7 @@
   sdp_handler_->UpdateNegotiationNeeded();
 }
 
-rtc::scoped_refptr<RtpSenderInterface> PeerConnection::CreateSender(
+scoped_refptr<RtpSenderInterface> PeerConnection::CreateSender(
     const std::string& kind,
     const std::string& stream_id) {
   RTC_DCHECK_RUN_ON(signaling_thread());
@@ -1182,7 +1166,7 @@
   }
 
   // TODO(steveanton): Move construction of the RtpSenders to RtpTransceiver.
-  rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> new_sender;
+  scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> new_sender;
   if (kind == MediaStreamTrackInterface::kAudioKind) {
     auto audio_sender =
         AudioRtpSender::Create(env_, worker_thread(), CreateRandomUuid(),
@@ -1207,10 +1191,10 @@
   return new_sender;
 }
 
-std::vector<rtc::scoped_refptr<RtpSenderInterface>> PeerConnection::GetSenders()
+std::vector<scoped_refptr<RtpSenderInterface>> PeerConnection::GetSenders()
     const {
   RTC_DCHECK_RUN_ON(signaling_thread());
-  std::vector<rtc::scoped_refptr<RtpSenderInterface>> ret;
+  std::vector<scoped_refptr<RtpSenderInterface>> ret;
   if (ConfiguredForMedia()) {
     for (const auto& sender : rtp_manager()->GetSendersInternal()) {
       ret.push_back(sender);
@@ -1219,10 +1203,10 @@
   return ret;
 }
 
-std::vector<rtc::scoped_refptr<RtpReceiverInterface>>
-PeerConnection::GetReceivers() const {
+std::vector<scoped_refptr<RtpReceiverInterface>> PeerConnection::GetReceivers()
+    const {
   RTC_DCHECK_RUN_ON(signaling_thread());
-  std::vector<rtc::scoped_refptr<RtpReceiverInterface>> ret;
+  std::vector<scoped_refptr<RtpReceiverInterface>> ret;
   if (ConfiguredForMedia()) {
     for (const auto& receiver : rtp_manager()->GetReceiversInternal()) {
       ret.push_back(receiver);
@@ -1231,12 +1215,12 @@
   return ret;
 }
 
-std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>
+std::vector<scoped_refptr<RtpTransceiverInterface>>
 PeerConnection::GetTransceivers() const {
   RTC_DCHECK_RUN_ON(signaling_thread());
   RTC_CHECK(IsUnifiedPlan())
       << "GetTransceivers is only supported with Unified Plan SdpSemantics.";
-  std::vector<rtc::scoped_refptr<RtpTransceiverInterface>> all_transceivers;
+  std::vector<scoped_refptr<RtpTransceiverInterface>> all_transceivers;
   if (ConfiguredForMedia()) {
     for (const auto& transceiver : rtp_manager()->transceivers()->List()) {
       all_transceivers.push_back(transceiver);
@@ -1280,19 +1264,19 @@
   RTC_DCHECK(callback);
   RTC_LOG_THREAD_BLOCK_COUNT();
   stats_collector_->GetStatsReport(
-      rtc::scoped_refptr<RTCStatsCollectorCallback>(callback));
+      scoped_refptr<RTCStatsCollectorCallback>(callback));
   RTC_DCHECK_BLOCK_COUNT_NO_MORE_THAN(2);
 }
 
 void PeerConnection::GetStats(
-    rtc::scoped_refptr<RtpSenderInterface> selector,
-    rtc::scoped_refptr<RTCStatsCollectorCallback> callback) {
+    scoped_refptr<RtpSenderInterface> selector,
+    scoped_refptr<RTCStatsCollectorCallback> callback) {
   TRACE_EVENT0("webrtc", "PeerConnection::GetStats");
   RTC_DCHECK_RUN_ON(signaling_thread());
   RTC_DCHECK(callback);
   RTC_DCHECK(stats_collector_);
   RTC_LOG_THREAD_BLOCK_COUNT();
-  rtc::scoped_refptr<RtpSenderInternal> internal_sender;
+  scoped_refptr<RtpSenderInternal> internal_sender;
   if (selector) {
     for (const auto& proxy_transceiver :
          rtp_manager()->transceivers()->List()) {
@@ -1317,14 +1301,14 @@
 }
 
 void PeerConnection::GetStats(
-    rtc::scoped_refptr<RtpReceiverInterface> selector,
-    rtc::scoped_refptr<RTCStatsCollectorCallback> callback) {
+    scoped_refptr<RtpReceiverInterface> selector,
+    scoped_refptr<RTCStatsCollectorCallback> callback) {
   TRACE_EVENT0("webrtc", "PeerConnection::GetStats");
   RTC_DCHECK_RUN_ON(signaling_thread());
   RTC_DCHECK(callback);
   RTC_DCHECK(stats_collector_);
   RTC_LOG_THREAD_BLOCK_COUNT();
-  rtc::scoped_refptr<RtpReceiverInternal> internal_receiver;
+  scoped_refptr<RtpReceiverInternal> internal_receiver;
   if (selector) {
     for (const auto& proxy_transceiver :
          rtp_manager()->transceivers()->List()) {
@@ -1394,7 +1378,7 @@
       "trickle");
 }
 
-RTCErrorOr<rtc::scoped_refptr<DataChannelInterface>>
+RTCErrorOr<scoped_refptr<DataChannelInterface>>
 PeerConnection::CreateDataChannelOrError(const std::string& label,
                                          const DataChannelInit* config) {
   RTC_DCHECK_RUN_ON(signaling_thread());
@@ -1413,14 +1397,14 @@
   }
 
   internal_config.fallback_ssl_role = sdp_handler_->GuessSslRole();
-  RTCErrorOr<rtc::scoped_refptr<DataChannelInterface>> ret =
+  RTCErrorOr<scoped_refptr<DataChannelInterface>> ret =
       data_channel_controller_.InternalCreateDataChannelWithProxy(
           label, internal_config);
   if (!ret.ok()) {
     return ret.MoveError();
   }
 
-  rtc::scoped_refptr<DataChannelInterface> channel = ret.MoveValue();
+  scoped_refptr<DataChannelInterface> channel = ret.MoveValue();
 
   // Check the onRenegotiationNeeded event (with plan-b backward compat)
   if (configuration_.sdp_semantics == SdpSemantics::kUnifiedPlan ||
@@ -1458,7 +1442,7 @@
 
 void PeerConnection::SetLocalDescription(
     std::unique_ptr<SessionDescriptionInterface> desc,
-    rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) {
+    scoped_refptr<SetLocalDescriptionObserverInterface> observer) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   sdp_handler_->SetLocalDescription(std::move(desc), observer);
 }
@@ -1470,7 +1454,7 @@
 }
 
 void PeerConnection::SetLocalDescription(
-    rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) {
+    scoped_refptr<SetLocalDescriptionObserverInterface> observer) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   sdp_handler_->SetLocalDescription(observer);
 }
@@ -1484,7 +1468,7 @@
 
 void PeerConnection::SetRemoteDescription(
     std::unique_ptr<SessionDescriptionInterface> desc,
-    rtc::scoped_refptr<SetRemoteDescriptionObserverInterface> observer) {
+    scoped_refptr<SetRemoteDescriptionObserverInterface> observer) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   sdp_handler_->SetRemoteDescription(std::move(desc), observer);
 }
@@ -1530,7 +1514,7 @@
   }
 
   // Parse ICE servers before hopping to network thread.
-  cricket::ServerAddresses stun_servers;
+  ServerAddresses stun_servers;
   std::vector<RelayServerConfig> turn_servers;
   validate_error = ParseAndValidateIceServersFromConfiguration(
       configuration, stun_servers, turn_servers);
@@ -1678,8 +1662,7 @@
   audio_state->SetRecording(recording);
 }
 
-void PeerConnection::AddAdaptationResource(
-    rtc::scoped_refptr<Resource> resource) {
+void PeerConnection::AddAdaptationResource(scoped_refptr<Resource> resource) {
   if (!worker_thread()->IsCurrent()) {
     return worker_thread()->BlockingCall(
         [this, resource]() { return AddAdaptationResource(resource); });
@@ -1726,14 +1709,14 @@
       }));
 }
 
-rtc::scoped_refptr<DtlsTransportInterface>
-PeerConnection::LookupDtlsTransportByMid(const std::string& mid) {
+scoped_refptr<DtlsTransportInterface> PeerConnection::LookupDtlsTransportByMid(
+    const std::string& mid) {
   RTC_DCHECK_RUN_ON(network_thread());
   return transport_controller_->LookupDtlsTransportByMid(mid);
 }
 
-rtc::scoped_refptr<DtlsTransport>
-PeerConnection::LookupDtlsTransportByMidInternal(const std::string& mid) {
+scoped_refptr<DtlsTransport> PeerConnection::LookupDtlsTransportByMidInternal(
+    const std::string& mid) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   // TODO(bugs.webrtc.org/9987): Avoid the thread jump.
   // This might be done by caching the value on the signaling thread.
@@ -1743,8 +1726,7 @@
   });
 }
 
-rtc::scoped_refptr<SctpTransportInterface> PeerConnection::GetSctpTransport()
-    const {
+scoped_refptr<SctpTransportInterface> PeerConnection::GetSctpTransport() const {
   RTC_DCHECK_RUN_ON(network_thread());
   if (!sctp_mid_n_)
     return nullptr;
@@ -2140,7 +2122,7 @@
 
 PeerConnection::InitializePortAllocatorResult
 PeerConnection::InitializePortAllocator_n(
-    const cricket::ServerAddresses& stun_servers,
+    const ServerAddresses& stun_servers,
     const std::vector<RelayServerConfig>& turn_servers,
     const RTCConfiguration& configuration) {
   RTC_DCHECK_RUN_ON(network_thread());
@@ -2201,7 +2183,7 @@
 }
 
 bool PeerConnection::ReconfigurePortAllocator_n(
-    const cricket::ServerAddresses& stun_servers,
+    const ServerAddresses& stun_servers,
     const std::vector<RelayServerConfig>& turn_servers,
     IceTransportsType type,
     int candidate_pool_size,
@@ -2306,11 +2288,11 @@
   return sctp_mid_s_;
 }
 
-cricket::CandidateStatsList PeerConnection::GetPooledCandidateStats() const {
+CandidateStatsList PeerConnection::GetPooledCandidateStats() const {
   RTC_DCHECK_RUN_ON(network_thread());
   if (!network_thread_safety_->alive())
     return {};
-  cricket::CandidateStatsList candidate_stats_list;
+  CandidateStatsList candidate_stats_list;
   port_allocator_->GetCandidateStatsFromPooledSessions(&candidate_stats_list);
   return candidate_stats_list;
 }
@@ -2340,7 +2322,7 @@
 
 bool PeerConnection::GetLocalCertificate(
     const std::string& transport_name,
-    rtc::scoped_refptr<RTCCertificate>* certificate) {
+    scoped_refptr<RTCCertificate>* certificate) {
   RTC_DCHECK_RUN_ON(network_thread());
   if (!network_thread_safety_->alive() || !certificate) {
     return false;
@@ -2368,9 +2350,9 @@
 }
 
 void PeerConnection::OnTransportControllerConnectionState(
-    cricket::IceConnectionState state) {
+    ::webrtc::IceConnectionState state) {
   switch (state) {
-    case cricket::kIceConnectionConnecting:
+    case ::webrtc::kIceConnectionConnecting:
       // If the current state is Connected or Completed, then there were
       // writable channels but now there are not, so the next state must
       // be Disconnected.
@@ -2385,10 +2367,10 @@
             PeerConnectionInterface::kIceConnectionDisconnected);
       }
       break;
-    case cricket::kIceConnectionFailed:
+    case ::webrtc::kIceConnectionFailed:
       SetIceConnectionState(PeerConnectionInterface::kIceConnectionFailed);
       break;
-    case cricket::kIceConnectionConnected:
+    case ::webrtc::kIceConnectionConnected:
       RTC_LOG(LS_INFO) << "Changing to ICE connected state because "
                           "all transports are writable.";
       {
@@ -2408,7 +2390,7 @@
       SetIceConnectionState(PeerConnectionInterface::kIceConnectionConnected);
       NoteUsageEvent(UsageEvent::ICE_STATE_CONNECTED);
       break;
-    case cricket::kIceConnectionCompleted:
+    case ::webrtc::kIceConnectionCompleted:
       RTC_LOG(LS_INFO) << "Changing to ICE completed state because "
                           "all transports are complete.";
       if (ice_connection_state_ !=
@@ -2428,7 +2410,7 @@
 
 void PeerConnection::OnTransportControllerCandidatesGathered(
     const std::string& transport_name,
-    const cricket::Candidates& candidates) {
+    const Candidates& candidates) {
   // TODO(bugs.webrtc.org/12427): Expect this to come in on the network thread
   // (not signaling as it currently does), handle appropriately.
   int sdp_mline_index;
@@ -2439,7 +2421,7 @@
     return;
   }
 
-  for (cricket::Candidates::const_iterator citer = candidates.begin();
+  for (Candidates::const_iterator citer = candidates.begin();
        citer != candidates.end(); ++citer) {
     // Use transport_name as the candidate media id.
     std::unique_ptr<JsepIceCandidate> candidate(
@@ -2458,7 +2440,7 @@
 void PeerConnection::OnTransportControllerCandidatesRemoved(
     const std::vector<Candidate>& candidates) {
   // Sanity check.
-  for (const cricket::Candidate& candidate : candidates) {
+  for (const Candidate& candidate : candidates) {
     if (candidate.transport_name().empty()) {
       RTC_LOG(LS_ERROR) << "OnTransportControllerCandidatesRemoved: "
                            "empty content name in candidate "
@@ -2569,8 +2551,8 @@
   if (bundle_groups_by_mid.empty())
     return true;
 
-  const cricket::ContentInfos& contents = desc->contents();
-  for (cricket::ContentInfos::const_iterator citer = contents.begin();
+  const ContentInfos& contents = desc->contents();
+  for (ContentInfos::const_iterator citer = contents.begin();
        citer != contents.end(); ++citer) {
     const ContentInfo* content = (&*citer);
     RTC_DCHECK(content != NULL);
@@ -2655,16 +2637,16 @@
                                         const Candidate& candidate) {
   RTC_DCHECK_RUN_ON(signaling_thread());
 
-  if (candidate.network_type() != rtc::ADAPTER_TYPE_UNKNOWN) {
+  if (candidate.network_type() != ADAPTER_TYPE_UNKNOWN) {
     RTC_DLOG(LS_WARNING) << "Using candidate with adapter type set - this "
                             "should only happen in test";
   }
 
   // Clear fields that do not make sense as remote candidates.
   Candidate new_candidate(candidate);
-  new_candidate.set_network_type(rtc::ADAPTER_TYPE_UNKNOWN);
+  new_candidate.set_network_type(ADAPTER_TYPE_UNKNOWN);
   new_candidate.set_relay_protocol("");
-  new_candidate.set_underlying_type_for_vpn(rtc::ADAPTER_TYPE_UNKNOWN);
+  new_candidate.set_underlying_type_for_vpn(ADAPTER_TYPE_UNKNOWN);
 
   network_thread()->PostTask(SafeTask(
       network_thread_safety_,
@@ -2783,9 +2765,8 @@
 // for IPv4 and IPv6.
 // static (no member state required)
 void PeerConnection::ReportBestConnectionState(const TransportStats& stats) {
-  for (const cricket::TransportChannelStats& channel_stats :
-       stats.channel_stats) {
-    for (const cricket::ConnectionInfo& connection_info :
+  for (const TransportChannelStats& channel_stats : stats.channel_stats) {
+    for (const ConnectionInfo& connection_info :
          channel_stats.ice_transport_stats.connection_infos) {
       if (!connection_info.best_connection) {
         continue;
@@ -2899,7 +2880,7 @@
 bool PeerConnection::OnTransportChanged(
     const std::string& mid,
     RtpTransportInternal* rtp_transport,
-    rtc::scoped_refptr<DtlsTransport> dtls_transport,
+    scoped_refptr<DtlsTransport> dtls_transport,
     DataChannelTransportInterface* data_channel_transport) {
   RTC_DCHECK_RUN_ON(network_thread());
   bool ret = true;
@@ -2941,7 +2922,7 @@
 
   network_thread()->PostTask(
       SafeTask(network_thread_safety_, [this, mid = *sctp_mid_s_, options] {
-        rtc::scoped_refptr<SctpTransport> sctp_transport =
+        scoped_refptr<SctpTransport> sctp_transport =
             transport_controller_n()->GetSctpTransport(mid);
         if (sctp_transport)
           sctp_transport->Start(options);
@@ -2997,12 +2978,11 @@
   });
 }
 
-std::function<void(const rtc::CopyOnWriteBuffer& packet,
+std::function<void(const webrtc::CopyOnWriteBuffer& packet,
                    int64_t packet_time_us)>
 PeerConnection::InitializeRtcpCallback() {
   RTC_DCHECK_RUN_ON(network_thread());
-  return [this](const rtc::CopyOnWriteBuffer& packet,
-                int64_t /*packet_time_us*/) {
+  return [this](const CopyOnWriteBuffer& packet, int64_t /*packet_time_us*/) {
     worker_thread()->PostTask(SafeTask(worker_thread_safety_, [this, packet]() {
       call_ptr_->Receiver()->DeliverRtcpPacket(packet);
     }));
diff --git a/pc/peer_connection.h b/pc/peer_connection.h
index c5254e0..eeea50f 100644
--- a/pc/peer_connection.h
+++ b/pc/peer_connection.h
@@ -116,58 +116,57 @@
   //
   // Note that the function takes ownership of dependencies, and will
   // either use them or release them, whether it succeeds or fails.
-  static rtc::scoped_refptr<PeerConnection> Create(
+  static scoped_refptr<PeerConnection> Create(
       const Environment& env,
-      rtc::scoped_refptr<ConnectionContext> context,
+      scoped_refptr<ConnectionContext> context,
       const PeerConnectionFactoryInterface::Options& options,
       std::unique_ptr<Call> call,
       const PeerConnectionInterface::RTCConfiguration& configuration,
       PeerConnectionDependencies& dependencies,
-      const cricket::ServerAddresses& stun_servers,
+      const ServerAddresses& stun_servers,
       const std::vector<RelayServerConfig>& turn_servers);
 
-  rtc::scoped_refptr<StreamCollectionInterface> local_streams() override;
-  rtc::scoped_refptr<StreamCollectionInterface> remote_streams() override;
+  scoped_refptr<StreamCollectionInterface> local_streams() override;
+  scoped_refptr<StreamCollectionInterface> remote_streams() override;
   bool AddStream(MediaStreamInterface* local_stream) override;
   void RemoveStream(MediaStreamInterface* local_stream) override;
 
-  RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrack(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  RTCErrorOr<scoped_refptr<RtpSenderInterface>> AddTrack(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<std::string>& stream_ids) override;
-  RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrack(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  RTCErrorOr<scoped_refptr<RtpSenderInterface>> AddTrack(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<std::string>& stream_ids,
       const std::vector<RtpEncodingParameters>& init_send_encodings) override;
-  RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrack(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  RTCErrorOr<scoped_refptr<RtpSenderInterface>> AddTrack(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<std::string>& stream_ids,
       const std::vector<RtpEncodingParameters>* init_send_encodings);
   RTCError RemoveTrackOrError(
-      rtc::scoped_refptr<RtpSenderInterface> sender) override;
+      scoped_refptr<RtpSenderInterface> sender) override;
 
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track) override;
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
+      scoped_refptr<MediaStreamTrackInterface> track) override;
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const RtpTransceiverInit& init) override;
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
       webrtc::MediaType media_type) override;
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
       webrtc::MediaType media_type,
       const RtpTransceiverInit& init) override;
 
-  rtc::scoped_refptr<RtpSenderInterface> CreateSender(
+  scoped_refptr<RtpSenderInterface> CreateSender(
       const std::string& kind,
       const std::string& stream_id) override;
 
-  std::vector<rtc::scoped_refptr<RtpSenderInterface>> GetSenders()
+  std::vector<scoped_refptr<RtpSenderInterface>> GetSenders() const override;
+  std::vector<scoped_refptr<RtpReceiverInterface>> GetReceivers()
       const override;
-  std::vector<rtc::scoped_refptr<RtpReceiverInterface>> GetReceivers()
-      const override;
-  std::vector<rtc::scoped_refptr<RtpTransceiverInterface>> GetTransceivers()
+  std::vector<scoped_refptr<RtpTransceiverInterface>> GetTransceivers()
       const override;
 
-  RTCErrorOr<rtc::scoped_refptr<DataChannelInterface>> CreateDataChannelOrError(
+  RTCErrorOr<scoped_refptr<DataChannelInterface>> CreateDataChannelOrError(
       const std::string& label,
       const DataChannelInit* config) override;
   // WARNING: LEGACY. See peerconnectioninterface.h
@@ -176,12 +175,10 @@
                 StatsOutputLevel level) override;
   // Spec-complaint GetStats(). See peerconnectioninterface.h
   void GetStats(RTCStatsCollectorCallback* callback) override;
-  void GetStats(
-      rtc::scoped_refptr<RtpSenderInterface> selector,
-      rtc::scoped_refptr<RTCStatsCollectorCallback> callback) override;
-  void GetStats(
-      rtc::scoped_refptr<RtpReceiverInterface> selector,
-      rtc::scoped_refptr<RTCStatsCollectorCallback> callback) override;
+  void GetStats(scoped_refptr<RtpSenderInterface> selector,
+                scoped_refptr<RTCStatsCollectorCallback> callback) override;
+  void GetStats(scoped_refptr<RtpReceiverInterface> selector,
+                scoped_refptr<RTCStatsCollectorCallback> callback) override;
   void ClearStatsCache() override;
 
   SignalingState signaling_state() override;
@@ -214,11 +211,9 @@
 
   void SetLocalDescription(
       std::unique_ptr<SessionDescriptionInterface> desc,
-      rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer)
-      override;
+      scoped_refptr<SetLocalDescriptionObserverInterface> observer) override;
   void SetLocalDescription(
-      rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer)
-      override;
+      scoped_refptr<SetLocalDescriptionObserverInterface> observer) override;
   // TODO(https://crbug.com/webrtc/11798): Delete these methods in favor of the
   // ones taking SetLocalDescriptionObserverInterface as argument.
   void SetLocalDescription(SetSessionDescriptionObserver* observer,
@@ -227,8 +222,7 @@
 
   void SetRemoteDescription(
       std::unique_ptr<SessionDescriptionInterface> desc,
-      rtc::scoped_refptr<SetRemoteDescriptionObserverInterface> observer)
-      override;
+      scoped_refptr<SetRemoteDescriptionObserverInterface> observer) override;
   // TODO(https://crbug.com/webrtc/11798): Delete this methods in favor of the
   // ones taking SetRemoteDescriptionObserverInterface as argument.
   void SetRemoteDescription(SetSessionDescriptionObserver* observer,
@@ -249,14 +243,14 @@
   void SetAudioPlayout(bool playout) override;
   void SetAudioRecording(bool recording) override;
 
-  rtc::scoped_refptr<DtlsTransportInterface> LookupDtlsTransportByMid(
+  scoped_refptr<DtlsTransportInterface> LookupDtlsTransportByMid(
       const std::string& mid) override;
-  rtc::scoped_refptr<DtlsTransport> LookupDtlsTransportByMidInternal(
+  scoped_refptr<DtlsTransport> LookupDtlsTransportByMidInternal(
       const std::string& mid);
 
-  rtc::scoped_refptr<SctpTransportInterface> GetSctpTransport() const override;
+  scoped_refptr<SctpTransportInterface> GetSctpTransport() const override;
 
-  void AddAdaptationResource(rtc::scoped_refptr<Resource> resource) override;
+  void AddAdaptationResource(scoped_refptr<Resource> resource) override;
 
   bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
                         int64_t output_period_ms) override;
@@ -282,8 +276,7 @@
     return sdp_handler_->initial_offerer();
   }
 
-  std::vector<
-      rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
+  std::vector<scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
   GetTransceiversInternal() const override {
     RTC_DCHECK_RUN_ON(signaling_thread());
     if (!ConfiguredForMedia()) {
@@ -297,16 +290,15 @@
   std::optional<std::string> sctp_transport_name() const override;
   std::optional<std::string> sctp_mid() const override;
 
-  cricket::CandidateStatsList GetPooledCandidateStats() const override;
+  CandidateStatsList GetPooledCandidateStats() const override;
   std::map<std::string, TransportStats> GetTransportStatsByNames(
       const std::set<std::string>& transport_names) override;
   Call::Stats GetCallStats() override;
 
   std::optional<AudioDeviceModule::Stats> GetAudioDeviceStats() override;
 
-  bool GetLocalCertificate(
-      const std::string& transport_name,
-      rtc::scoped_refptr<RTCCertificate>* certificate) override;
+  bool GetLocalCertificate(const std::string& transport_name,
+                           scoped_refptr<RTCCertificate>* certificate) override;
   std::unique_ptr<SSLCertChain> GetRemoteSSLCertChain(
       const std::string& transport_name) override;
   bool IceRestartPending(const std::string& content_name) const override;
@@ -418,9 +410,9 @@
 
   // Internal implementation for AddTransceiver family of methods. If
   // `fire_callback` is set, fires OnRenegotiationNeeded callback if successful.
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
       webrtc::MediaType media_type,
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+      scoped_refptr<MediaStreamTrackInterface> track,
       const RtpTransceiverInit& init,
       bool fire_callback = true) override;
 
@@ -469,15 +461,15 @@
   }
 
  protected:
-  // Available for rtc::scoped_refptr creation
+  // Available for webrtc::scoped_refptr creation
   PeerConnection(const PeerConnectionInterface::RTCConfiguration& configuration,
                  const Environment& env,
-                 rtc::scoped_refptr<ConnectionContext> context,
+                 scoped_refptr<ConnectionContext> context,
                  const PeerConnectionFactoryInterface::Options& options,
                  bool is_unified_plan,
                  std::unique_ptr<Call> call,
                  PeerConnectionDependencies& dependencies,
-                 const cricket::ServerAddresses& stun_servers,
+                 const ServerAddresses& stun_servers,
                  const std::vector<RelayServerConfig>& turn_servers,
                  bool dtls_enabled);
 
@@ -489,13 +481,13 @@
   // InitializeTransportController_n). The return value of this function is used
   // to set the initial value of `transport_controller_copy_`.
   JsepTransportController* InitializeNetworkThread(
-      const cricket::ServerAddresses& stun_servers,
+      const ServerAddresses& stun_servers,
       const std::vector<RelayServerConfig>& turn_servers);
   JsepTransportController* InitializeTransportController_n(
       const RTCConfiguration& configuration) RTC_RUN_ON(network_thread());
 
-  rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
-  FindTransceiverBySender(rtc::scoped_refptr<RtpSenderInterface> sender)
+  scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+  FindTransceiverBySender(scoped_refptr<RtpSenderInterface> sender)
       RTC_RUN_ON(signaling_thread());
 
   void SetStandardizedIceConnectionState(
@@ -532,13 +524,13 @@
     bool enable_ipv6;
   };
   InitializePortAllocatorResult InitializePortAllocator_n(
-      const cricket::ServerAddresses& stun_servers,
+      const ServerAddresses& stun_servers,
       const std::vector<RelayServerConfig>& turn_servers,
       const RTCConfiguration& configuration);
   // Called when SetConfiguration is called to apply the supported subset
   // of the configuration on the network thread.
   bool ReconfigurePortAllocator_n(
-      const cricket::ServerAddresses& stun_servers,
+      const ServerAddresses& stun_servers,
       const std::vector<RelayServerConfig>& turn_servers,
       IceTransportsType type,
       int candidate_pool_size,
@@ -570,7 +562,7 @@
       RTC_RUN_ON(signaling_thread());
 
   // JsepTransportController signal handlers.
-  void OnTransportControllerConnectionState(cricket::IceConnectionState state)
+  void OnTransportControllerConnectionState(::webrtc::IceConnectionState state)
       RTC_RUN_ON(signaling_thread());
   void OnTransportControllerGatheringState(::webrtc::IceGatheringState state)
       RTC_RUN_ON(signaling_thread());
@@ -613,12 +605,12 @@
   bool OnTransportChanged(
       const std::string& mid,
       RtpTransportInternal* rtp_transport,
-      rtc::scoped_refptr<DtlsTransport> dtls_transport,
+      scoped_refptr<DtlsTransport> dtls_transport,
       DataChannelTransportInterface* data_channel_transport) override;
 
   void SetSctpTransportName(std::string sctp_transport_name);
 
-  std::function<void(const rtc::CopyOnWriteBuffer& packet,
+  std::function<void(const webrtc::CopyOnWriteBuffer& packet,
                      int64_t packet_time_us)>
   InitializeRtcpCallback();
 
@@ -628,7 +620,7 @@
   bool CanAttemptDtlsStunPiggybacking(const RTCConfiguration& configuration);
 
   const Environment env_;
-  const rtc::scoped_refptr<ConnectionContext> context_;
+  const scoped_refptr<ConnectionContext> context_;
   const PeerConnectionFactoryInterface::Options options_;
   PeerConnectionObserver* observer_ RTC_GUARDED_BY(signaling_thread()) =
       nullptr;
@@ -671,8 +663,8 @@
   // its own thread safety.
   std::unique_ptr<Call> call_ RTC_GUARDED_BY(worker_thread());
   ScopedTaskSafety signaling_thread_safety_;
-  rtc::scoped_refptr<PendingTaskSafetyFlag> network_thread_safety_;
-  rtc::scoped_refptr<PendingTaskSafetyFlag> worker_thread_safety_;
+  scoped_refptr<PendingTaskSafetyFlag> network_thread_safety_;
+  scoped_refptr<PendingTaskSafetyFlag> worker_thread_safety_;
 
   // Points to the same thing as `call_`. Since it's const, we may read the
   // pointer from any thread.
@@ -682,7 +674,7 @@
 
   std::unique_ptr<LegacyStatsCollector> legacy_stats_
       RTC_GUARDED_BY(signaling_thread());  // A pointer is passed to senders_
-  rtc::scoped_refptr<RTCStatsCollector> stats_collector_
+  scoped_refptr<RTCStatsCollector> stats_collector_
       RTC_GUARDED_BY(signaling_thread());
 
   const std::string session_id_;
diff --git a/pc/peer_connection_adaptation_integrationtest.cc b/pc/peer_connection_adaptation_integrationtest.cc
index 47e2a26..da4f387 100644
--- a/pc/peer_connection_adaptation_integrationtest.cc
+++ b/pc/peer_connection_adaptation_integrationtest.cc
@@ -40,13 +40,13 @@
 namespace webrtc {
 
 struct TrackWithPeriodicSource {
-  rtc::scoped_refptr<VideoTrackInterface> track;
-  rtc::scoped_refptr<FakePeriodicVideoTrackSource> periodic_track_source;
+  scoped_refptr<VideoTrackInterface> track;
+  scoped_refptr<FakePeriodicVideoTrackSource> periodic_track_source;
 };
 
 // Performs an O/A exchange and waits until the signaling state is stable again.
-void Negotiate(rtc::scoped_refptr<PeerConnectionTestWrapper> caller,
-               rtc::scoped_refptr<PeerConnectionTestWrapper> callee) {
+void Negotiate(scoped_refptr<PeerConnectionTestWrapper> caller,
+               scoped_refptr<PeerConnectionTestWrapper> callee) {
   // Wire up callbacks and listeners such that a full O/A is performed in
   // response to CreateOffer().
   PeerConnectionTestWrapper::Connect(caller.get(), callee.get());
@@ -55,12 +55,12 @@
 }
 
 TrackWithPeriodicSource CreateTrackWithPeriodicSource(
-    rtc::scoped_refptr<PeerConnectionFactoryInterface> factory) {
+    scoped_refptr<PeerConnectionFactoryInterface> factory) {
   FakePeriodicVideoSource::Config periodic_track_source_config;
   periodic_track_source_config.frame_interval_ms = 100;
   periodic_track_source_config.timestamp_offset_ms = TimeMillis();
-  rtc::scoped_refptr<FakePeriodicVideoTrackSource> periodic_track_source =
-      rtc::make_ref_counted<FakePeriodicVideoTrackSource>(
+  scoped_refptr<FakePeriodicVideoTrackSource> periodic_track_source =
+      make_ref_counted<FakePeriodicVideoTrackSource>(
           periodic_track_source_config, /* remote */ false);
   TrackWithPeriodicSource track_with_source;
   track_with_source.track =
@@ -74,7 +74,7 @@
 // have yet to reflect the overuse signal. Used together with EXPECT_TRUE_WAIT
 // to "spam overuse until a change is observed".
 VideoSinkWants TriggerOveruseAndGetSinkWants(
-    rtc::scoped_refptr<FakeResource> fake_resource,
+    scoped_refptr<FakeResource> fake_resource,
     const FakePeriodicVideoSource& source) {
   fake_resource->SetUsageState(ResourceUsageState::kOveruse);
   return source.wants();
@@ -90,10 +90,9 @@
     RTC_CHECK(worker_thread_->Start());
   }
 
-  rtc::scoped_refptr<PeerConnectionTestWrapper> CreatePcWrapper(
-      const char* name) {
-    rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper =
-        rtc::make_ref_counted<PeerConnectionTestWrapper>(
+  scoped_refptr<PeerConnectionTestWrapper> CreatePcWrapper(const char* name) {
+    scoped_refptr<PeerConnectionTestWrapper> pc_wrapper =
+        make_ref_counted<PeerConnectionTestWrapper>(
             name, &virtual_socket_server_, network_thread_.get(),
             worker_thread_.get());
     PeerConnectionInterface::RTCConfiguration config;
diff --git a/pc/peer_connection_bundle_unittest.cc b/pc/peer_connection_bundle_unittest.cc
index 2587519..e0f5643 100644
--- a/pc/peer_connection_bundle_unittest.cc
+++ b/pc/peer_connection_bundle_unittest.cc
@@ -230,9 +230,8 @@
 
     auto observer = std::make_unique<MockPeerConnectionObserver>();
     RTCConfiguration modified_config = config;
-    modified_config.set_port_allocator_flags(
-        cricket::PORTALLOCATOR_DISABLE_TCP |
-        cricket::PORTALLOCATOR_DISABLE_RELAY);
+    modified_config.set_port_allocator_flags(PORTALLOCATOR_DISABLE_TCP |
+                                             PORTALLOCATOR_DISABLE_RELAY);
     modified_config.sdp_semantics = sdp_semantics_;
     auto result = pc_factory->CreatePeerConnectionOrError(
         modified_config, PeerConnectionDependencies(observer.get()));
@@ -830,17 +829,17 @@
 
   // Removing the second MID from the BUNDLE group.
   auto* old_bundle_group =
-      offer->description()->GetGroupByName(cricket::GROUP_TYPE_BUNDLE);
+      offer->description()->GetGroupByName(webrtc::GROUP_TYPE_BUNDLE);
   std::string first_mid = old_bundle_group->content_names()[0];
   std::string third_mid = old_bundle_group->content_names()[2];
-  cricket::ContentGroup new_bundle_group(cricket::GROUP_TYPE_BUNDLE);
+  webrtc::ContentGroup new_bundle_group(webrtc::GROUP_TYPE_BUNDLE);
   new_bundle_group.AddContentName(first_mid);
   new_bundle_group.AddContentName(third_mid);
 
   // Reject the entire new bundle group.
   re_offer->description()->contents()[0].rejected = true;
   re_offer->description()->contents()[2].rejected = true;
-  re_offer->description()->RemoveGroupByName(cricket::GROUP_TYPE_BUNDLE);
+  re_offer->description()->RemoveGroupByName(webrtc::GROUP_TYPE_BUNDLE);
   re_offer->description()->AddGroup(new_bundle_group);
 
   EXPECT_TRUE(caller->SetLocalDescription(std::move(re_offer)));
diff --git a/pc/peer_connection_callsetup_perf_tests.cc b/pc/peer_connection_callsetup_perf_tests.cc
index 3ea9096..c8c4ff5 100644
--- a/pc/peer_connection_callsetup_perf_tests.cc
+++ b/pc/peer_connection_callsetup_perf_tests.cc
@@ -58,10 +58,10 @@
     : public ::testing::TestWithParam<
           std::tuple</*field_trials=*/std::string,
                      /*signal_candidates_from_client=*/bool,
-                     /*dtls_role=*/cricket::ConnectionRole>> {
+                     /*dtls_role=*/ConnectionRole>> {
  public:
   PeerConnectionDataChannelOpenTest()
-      : background_thread_(std::make_unique<rtc::Thread>(&vss_)) {
+      : background_thread_(std::make_unique<Thread>(&vss_)) {
     RTC_CHECK(background_thread_->Start());
     // Delay is set to 50ms so we get a 100ms RTT.
     vss_.set_delay_mean(/*delay_ms=*/50);
@@ -79,30 +79,28 @@
   }
 
   void SignalIceCandidates(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> from_pc_wrapper,
-      rtc::scoped_refptr<PeerConnectionTestWrapper> to_pc_wrapper) {
+      scoped_refptr<PeerConnectionTestWrapper> from_pc_wrapper,
+      scoped_refptr<PeerConnectionTestWrapper> to_pc_wrapper) {
     from_pc_wrapper->SignalOnIceCandidateReady.connect(
         to_pc_wrapper.get(), &PeerConnectionTestWrapper::AddIceCandidate);
   }
 
-  void Negotiate(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper,
-      rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper,
-      cricket::ConnectionRole remote_role) {
+  void Negotiate(scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper,
+                 scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper,
+                 ConnectionRole remote_role) {
     std::unique_ptr<SessionDescriptionInterface> offer =
         CreateOffer(local_pc_wrapper);
-    rtc::scoped_refptr<MockSetSessionDescriptionObserver> p1 =
+    scoped_refptr<MockSetSessionDescriptionObserver> p1 =
         SetLocalDescription(local_pc_wrapper, offer.get());
     std::unique_ptr<SessionDescriptionInterface> modified_offer =
         offer->Clone();
     // Modify offer role to get desired remote role.
-    if (remote_role == cricket::CONNECTIONROLE_PASSIVE) {
+    if (remote_role == CONNECTIONROLE_PASSIVE) {
       auto& transport_infos = modified_offer->description()->transport_infos();
       ASSERT_TRUE(!transport_infos.empty());
-      transport_infos[0].description.connection_role =
-          cricket::CONNECTIONROLE_ACTIVE;
+      transport_infos[0].description.connection_role = CONNECTIONROLE_ACTIVE;
     }
-    rtc::scoped_refptr<MockSetSessionDescriptionObserver> p2 =
+    scoped_refptr<MockSetSessionDescriptionObserver> p2 =
         SetRemoteDescription(remote_pc_wrapper, modified_offer.get());
     EXPECT_TRUE(Await({p1, p2}));
     std::unique_ptr<SessionDescriptionInterface> answer =
@@ -112,8 +110,7 @@
     EXPECT_TRUE(Await({p1, p2}));
   }
 
-  bool WaitForDataChannelOpen(
-      rtc::scoped_refptr<webrtc::DataChannelInterface> dc) {
+  bool WaitForDataChannelOpen(scoped_refptr<webrtc::DataChannelInterface> dc) {
     return WaitUntil(
                [&] {
                  return dc->state() == DataChannelInterface::DataState::kOpen;
@@ -124,9 +121,8 @@
 
  protected:
   std::unique_ptr<SessionDescriptionInterface> CreateOffer(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper) {
-    auto observer =
-        rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+      scoped_refptr<PeerConnectionTestWrapper> pc_wrapper) {
+    auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
     pc_wrapper->pc()->CreateOffer(observer.get(), {});
     EXPECT_THAT(WaitUntil([&] { return observer->called(); }, IsTrue()),
                 IsRtcOk());
@@ -134,28 +130,27 @@
   }
 
   std::unique_ptr<SessionDescriptionInterface> CreateAnswer(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper) {
-    auto observer =
-        rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+      scoped_refptr<PeerConnectionTestWrapper> pc_wrapper) {
+    auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
     pc_wrapper->pc()->CreateAnswer(observer.get(), {});
     EXPECT_THAT(WaitUntil([&] { return observer->called(); }, IsTrue()),
                 IsRtcOk());
     return observer->MoveDescription();
   }
 
-  rtc::scoped_refptr<MockSetSessionDescriptionObserver> SetLocalDescription(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
+  scoped_refptr<MockSetSessionDescriptionObserver> SetLocalDescription(
+      scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
       SessionDescriptionInterface* sdp) {
-    auto observer = rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+    auto observer = make_ref_counted<MockSetSessionDescriptionObserver>();
     pc_wrapper->pc()->SetLocalDescription(
         observer.get(), CloneSessionDescription(sdp).release());
     return observer;
   }
 
-  rtc::scoped_refptr<MockSetSessionDescriptionObserver> SetRemoteDescription(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
+  scoped_refptr<MockSetSessionDescriptionObserver> SetRemoteDescription(
+      scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
       SessionDescriptionInterface* sdp) {
-    auto observer = rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+    auto observer = make_ref_counted<MockSetSessionDescriptionObserver>();
     pc_wrapper->pc()->SetRemoteDescription(
         observer.get(), CloneSessionDescription(sdp).release());
     return observer;
@@ -165,8 +160,8 @@
   // the offer it is important to SetLocalDescription() and
   // SetRemoteDescription() are kicked off without awaiting in-between. This
   // helper is used to await multiple observers.
-  bool Await(std::vector<rtc::scoped_refptr<MockSetSessionDescriptionObserver>>
-                 observers) {
+  bool Await(
+      std::vector<scoped_refptr<MockSetSessionDescriptionObserver>> observers) {
     for (auto& observer : observers) {
       auto result = WaitUntil([&] { return observer->called(); }, IsTrue());
 
@@ -177,20 +172,20 @@
     return true;
   }
 
-  rtc::VirtualSocketServer vss_;
-  std::unique_ptr<rtc::Thread> background_thread_;
+  VirtualSocketServer vss_;
+  std::unique_ptr<Thread> background_thread_;
 };
 
 TEST_P(PeerConnectionDataChannelOpenTest, OpenAtCaller) {
   std::string trials = std::get<0>(GetParam());
   bool skip_candidates_from_caller = std::get<1>(GetParam());
-  cricket::ConnectionRole role = std::get<2>(GetParam());
+  ConnectionRole role = std::get<2>(GetParam());
   std::string role_string;
-  ASSERT_TRUE(cricket::ConnectionRoleToString(role, &role_string));
+  ASSERT_TRUE(ConnectionRoleToString(role, &role_string));
 
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper =
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper =
       CreatePc(FieldTrials::CreateNoGlobal(trials));
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper =
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper =
       CreatePc(FieldTrials::CreateNoGlobal(trials));
 
   if (!skip_candidates_from_caller) {
@@ -200,12 +195,12 @@
 
   auto dc = local_pc_wrapper->CreateDataChannel("test", {});
   Negotiate(local_pc_wrapper, remote_pc_wrapper, role);
-  uint64_t start_time = rtc::TimeNanos();
+  uint64_t start_time = TimeNanos();
   EXPECT_TRUE(WaitForDataChannelOpen(dc));
-  uint64_t open_time = rtc::TimeNanos();
+  uint64_t open_time = TimeNanos();
   uint64_t setup_time = open_time - start_time;
 
-  double setup_time_millis = setup_time / rtc::kNumNanosecsPerMillisec;
+  double setup_time_millis = setup_time / kNumNanosecsPerMillisec;
   std::string test_description =
       "emulate_server=" + absl::StrCat(skip_candidates_from_caller) +
       "/dtls_role=" + role_string + "/trials=" + trials;
@@ -236,10 +231,10 @@
         testing::Values(
             // Default, other side will send
             // the DTLS handshake.
-            cricket::CONNECTIONROLE_ACTIVE,
+            CONNECTIONROLE_ACTIVE,
             // Local side will send the DTLS
             // handshake.
-            cricket::CONNECTIONROLE_PASSIVE)));
+            CONNECTIONROLE_PASSIVE)));
 
 #endif  // WEBRTC_HAVE_SCTP
 
diff --git a/pc/peer_connection_crypto_unittest.cc b/pc/peer_connection_crypto_unittest.cc
index 0de4aec..fd0f3f6 100644
--- a/pc/peer_connection_crypto_unittest.cc
+++ b/pc/peer_connection_crypto_unittest.cc
@@ -156,7 +156,7 @@
 
   std::unique_ptr<VirtualSocketServer> vss_;
   AutoSocketServerThread main_;
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
+  scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
   const SdpSemantics sdp_semantics_;
 };
 
@@ -167,10 +167,10 @@
 }
 
 SdpContentPredicate HaveProtocol(const std::string& protocol) {
-  return [protocol](const cricket::ContentInfo* content,
-                    const cricket::TransportInfo* transport) {
-    return content->media_description()->protocol() == protocol;
-  };
+  return
+      [protocol](const ContentInfo* content, const TransportInfo* transport) {
+        return content->media_description()->protocol() == protocol;
+      };
 }
 
 class PeerConnectionCryptoTest
@@ -385,11 +385,10 @@
     ASSERT_EQ(fake_certificate_generator->generated_certificates(), 0);
     fake_certificate_generator->set_should_wait(false);
   }
-  std::vector<rtc::scoped_refptr<MockCreateSessionDescriptionObserver>>
-      observers;
+  std::vector<scoped_refptr<MockCreateSessionDescriptionObserver>> observers;
   for (size_t i = 0; i < concurrent_calls_; i++) {
-    rtc::scoped_refptr<MockCreateSessionDescriptionObserver> observer =
-        rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+    scoped_refptr<MockCreateSessionDescriptionObserver> observer =
+        make_ref_counted<MockCreateSessionDescriptionObserver>();
     observers.push_back(observer);
     if (sdp_type_ == SdpType::kOffer) {
       pc->pc()->CreateOffer(observer.get(),
diff --git a/pc/peer_connection_data_channel_unittest.cc b/pc/peer_connection_data_channel_unittest.cc
index 79fc4d0..47a85a5 100644
--- a/pc/peer_connection_data_channel_unittest.cc
+++ b/pc/peer_connection_data_channel_unittest.cc
@@ -117,7 +117,7 @@
     auto factory_deps = CreatePeerConnectionFactoryDependencies();
     FakeSctpTransportFactory* fake_sctp_transport_factory =
         static_cast<FakeSctpTransportFactory*>(factory_deps.sctp_factory.get());
-    rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory =
+    scoped_refptr<PeerConnectionFactoryInterface> pc_factory =
         CreateModularPeerConnectionFactory(std::move(factory_deps));
     pc_factory->SetOptions(factory_options);
     auto observer = std::make_unique<MockPeerConnectionObserver>();
@@ -183,7 +183,7 @@
   ASSERT_TRUE(caller->SetLocalDescription(caller->CreateOffer()));
   EXPECT_TRUE(caller->sctp_transport_factory()->last_fake_sctp_transport());
 
-  rtc::scoped_refptr<SctpTransportInterface> sctp_transport =
+  scoped_refptr<SctpTransportInterface> sctp_transport =
       caller->GetInternalPeerConnection()->GetSctpTransport();
 
   caller.reset();
diff --git a/pc/peer_connection_encodings_integrationtest.cc b/pc/peer_connection_encodings_integrationtest.cc
index db43ca7..2834f4c 100644
--- a/pc/peer_connection_encodings_integrationtest.cc
+++ b/pc/peer_connection_encodings_integrationtest.cc
@@ -203,7 +203,7 @@
 };
 
 std::string GetCurrentCodecMimeType(
-    rtc::scoped_refptr<const RTCStatsReport> report,
+    scoped_refptr<const RTCStatsReport> report,
     const RTCOutboundRtpStreamStats& outbound_rtp) {
   return outbound_rtp.codec_id.has_value()
              ? *report->GetAs<RTCCodecStats>(*outbound_rtp.codec_id)->mime_type
@@ -240,24 +240,23 @@
     return pc_wrapper;
   }
 
-  rtc::scoped_refptr<RtpTransceiverInterface> AddTransceiverWithSimulcastLayers(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> local,
-      rtc::scoped_refptr<PeerConnectionTestWrapper> remote,
+  scoped_refptr<RtpTransceiverInterface> AddTransceiverWithSimulcastLayers(
+      scoped_refptr<PeerConnectionTestWrapper> local,
+      scoped_refptr<PeerConnectionTestWrapper> remote,
       std::vector<SimulcastLayer> init_layers) {
-    rtc::scoped_refptr<MediaStreamInterface> stream = local->GetUserMedia(
+    scoped_refptr<MediaStreamInterface> stream = local->GetUserMedia(
         /*audio=*/false, AudioOptions(), /*video=*/true,
         {.width = 1280, .height = 720});
-    rtc::scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
+    scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
 
-    RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
-        transceiver_or_error = local->pc()->AddTransceiver(
-            track, CreateTransceiverInit(init_layers));
+    RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> transceiver_or_error =
+        local->pc()->AddTransceiver(track, CreateTransceiverInit(init_layers));
     EXPECT_TRUE(transceiver_or_error.ok());
     return transceiver_or_error.value();
   }
 
   bool HasReceiverVideoCodecCapability(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
+      scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
       absl::string_view codec_name) {
     std::vector<RtpCodecCapability> codecs =
         pc_wrapper->pc_factory()
@@ -270,7 +269,7 @@
   }
 
   std::vector<RtpCodecCapability> GetCapabilitiesAndRestrictToCodec(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
+      scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
       absl::string_view codec_name) {
     std::vector<RtpCodecCapability> codecs =
         pc_wrapper->pc_factory()
@@ -292,8 +291,8 @@
   }
 
   void ExchangeIceCandidates(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper,
-      rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper) {
+      scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper,
+      scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper) {
     local_pc_wrapper->SignalOnIceCandidateReady.connect(
         remote_pc_wrapper.get(), &PeerConnectionTestWrapper::AddIceCandidate);
     remote_pc_wrapper->SignalOnIceCandidateReady.connect(
@@ -301,14 +300,13 @@
   }
 
   // Negotiate without any tweaks (does not work for simulcast loopback).
-  void Negotiate(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper,
-      rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper) {
+  void Negotiate(scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper,
+                 scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper) {
     std::unique_ptr<SessionDescriptionInterface> offer =
         CreateOffer(local_pc_wrapper);
-    rtc::scoped_refptr<MockSetSessionDescriptionObserver> p1 =
+    scoped_refptr<MockSetSessionDescriptionObserver> p1 =
         SetLocalDescription(local_pc_wrapper, offer.get());
-    rtc::scoped_refptr<MockSetSessionDescriptionObserver> p2 =
+    scoped_refptr<MockSetSessionDescriptionObserver> p2 =
         SetRemoteDescription(remote_pc_wrapper, offer.get());
     EXPECT_TRUE(Await({p1, p2}));
     std::unique_ptr<SessionDescriptionInterface> answer =
@@ -319,17 +317,17 @@
   }
 
   void NegotiateWithSimulcastTweaks(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper,
-      rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper) {
+      scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper,
+      scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper) {
     // Create and set offer for `local_pc_wrapper`.
     std::unique_ptr<SessionDescriptionInterface> offer =
         CreateOffer(local_pc_wrapper);
-    rtc::scoped_refptr<MockSetSessionDescriptionObserver> p1 =
+    scoped_refptr<MockSetSessionDescriptionObserver> p1 =
         SetLocalDescription(local_pc_wrapper, offer.get());
     // Modify the offer before handoff because `remote_pc_wrapper` only supports
     // receiving singlecast.
     SimulcastDescription simulcast_description = RemoveSimulcast(offer.get());
-    rtc::scoped_refptr<MockSetSessionDescriptionObserver> p2 =
+    scoped_refptr<MockSetSessionDescriptionObserver> p2 =
         SetRemoteDescription(remote_pc_wrapper, offer.get());
     EXPECT_TRUE(Await({p1, p2}));
 
@@ -354,9 +352,9 @@
     EXPECT_TRUE(Await({p1, p2}));
   }
 
-  rtc::scoped_refptr<const RTCStatsReport> GetStats(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper) {
-    auto callback = rtc::make_ref_counted<MockRTCStatsCollectorCallback>();
+  scoped_refptr<const RTCStatsReport> GetStats(
+      scoped_refptr<PeerConnectionTestWrapper> pc_wrapper) {
+    auto callback = make_ref_counted<MockRTCStatsCollectorCallback>();
     pc_wrapper->pc()->GetStats(callback.get());
     RTC_CHECK(WaitUntil([&]() { return callback->called(); }, testing::IsTrue())
                   .ok());
@@ -373,9 +371,8 @@
 
  protected:
   std::unique_ptr<SessionDescriptionInterface> CreateOffer(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper) {
-    auto observer =
-        rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+      scoped_refptr<PeerConnectionTestWrapper> pc_wrapper) {
+    auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
     pc_wrapper->pc()->CreateOffer(observer.get(), {});
     EXPECT_THAT(WaitUntil([&] { return observer->called(); }, IsTrue()),
                 IsRtcOk());
@@ -383,28 +380,27 @@
   }
 
   std::unique_ptr<SessionDescriptionInterface> CreateAnswer(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper) {
-    auto observer =
-        rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+      scoped_refptr<PeerConnectionTestWrapper> pc_wrapper) {
+    auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
     pc_wrapper->pc()->CreateAnswer(observer.get(), {});
     EXPECT_THAT(WaitUntil([&] { return observer->called(); }, IsTrue()),
                 IsRtcOk());
     return observer->MoveDescription();
   }
 
-  rtc::scoped_refptr<MockSetSessionDescriptionObserver> SetLocalDescription(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
+  scoped_refptr<MockSetSessionDescriptionObserver> SetLocalDescription(
+      scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
       SessionDescriptionInterface* sdp) {
-    auto observer = rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+    auto observer = make_ref_counted<MockSetSessionDescriptionObserver>();
     pc_wrapper->pc()->SetLocalDescription(
         observer.get(), CloneSessionDescription(sdp).release());
     return observer;
   }
 
-  rtc::scoped_refptr<MockSetSessionDescriptionObserver> SetRemoteDescription(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
+  scoped_refptr<MockSetSessionDescriptionObserver> SetRemoteDescription(
+      scoped_refptr<PeerConnectionTestWrapper> pc_wrapper,
       SessionDescriptionInterface* sdp) {
-    auto observer = rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+    auto observer = make_ref_counted<MockSetSessionDescriptionObserver>();
     pc_wrapper->pc()->SetRemoteDescription(
         observer.get(), CloneSessionDescription(sdp).release());
     return observer;
@@ -414,8 +410,8 @@
   // the offer it is important to SetLocalDescription() and
   // SetRemoteDescription() are kicked off without awaiting in-between. This
   // helper is used to await multiple observers.
-  bool Await(std::vector<rtc::scoped_refptr<MockSetSessionDescriptionObserver>>
-                 observers) {
+  bool Await(
+      std::vector<scoped_refptr<MockSetSessionDescriptionObserver>> observers) {
     for (auto& observer : observers) {
       auto result = WaitUntil([&] { return observer->called(); }, IsTrue());
 
@@ -432,12 +428,12 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP8_SingleEncodingDefaultsToL1T1) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers = CreateLayers({"f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -456,7 +452,7 @@
               ElementsAre(Pair("", ResolutionIs(1280, 720))));
 
   // Verify codec and scalability mode.
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_result.value();
+  scoped_refptr<const RTCStatsReport> report = stats_result.value();
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(1u));
@@ -468,12 +464,12 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP8_RejectsSvcAndDefaultsToL1T1) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers = CreateLayers({"f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   // Restricting the local receive codecs will restrict what we offer and
@@ -486,7 +482,7 @@
 
   // Attempt SVC (L3T3_KEY). This is not possible because only VP8 is up for
   // negotiation and VP8 does not support it.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_EQ(parameters.encodings.size(), 1u);
   parameters.encodings[0].scalability_mode = "L3T3_KEY";
@@ -504,7 +500,7 @@
   ASSERT_THAT(GetStatsUntil(local_pc_wrapper, HasOutboundRtpBytesSent(1)),
               IsRtcOk());
   // When `scalability_mode` is not set, VP8 defaults to L1T1.
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(1u));
@@ -519,12 +515,12 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        SetParametersWithScalabilityModeNotSupportedBySubsequentNegotiation) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers = CreateLayers({"f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   // Restricting the local receive codecs will restrict what we offer and
@@ -535,7 +531,7 @@
 
   // Attempt SVC (L3T3_KEY). This is still possible because VP9 might be
   // available from the remote end.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_EQ(parameters.encodings.size(), 1u);
   parameters.encodings[0].scalability_mode = "L3T3_KEY";
@@ -558,7 +554,7 @@
       GetStatsUntil(local_pc_wrapper, HasOutboundRtpBytesSent(1));
   ASSERT_THAT(error_or_stats, IsRtcOk());
   // When `scalability_mode` is not set, VP8 defaults to L1T1.
-  rtc::scoped_refptr<const RTCStatsReport> report = error_or_stats.value();
+  scoped_refptr<const RTCStatsReport> report = error_or_stats.value();
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(1u));
@@ -573,12 +569,12 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP8_FallbackFromSvcResultsInL1T2) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers = CreateLayers({"f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   // Verify test assumption that VP8 is first in the list, but don't modify the
@@ -590,7 +586,7 @@
   EXPECT_THAT(codecs[0].name, StrCaseEq("VP8"));
   // Attempt SVC (L3T3_KEY), which is not possible with VP8, but the sender does
   // not yet know which codec we'll use so the parameters will be accepted.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_EQ(parameters.encodings.size(), 1u);
   parameters.encodings[0].scalability_mode = "L3T3_KEY";
@@ -619,7 +615,7 @@
               IsRtcOk());
   // GetStats() confirms "L1T2" is used which is different than the "L1T1"
   // default or the "L3T3_KEY" that was attempted.
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(1u));
@@ -642,13 +638,13 @@
 // (i.e. VP9 is not treated differently than VP8).
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP9_LegacySvcWhenScalabilityModeNotSpecified) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "h", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -676,7 +672,7 @@
   // Despite SVC being used on a single RTP stream, GetParameters() returns the
   // three encodings that we configured earlier (this is not spec-compliant but
   // it is how legacy SVC behaves).
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   std::vector<RtpEncodingParameters> encodings =
       sender->GetParameters().encodings;
   ASSERT_EQ(encodings.size(), 3u);
@@ -691,19 +687,19 @@
 // encoding in GetParameters().
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP9_StandardSvcWithOnlyOneEncoding) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers = CreateLayers({"f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
       GetCapabilitiesAndRestrictToCodec(remote_pc_wrapper, "VP9");
   transceiver->SetCodecPreferences(codecs);
   // Configure SVC, a.k.a. "L3T3_KEY".
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_EQ(parameters.encodings.size(), 1u);
   parameters.encodings[0].scalability_mode = "L3T3_KEY";
@@ -748,20 +744,20 @@
 // observable in GetStats().
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP9_StandardSvcWithSingleActiveEncoding) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "h", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
       GetCapabilitiesAndRestrictToCodec(remote_pc_wrapper, "VP9");
   transceiver->SetCodecPreferences(codecs);
   // Configure SVC, a.k.a. "L3T3_KEY".
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   parameters.encodings[0].scalability_mode = "L3T3_KEY";
@@ -800,13 +796,13 @@
 // changes from 1 (legacy SVC) to 3 (standard simulcast).
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP9_SwitchFromLegacySvcToStandardSingleActiveEncodingSvc) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "h", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -822,7 +818,7 @@
   // Switch to the standard mode. Despite only having a single active stream in
   // both cases, this internally reconfigures from 1 stream to 3 streams.
   // Test coverage for https://crbug.com/webrtc/15016.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   parameters.encodings[0].active = true;
@@ -857,13 +853,13 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP9_SimulcastDeactiveActiveLayer_StandardSvc) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"q", "h", "f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   constexpr absl::string_view kCodec = "VP9";
@@ -874,7 +870,7 @@
   // Switch to the standard mode. Despite only having a single active stream in
   // both cases, this internally reconfigures from 1 stream to 3 streams.
   // Test coverage for https://crbug.com/webrtc/15016.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   parameters.encodings[0].active = true;
@@ -911,7 +907,7 @@
           },
           AllOf(SizeIs(3), Each(Gt(0))), {.timeout = kLongTimeoutForRampingUp}),
       IsRtcOk());
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   ASSERT_TRUE(report);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
@@ -950,13 +946,13 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP9_SimulcastMultiplLayersActive_StandardSvc) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"q", "h", "f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -966,7 +962,7 @@
   // Switch to the standard mode. Despite only having a single active stream in
   // both cases, this internally reconfigures from 1 stream to 3 streams.
   // Test coverage for https://crbug.com/webrtc/15016.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   parameters.encodings[0].active = true;
@@ -998,7 +994,7 @@
                               HeightIs(720 / 2), BytesSentIs(Gt(0)))})),
       {.timeout = kLongTimeoutForRampingUp});
   ASSERT_THAT(error_or_stats, IsRtcOk());
-  rtc::scoped_refptr<const RTCStatsReport> report = error_or_stats.value();
+  scoped_refptr<const RTCStatsReport> report = error_or_stats.value();
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   EXPECT_THAT(outbound_rtps, Each(EncoderImplementationIs(
@@ -1016,13 +1012,13 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP9_Simulcast_SwitchToLegacySvc) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "h", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -1032,7 +1028,7 @@
   // Switch to the standard mode. Despite only having a single active stream in
   // both cases, this internally reconfigures from 1 stream to 3 streams.
   // Test coverage for https://crbug.com/webrtc/15016.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   parameters.encodings[0].active = false;
@@ -1095,13 +1091,13 @@
 }
 
 TEST_F(PeerConnectionEncodingsIntegrationTest, VP9_OneLayerActive_LegacySvc) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "h", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -1109,7 +1105,7 @@
   transceiver->SetCodecPreferences(codecs);
 
   // Sending L1T3 with legacy SVC mode means setting 1 layer active.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   parameters.encodings[0].active = true;
@@ -1133,13 +1129,13 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP9_AllLayersInactive_LegacySvc) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "h", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -1147,7 +1143,7 @@
   transceiver->SetCodecPreferences(codecs);
 
   // Legacy SVC mode and all layers inactive.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   parameters.encodings[0].active = false;
@@ -1161,7 +1157,7 @@
 
   // Ensure no media is flowing (1 second should be enough).
   Thread::Current()->SleepMs(1000);
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(1u));
@@ -1170,13 +1166,13 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        VP9_AllLayersInactive_StandardSvc) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "h", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -1184,7 +1180,7 @@
   transceiver->SetCodecPreferences(codecs);
 
   // Standard mode and all layers inactive.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   parameters.encodings[0].scalability_mode = "L3T3_KEY";
@@ -1200,7 +1196,7 @@
 
   // Ensure no media is flowing (1 second should be enough).
   Thread::Current()->SleepMs(1000);
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(3u));
@@ -1210,13 +1206,13 @@
 }
 
 TEST_F(PeerConnectionEncodingsIntegrationTest, VP9_TargetBitrate_LegacyL1T3) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "h", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -1225,7 +1221,7 @@
 
   // In legacy SVC, disabling the bottom two layers encodings is interpreted as
   // disabling the bottom two spatial layers resulting in L1T3.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   parameters.encodings[0].active = false;
   parameters.encodings[1].active = false;
@@ -1249,7 +1245,7 @@
   // in a short period of time. However to reduce risk of flakiness in bot
   // environments, this test only fails if we we exceed the expected target.
   Thread::Current()->SleepMs(1000);
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(1));
@@ -1260,13 +1256,13 @@
 
 // Test coverage for https://crbug.com/1455039.
 TEST_F(PeerConnectionEncodingsIntegrationTest, VP9_TargetBitrate_StandardL1T3) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "h", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -1276,7 +1272,7 @@
   // With standard APIs, L1T3 is explicitly specified and the encodings refers
   // to the RTP streams, not the spatial layers. The end result should be
   // equivalent to the legacy L1T3 case.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   parameters.encodings[0].active = true;
   parameters.encodings[0].scale_resolution_down_by = 1.0;
@@ -1302,7 +1298,7 @@
   // in a short period of time. However to reduce risk of flakiness in bot
   // environments, this test only fails if we we exceed the expected target.
   Thread::Current()->SleepMs(1000);
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(3));
@@ -1314,13 +1310,13 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        SimulcastProducesUniqueSsrcAndRtxSsrcs) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "h", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -1337,7 +1333,7 @@
                              {.timeout = kLongTimeoutForRampingUp});
   ASSERT_THAT(stats, IsRtcOk());
   // Verify SSRCs and RTX SSRCs.
-  rtc::scoped_refptr<const RTCStatsReport> report = stats.MoveValue();
+  scoped_refptr<const RTCStatsReport> report = stats.MoveValue();
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(3u));
@@ -1356,11 +1352,11 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        EncodingParameterCodecIsEmptyWhenCreatedAudio) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
 
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::AUDIO);
-  rtc::scoped_refptr<RtpTransceiverInterface> audio_transceiver =
+  scoped_refptr<RtpTransceiverInterface> audio_transceiver =
       transceiver_or_error.MoveValue();
   RtpParameters parameters = audio_transceiver->sender()->GetParameters();
   EXPECT_FALSE(parameters.encodings[0].codec.has_value());
@@ -1368,11 +1364,11 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        EncodingParameterCodecIsEmptyWhenCreatedVideo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
 
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::VIDEO);
-  rtc::scoped_refptr<RtpTransceiverInterface> video_transceiver =
+  scoped_refptr<RtpTransceiverInterface> video_transceiver =
       transceiver_or_error.MoveValue();
   RtpParameters parameters = video_transceiver->sender()->GetParameters();
   EXPECT_FALSE(parameters.encodings[0].codec.has_value());
@@ -1380,14 +1376,13 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        EncodingParameterCodecIsSetByAddTransceiverAudio) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
-  rtc::scoped_refptr<MediaStreamInterface> stream =
-      local_pc_wrapper->GetUserMedia(
-          /*audio=*/true, {}, /*video=*/false, {});
-  rtc::scoped_refptr<AudioTrackInterface> track = stream->GetAudioTracks()[0];
+  scoped_refptr<MediaStreamInterface> stream = local_pc_wrapper->GetUserMedia(
+      /*audio=*/true, {}, /*video=*/false, {});
+  scoped_refptr<AudioTrackInterface> track = stream->GetAudioTracks()[0];
 
   std::optional<RtpCodecCapability> pcmu =
       local_pc_wrapper->FindFirstSendCodecWithName(webrtc::MediaType::AUDIO,
@@ -1402,7 +1397,7 @@
 
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(track, init);
-  rtc::scoped_refptr<RtpTransceiverInterface> audio_transceiver =
+  scoped_refptr<RtpTransceiverInterface> audio_transceiver =
       transceiver_or_error.MoveValue();
   RtpParameters parameters = audio_transceiver->sender()->GetParameters();
   EXPECT_EQ(*parameters.encodings[0].codec, *pcmu);
@@ -1411,7 +1406,7 @@
   ASSERT_TRUE(local_pc_wrapper->WaitForConnection());
   ASSERT_TRUE(remote_pc_wrapper->WaitForConnection());
 
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_EQ(outbound_rtps.size(), 1u);
@@ -1421,14 +1416,13 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        EncodingParameterCodecIsSetByAddTransceiverVideo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
-  rtc::scoped_refptr<MediaStreamInterface> stream =
-      local_pc_wrapper->GetUserMedia(
-          /*audio=*/false, {}, /*video=*/true, {.width = 1280, .height = 720});
-  rtc::scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
+  scoped_refptr<MediaStreamInterface> stream = local_pc_wrapper->GetUserMedia(
+      /*audio=*/false, {}, /*video=*/true, {.width = 1280, .height = 720});
+  scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
 
   std::optional<RtpCodecCapability> vp9 =
       local_pc_wrapper->FindFirstSendCodecWithName(webrtc::MediaType::VIDEO,
@@ -1444,7 +1438,7 @@
 
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(track, init);
-  rtc::scoped_refptr<RtpTransceiverInterface> audio_transceiver =
+  scoped_refptr<RtpTransceiverInterface> audio_transceiver =
       transceiver_or_error.MoveValue();
   RtpParameters parameters = audio_transceiver->sender()->GetParameters();
   EXPECT_EQ(*parameters.encodings[0].codec, *vp9);
@@ -1457,7 +1451,7 @@
       GetStatsUntil(local_pc_wrapper,
                     OutboundRtpStatsAre(Contains(ScalabilityModeIs("L3T3"))));
   ASSERT_THAT(error_or_stats, IsRtcOk());
-  rtc::scoped_refptr<const RTCStatsReport> report = error_or_stats.MoveValue();
+  scoped_refptr<const RTCStatsReport> report = error_or_stats.MoveValue();
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_EQ(outbound_rtps.size(), 1u);
@@ -1468,21 +1462,20 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        EncodingParameterCodecIsSetBySetParametersBeforeNegotiationAudio) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
-  rtc::scoped_refptr<MediaStreamInterface> stream =
-      local_pc_wrapper->GetUserMedia(
-          /*audio=*/true, {}, /*video=*/false, {});
-  rtc::scoped_refptr<AudioTrackInterface> track = stream->GetAudioTracks()[0];
+  scoped_refptr<MediaStreamInterface> stream = local_pc_wrapper->GetUserMedia(
+      /*audio=*/true, {}, /*video=*/false, {});
+  scoped_refptr<AudioTrackInterface> track = stream->GetAudioTracks()[0];
 
   std::optional<RtpCodecCapability> pcmu =
       local_pc_wrapper->FindFirstSendCodecWithName(webrtc::MediaType::AUDIO,
                                                    "pcmu");
 
   auto transceiver_or_error = local_pc_wrapper->pc()->AddTransceiver(track);
-  rtc::scoped_refptr<RtpTransceiverInterface> audio_transceiver =
+  scoped_refptr<RtpTransceiverInterface> audio_transceiver =
       transceiver_or_error.MoveValue();
   RtpParameters parameters = audio_transceiver->sender()->GetParameters();
   parameters.encodings[0].codec = pcmu;
@@ -1495,7 +1488,7 @@
   local_pc_wrapper->WaitForConnection();
   remote_pc_wrapper->WaitForConnection();
 
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_EQ(outbound_rtps.size(), 1u);
@@ -1505,28 +1498,27 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        EncodingParameterCodecIsSetBySetParametersAfterNegotiationAudio) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
-  rtc::scoped_refptr<MediaStreamInterface> stream =
-      local_pc_wrapper->GetUserMedia(
-          /*audio=*/true, {}, /*video=*/false, {});
-  rtc::scoped_refptr<AudioTrackInterface> track = stream->GetAudioTracks()[0];
+  scoped_refptr<MediaStreamInterface> stream = local_pc_wrapper->GetUserMedia(
+      /*audio=*/true, {}, /*video=*/false, {});
+  scoped_refptr<AudioTrackInterface> track = stream->GetAudioTracks()[0];
 
   std::optional<RtpCodecCapability> pcmu =
       local_pc_wrapper->FindFirstSendCodecWithName(webrtc::MediaType::AUDIO,
                                                    "pcmu");
 
   auto transceiver_or_error = local_pc_wrapper->pc()->AddTransceiver(track);
-  rtc::scoped_refptr<RtpTransceiverInterface> audio_transceiver =
+  scoped_refptr<RtpTransceiverInterface> audio_transceiver =
       transceiver_or_error.MoveValue();
 
   NegotiateWithSimulcastTweaks(local_pc_wrapper, remote_pc_wrapper);
   local_pc_wrapper->WaitForConnection();
   remote_pc_wrapper->WaitForConnection();
 
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_EQ(outbound_rtps.size(), 1u);
@@ -1554,21 +1546,20 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        EncodingParameterCodecIsSetBySetParametersBeforeNegotiationVideo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
-  rtc::scoped_refptr<MediaStreamInterface> stream =
-      local_pc_wrapper->GetUserMedia(
-          /*audio=*/false, {}, /*video=*/true, {.width = 1280, .height = 720});
-  rtc::scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
+  scoped_refptr<MediaStreamInterface> stream = local_pc_wrapper->GetUserMedia(
+      /*audio=*/false, {}, /*video=*/true, {.width = 1280, .height = 720});
+  scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
 
   std::optional<RtpCodecCapability> vp9 =
       local_pc_wrapper->FindFirstSendCodecWithName(webrtc::MediaType::VIDEO,
                                                    "vp9");
 
   auto transceiver_or_error = local_pc_wrapper->pc()->AddTransceiver(track);
-  rtc::scoped_refptr<RtpTransceiverInterface> video_transceiver =
+  scoped_refptr<RtpTransceiverInterface> video_transceiver =
       transceiver_or_error.MoveValue();
   RtpParameters parameters = video_transceiver->sender()->GetParameters();
   parameters.encodings[0].codec = vp9;
@@ -1587,7 +1578,7 @@
       local_pc_wrapper, OutboundRtpStatsAre(Contains(AllOf(
                             ScalabilityModeIs("L3T3"), CodecIs(Ne(""))))));
   ASSERT_THAT(error_or_stats, IsRtcOk());
-  rtc::scoped_refptr<const RTCStatsReport> report = error_or_stats.MoveValue();
+  scoped_refptr<const RTCStatsReport> report = error_or_stats.MoveValue();
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_EQ(outbound_rtps.size(), 1u);
@@ -1598,28 +1589,27 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        EncodingParameterCodecIsSetBySetParametersAfterNegotiationVideo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
-  rtc::scoped_refptr<MediaStreamInterface> stream =
-      local_pc_wrapper->GetUserMedia(
-          /*audio=*/false, {}, /*video=*/true, {.width = 1280, .height = 720});
-  rtc::scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
+  scoped_refptr<MediaStreamInterface> stream = local_pc_wrapper->GetUserMedia(
+      /*audio=*/false, {}, /*video=*/true, {.width = 1280, .height = 720});
+  scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
 
   std::optional<RtpCodecCapability> vp9 =
       local_pc_wrapper->FindFirstSendCodecWithName(webrtc::MediaType::VIDEO,
                                                    "vp9");
 
   auto transceiver_or_error = local_pc_wrapper->pc()->AddTransceiver(track);
-  rtc::scoped_refptr<RtpTransceiverInterface> video_transceiver =
+  scoped_refptr<RtpTransceiverInterface> video_transceiver =
       transceiver_or_error.MoveValue();
 
   NegotiateWithSimulcastTweaks(local_pc_wrapper, remote_pc_wrapper);
   local_pc_wrapper->WaitForConnection();
   remote_pc_wrapper->WaitForConnection();
 
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_EQ(outbound_rtps.size(), 1u);
@@ -1651,7 +1641,7 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        AddTransceiverRejectsUnknownCodecParameterAudio) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
 
   RtpCodec dummy_codec;
   dummy_codec.kind = webrtc::MediaType::AUDIO;
@@ -1674,7 +1664,7 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        AddTransceiverRejectsUnknownCodecParameterVideo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
 
   RtpCodec dummy_codec;
   dummy_codec.kind = webrtc::MediaType::VIDEO;
@@ -1696,7 +1686,7 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        SetParametersRejectsUnknownCodecParameterAudio) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
 
   RtpCodec dummy_codec;
   dummy_codec.kind = webrtc::MediaType::AUDIO;
@@ -1707,7 +1697,7 @@
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::AUDIO);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> audio_transceiver =
+  scoped_refptr<RtpTransceiverInterface> audio_transceiver =
       transceiver_or_error.MoveValue();
 
   RtpParameters parameters = audio_transceiver->sender()->GetParameters();
@@ -1718,7 +1708,7 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        SetParametersRejectsUnknownCodecParameterVideo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
 
   RtpCodec dummy_codec;
   dummy_codec.kind = webrtc::MediaType::VIDEO;
@@ -1728,7 +1718,7 @@
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::VIDEO);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> video_transceiver =
+  scoped_refptr<RtpTransceiverInterface> video_transceiver =
       transceiver_or_error.MoveValue();
 
   RtpParameters parameters = video_transceiver->sender()->GetParameters();
@@ -1739,8 +1729,8 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        SetParametersRejectsNonNegotiatedCodecParameterAudio) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::optional<RtpCodecCapability> opus =
@@ -1762,7 +1752,7 @@
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::AUDIO);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> audio_transceiver =
+  scoped_refptr<RtpTransceiverInterface> audio_transceiver =
       transceiver_or_error.MoveValue();
   ASSERT_TRUE(audio_transceiver->SetCodecPreferences(not_opus_codecs).ok());
 
@@ -1778,8 +1768,8 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        SetParametersRejectsNonRemotelyNegotiatedCodecParameterAudio) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::optional<RtpCodecCapability> opus =
@@ -1801,23 +1791,23 @@
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::AUDIO);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> audio_transceiver =
+  scoped_refptr<RtpTransceiverInterface> audio_transceiver =
       transceiver_or_error.MoveValue();
 
   // Negotiation, create offer and apply it
   std::unique_ptr<SessionDescriptionInterface> offer =
       CreateOffer(local_pc_wrapper);
-  rtc::scoped_refptr<MockSetSessionDescriptionObserver> p1 =
+  scoped_refptr<MockSetSessionDescriptionObserver> p1 =
       SetLocalDescription(local_pc_wrapper, offer.get());
-  rtc::scoped_refptr<MockSetSessionDescriptionObserver> p2 =
+  scoped_refptr<MockSetSessionDescriptionObserver> p2 =
       SetRemoteDescription(remote_pc_wrapper, offer.get());
   EXPECT_TRUE(Await({p1, p2}));
 
   // Update the remote transceiver to reject Opus
-  std::vector<rtc::scoped_refptr<RtpTransceiverInterface>> remote_transceivers =
+  std::vector<scoped_refptr<RtpTransceiverInterface>> remote_transceivers =
       remote_pc_wrapper->pc()->GetTransceivers();
   ASSERT_TRUE(!remote_transceivers.empty());
-  rtc::scoped_refptr<RtpTransceiverInterface> remote_audio_transceiver =
+  scoped_refptr<RtpTransceiverInterface> remote_audio_transceiver =
       remote_transceivers[0];
   ASSERT_TRUE(
       remote_audio_transceiver->SetCodecPreferences(not_opus_codecs).ok());
@@ -1845,14 +1835,14 @@
 // still work.
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        SetParametersAcceptsMungedCodecFromGetParameters) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::VIDEO);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> video_transceiver =
+  scoped_refptr<RtpTransceiverInterface> video_transceiver =
       transceiver_or_error.MoveValue();
 
   std::unique_ptr<SessionDescriptionInterface> offer =
@@ -1867,9 +1857,9 @@
   vp8_codec->params.emplace("non-standard-param", "true");
   mcd->set_codecs(codecs);
 
-  rtc::scoped_refptr<MockSetSessionDescriptionObserver> p1 =
+  scoped_refptr<MockSetSessionDescriptionObserver> p1 =
       SetLocalDescription(local_pc_wrapper, offer.get());
-  rtc::scoped_refptr<MockSetSessionDescriptionObserver> p2 =
+  scoped_refptr<MockSetSessionDescriptionObserver> p2 =
       SetRemoteDescription(remote_pc_wrapper, offer.get());
   EXPECT_TRUE(Await({p1, p2}));
 
@@ -1906,8 +1896,8 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        SetParametersRejectsNonNegotiatedCodecParameterVideo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::optional<RtpCodecCapability> vp8 =
@@ -1929,7 +1919,7 @@
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::VIDEO);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> video_transceiver =
+  scoped_refptr<RtpTransceiverInterface> video_transceiver =
       transceiver_or_error.MoveValue();
   ASSERT_TRUE(video_transceiver->SetCodecPreferences(not_vp8_codecs).ok());
 
@@ -1945,8 +1935,8 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        SetParametersRejectsNonRemotelyNegotiatedCodecParameterVideo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::optional<RtpCodecCapability> vp8 =
@@ -1968,23 +1958,23 @@
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::VIDEO);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> video_transceiver =
+  scoped_refptr<RtpTransceiverInterface> video_transceiver =
       transceiver_or_error.MoveValue();
 
   // Negotiation, create offer and apply it
   std::unique_ptr<SessionDescriptionInterface> offer =
       CreateOffer(local_pc_wrapper);
-  rtc::scoped_refptr<MockSetSessionDescriptionObserver> p1 =
+  scoped_refptr<MockSetSessionDescriptionObserver> p1 =
       SetLocalDescription(local_pc_wrapper, offer.get());
-  rtc::scoped_refptr<MockSetSessionDescriptionObserver> p2 =
+  scoped_refptr<MockSetSessionDescriptionObserver> p2 =
       SetRemoteDescription(remote_pc_wrapper, offer.get());
   EXPECT_TRUE(Await({p1, p2}));
 
   // Update the remote transceiver to reject VP8
-  std::vector<rtc::scoped_refptr<RtpTransceiverInterface>> remote_transceivers =
+  std::vector<scoped_refptr<RtpTransceiverInterface>> remote_transceivers =
       remote_pc_wrapper->pc()->GetTransceivers();
   ASSERT_TRUE(!remote_transceivers.empty());
-  rtc::scoped_refptr<RtpTransceiverInterface> remote_video_transceiver =
+  scoped_refptr<RtpTransceiverInterface> remote_video_transceiver =
       remote_transceivers[0];
   ASSERT_TRUE(
       remote_video_transceiver->SetCodecPreferences(not_vp8_codecs).ok());
@@ -2007,8 +1997,8 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        EncodingParametersCodecRemovedAfterNegotiationAudio) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::optional<RtpCodecCapability> opus =
@@ -2036,7 +2026,7 @@
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::AUDIO, init);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> audio_transceiver =
+  scoped_refptr<RtpTransceiverInterface> audio_transceiver =
       transceiver_or_error.MoveValue();
 
   NegotiateWithSimulcastTweaks(local_pc_wrapper, remote_pc_wrapper);
@@ -2055,8 +2045,8 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        EncodingParametersRedEnabledBeforeNegotiationAudio) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<RtpCodecCapability> send_codecs =
@@ -2083,7 +2073,7 @@
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::AUDIO, init);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> audio_transceiver =
+  scoped_refptr<RtpTransceiverInterface> audio_transceiver =
       transceiver_or_error.MoveValue();
 
   // Preferring RED over Opus should enable RED with Opus encoding.
@@ -2113,7 +2103,7 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        SetParametersRejectsScalabilityModeForSelectedCodec) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
 
   std::optional<RtpCodecCapability> vp8 =
       local_pc_wrapper->FindFirstSendCodecWithName(webrtc::MediaType::VIDEO,
@@ -2130,7 +2120,7 @@
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::VIDEO, init);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> video_transceiver =
+  scoped_refptr<RtpTransceiverInterface> video_transceiver =
       transceiver_or_error.MoveValue();
 
   RtpParameters parameters = video_transceiver->sender()->GetParameters();
@@ -2141,8 +2131,8 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        EncodingParametersCodecRemovedByNegotiationVideo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::optional<RtpCodecCapability> vp8 =
@@ -2175,7 +2165,7 @@
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(webrtc::MediaType::VIDEO, init);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> video_transceiver =
+  scoped_refptr<RtpTransceiverInterface> video_transceiver =
       transceiver_or_error.MoveValue();
 
   NegotiateWithSimulcastTweaks(local_pc_wrapper, remote_pc_wrapper);
@@ -2199,8 +2189,8 @@
        AddTransceiverRejectsMixedCodecSimulcast) {
   // Mixed Codec Simulcast is not yet supported, so we ensure that we reject
   // such parameters.
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::optional<RtpCodecCapability> vp8 =
@@ -2268,7 +2258,7 @@
 }
 
 TEST_F(PeerConnectionEncodingsIntegrationTest, ScaleToParameterChecking) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> pc_wrapper = CreatePc();
 
   // AddTransceiver: If `scale_resolution_down_to` is specified on any encoding
   // it must be specified on all encodings.
@@ -2353,13 +2343,12 @@
 
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        ScaleResolutionDownByIsIgnoredWhenScaleToIsSpecified) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
 
-  rtc::scoped_refptr<MediaStreamInterface> stream =
-      local_pc_wrapper->GetUserMedia(
-          /*audio=*/false, {}, /*video=*/true, {.width = 640, .height = 360});
-  rtc::scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
+  scoped_refptr<MediaStreamInterface> stream = local_pc_wrapper->GetUserMedia(
+      /*audio=*/false, {}, /*video=*/true, {.width = 640, .height = 360});
+  scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
 
   // Configure contradicting scaling factors (180p vs 360p).
   RtpTransceiverInit init;
@@ -2399,7 +2388,7 @@
   // TODO(https://crbug.com/webrtc/15011): Increase availability of AV1 or make
   // it possible to check support at compile-time.
   bool SkipTestDueToAv1Missing(
-      rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper) {
+      scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper) {
     if (codec_name_ == "AV1" &&
         !HasReceiverVideoCodecCapability(local_pc_wrapper, "AV1")) {
       RTC_LOG(LS_WARNING) << "\n***\nAV1 is not available, skipping test.\n***";
@@ -2414,16 +2403,16 @@
 };
 
 TEST_P(PeerConnectionEncodingsIntegrationParameterizedTest, AllLayersInactive) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
   if (SkipTestDueToAv1Missing(local_pc_wrapper)) {
     return;
   }
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "h", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -2431,7 +2420,7 @@
   transceiver->SetCodecPreferences(codecs);
 
   // Standard mode and all layers inactive.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   parameters.encodings[0].scalability_mode = "L1T3";
@@ -2447,7 +2436,7 @@
 
   // Ensure no media is flowing (1 second should be enough).
   Thread::Current()->SleepMs(1000);
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(3u));
@@ -2458,23 +2447,23 @@
 
 // Configure 4:2:1 using `scale_resolution_down_by`.
 TEST_P(PeerConnectionEncodingsIntegrationParameterizedTest, Simulcast) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
   if (SkipTestDueToAv1Missing(local_pc_wrapper)) {
     return;
   }
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"q", "h", "f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
       GetCapabilitiesAndRestrictToCodec(remote_pc_wrapper, codec_name_);
   transceiver->SetCodecPreferences(codecs);
 
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   parameters.encodings[0].scalability_mode = "L1T3";
@@ -2506,7 +2495,7 @@
                     {.timeout = kLongTimeoutForRampingUp});
   ASSERT_THAT(error_or_report, IsRtcOk());
   // Verify codec and scalability mode.
-  rtc::scoped_refptr<const RTCStatsReport> report = error_or_report.value();
+  scoped_refptr<const RTCStatsReport> report = error_or_report.value();
   auto outbound_rtp_by_rid = GetOutboundRtpStreamStatsByRid(report);
   EXPECT_THAT(outbound_rtp_by_rid,
               UnorderedElementsAre(Pair("q", ResolutionIs(320, 180)),
@@ -2529,23 +2518,23 @@
 // Configure 4:2:1 using `scale_resolution_down_to`.
 TEST_P(PeerConnectionEncodingsIntegrationParameterizedTest,
        SimulcastWithScaleTo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
   if (SkipTestDueToAv1Missing(local_pc_wrapper)) {
     return;
   }
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"q", "h", "f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
       GetCapabilitiesAndRestrictToCodec(remote_pc_wrapper, codec_name_);
   transceiver->SetCodecPreferences(codecs);
 
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   parameters.encodings[0].scalability_mode = "L1T3";
@@ -2580,7 +2569,7 @@
                     {.timeout = kLongTimeoutForRampingUp});
   ASSERT_THAT(error_or_report, IsRtcOk());
   // Verify codec and scalability mode.
-  rtc::scoped_refptr<const RTCStatsReport> report = error_or_report.value();
+  scoped_refptr<const RTCStatsReport> report = error_or_report.value();
   auto outbound_rtp_by_rid = GetOutboundRtpStreamStatsByRid(report);
   EXPECT_THAT(outbound_rtp_by_rid,
               UnorderedElementsAre(Pair("q", ResolutionIs(320, 180)),
@@ -2605,22 +2594,22 @@
 // the `scale_resolution_down_by` API.
 TEST_P(PeerConnectionEncodingsIntegrationParameterizedTest,
        SimulcastScaleDownByNoLongerPowerOfTwo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
   if (SkipTestDueToAv1Missing(local_pc_wrapper)) {
     return;
   }
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"q", "h", "f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
       GetCapabilitiesAndRestrictToCodec(remote_pc_wrapper, codec_name_);
   transceiver->SetCodecPreferences(codecs);
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
 
   // Configure {180p, 360p, 720p}.
   RtpParameters parameters = sender->GetParameters();
@@ -2692,22 +2681,22 @@
 // the `scale_resolution_down_to` API.
 TEST_P(PeerConnectionEncodingsIntegrationParameterizedTest,
        SimulcastScaleToNoLongerPowerOfTwo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
   if (SkipTestDueToAv1Missing(local_pc_wrapper)) {
     return;
   }
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"q", "h", "f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
       GetCapabilitiesAndRestrictToCodec(remote_pc_wrapper, codec_name_);
   transceiver->SetCodecPreferences(codecs);
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
 
   // Configure {180p, 360p, 720p}.
   RtpParameters parameters = sender->GetParameters();
@@ -2789,11 +2778,11 @@
 // have to repeat here.)
 TEST_P(PeerConnectionEncodingsIntegrationParameterizedTest,
        LowResolutionSimulcastWithScaleTo) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
   if (SkipTestDueToAv1Missing(local_pc_wrapper)) {
     return;
   }
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
@@ -2812,14 +2801,13 @@
   encoding.rid = "f";
   encoding.scale_resolution_down_to = {.width = 160, .height = 80};
   init.send_encodings.push_back(encoding);
-  rtc::scoped_refptr<MediaStreamInterface> stream =
-      local_pc_wrapper->GetUserMedia(
-          /*audio=*/false, {}, /*video=*/true, {.width = 160, .height = 80});
-  rtc::scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
+  scoped_refptr<MediaStreamInterface> stream = local_pc_wrapper->GetUserMedia(
+      /*audio=*/false, {}, /*video=*/true, {.width = 160, .height = 80});
+  scoped_refptr<VideoTrackInterface> track = stream->GetVideoTracks()[0];
   auto transceiver_or_error =
       local_pc_wrapper->pc()->AddTransceiver(track, init);
   ASSERT_TRUE(transceiver_or_error.ok());
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       transceiver_or_error.value();
 
   std::vector<RtpCodecCapability> codecs =
@@ -2845,23 +2833,23 @@
 
 TEST_P(PeerConnectionEncodingsIntegrationParameterizedTest,
        SimulcastEncodingStopWhenRtpEncodingChangeToInactive) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
   if (SkipTestDueToAv1Missing(local_pc_wrapper)) {
     return;
   }
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"q", "h", "f"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
       GetCapabilitiesAndRestrictToCodec(local_pc_wrapper, codec_name_);
   transceiver->SetCodecPreferences(codecs);
 
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(3));
   ASSERT_EQ(parameters.encodings[0].rid, "q");
@@ -2916,17 +2904,17 @@
 
 TEST_P(PeerConnectionEncodingsIntegrationParameterizedTest,
        ScaleToDownscaleAndThenUpscale) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
   if (SkipTestDueToAv1Missing(local_pc_wrapper)) {
     return;
   }
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers = CreateLayers({"f"}, /*active=*/true);
 
   // This transceiver receives a 1280x720 source.
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -2938,7 +2926,7 @@
   remote_pc_wrapper->WaitForConnection();
 
   // Request 640x360, which is the same as scaling down by 2.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(1));
   parameters.encodings[0].scalability_mode = "L1T3";
@@ -2976,17 +2964,17 @@
 
 TEST_P(PeerConnectionEncodingsIntegrationParameterizedTest,
        ScaleToIsOrientationAgnostic) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
   if (SkipTestDueToAv1Missing(local_pc_wrapper)) {
     return;
   }
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers = CreateLayers({"f"}, /*active=*/true);
 
   // This transceiver receives a 1280x720 source.
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -2999,7 +2987,7 @@
 
   // 360x640 is the same as 640x360 due to orientation agnosticism.
   // The orientation is determined by the frame (1280x720): landscape.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(1));
   parameters.encodings[0].scale_resolution_down_to = {.width = 360,
@@ -3014,17 +3002,17 @@
 
 TEST_P(PeerConnectionEncodingsIntegrationParameterizedTest,
        ScaleToMaintainsAspectRatio) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
   if (SkipTestDueToAv1Missing(local_pc_wrapper)) {
     return;
   }
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers = CreateLayers({"f"}, /*active=*/true);
 
   // This transceiver receives a 1280x720 source.
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> codecs =
@@ -3037,7 +3025,7 @@
 
   // Restrict height more than width, the scaling factor needed on height should
   // also be applied on the width in order to maintain the frame aspect ratio.
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
   RtpParameters parameters = sender->GetParameters();
   ASSERT_THAT(parameters.encodings, SizeIs(1));
   parameters.encodings[0].scale_resolution_down_to = {.width = 1280,
@@ -3144,13 +3132,13 @@
 
 #ifdef RTC_ENABLE_H265
 TEST_F(PeerConnectionEncodingsFakeCodecsIntegrationTest, H265Singlecast) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper =
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper =
       CreatePcWithFakeH265();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper =
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper =
       CreatePcWithFakeH265();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       local_pc_wrapper->pc()
           ->AddTransceiver(webrtc::MediaType::VIDEO)
           .MoveValue();
@@ -3163,7 +3151,7 @@
   remote_pc_wrapper->WaitForConnection();
 
   // Verify codec.
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(1u));
@@ -3172,16 +3160,16 @@
 }
 
 TEST_F(PeerConnectionEncodingsFakeCodecsIntegrationTest, H265Simulcast) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper =
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper =
       CreatePcWithFakeH265();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper =
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper =
       CreatePcWithFakeH265();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers =
       CreateLayers({"q", "h", "f"}, /*active=*/true);
 
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> preferred_codecs =
@@ -3200,7 +3188,7 @@
       IsRtcOk());
 
   // Verify codec.
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
+  scoped_refptr<const RTCStatsReport> report = GetStats(local_pc_wrapper);
   std::vector<const RTCOutboundRtpStreamStats*> outbound_rtps =
       report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_THAT(outbound_rtps, SizeIs(3u));
@@ -3214,21 +3202,21 @@
 
 TEST_F(PeerConnectionEncodingsFakeCodecsIntegrationTest,
        H265SetParametersIgnoresLevelId) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper =
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper =
       CreatePcWithFakeH265();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper =
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper =
       CreatePcWithFakeH265();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
   std::vector<SimulcastLayer> layers = CreateLayers({"f"}, /*active=*/true);
 
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   std::vector<RtpCodecCapability> preferred_codecs =
       GetCapabilitiesAndRestrictToCodec(local_pc_wrapper, "H265");
   transceiver->SetCodecPreferences(preferred_codecs);
-  rtc::scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
+  scoped_refptr<RtpSenderInterface> sender = transceiver->sender();
 
   NegotiateWithSimulcastTweaks(local_pc_wrapper, remote_pc_wrapper);
   local_pc_wrapper->WaitForConnection();
@@ -3276,13 +3264,13 @@
 
 TEST_F(PeerConnectionEncodingsFakeCodecsIntegrationTest,
        H264UnidirectionalNegotiation) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper =
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper =
       CreatePcWithUnidirectionalH264();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper =
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper =
       CreatePcWithUnidirectionalH264();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       local_pc_wrapper->pc()
           ->AddTransceiver(webrtc::MediaType::VIDEO)
           .MoveValue();
@@ -3416,13 +3404,13 @@
 // Regression test for https://issues.chromium.org/issues/399667359
 TEST_F(PeerConnectionEncodingsIntegrationTest,
        SimulcastNotSupportedGetParametersDoesNotCrash) {
-  rtc::scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
-  rtc::scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> local_pc_wrapper = CreatePc();
+  scoped_refptr<PeerConnectionTestWrapper> remote_pc_wrapper = CreatePc();
   ExchangeIceCandidates(local_pc_wrapper, remote_pc_wrapper);
 
-  std::vector<cricket::SimulcastLayer> layers =
+  std::vector<SimulcastLayer> layers =
       CreateLayers({"f", "q"}, /*active=*/true);
-  rtc::scoped_refptr<RtpTransceiverInterface> transceiver =
+  scoped_refptr<RtpTransceiverInterface> transceiver =
       AddTransceiverWithSimulcastLayers(local_pc_wrapper, remote_pc_wrapper,
                                         layers);
   // Negotiate - receiver will reject simulcast, so the 2nd layer will be
diff --git a/pc/peer_connection_end_to_end_unittest.cc b/pc/peer_connection_end_to_end_unittest.cc
index c31625b..2fcf4dc 100644
--- a/pc/peer_connection_end_to_end_unittest.cc
+++ b/pc/peer_connection_end_to_end_unittest.cc
@@ -80,16 +80,17 @@
 class PeerConnectionEndToEndBaseTest : public sigslot::has_slots<>,
                                        public ::testing::Test {
  public:
-  typedef std::vector<rtc::scoped_refptr<DataChannelInterface>> DataChannelList;
+  typedef std::vector<webrtc::scoped_refptr<DataChannelInterface>>
+      DataChannelList;
 
   explicit PeerConnectionEndToEndBaseTest(SdpSemantics sdp_semantics)
       : network_thread_(std::make_unique<webrtc::Thread>(&pss_)),
         worker_thread_(webrtc::Thread::Create()) {
     RTC_CHECK(network_thread_->Start());
     RTC_CHECK(worker_thread_->Start());
-    caller_ = rtc::make_ref_counted<PeerConnectionTestWrapper>(
+    caller_ = webrtc::make_ref_counted<PeerConnectionTestWrapper>(
         "caller", &pss_, network_thread_.get(), worker_thread_.get());
-    callee_ = rtc::make_ref_counted<PeerConnectionTestWrapper>(
+    callee_ = webrtc::make_ref_counted<PeerConnectionTestWrapper>(
         "callee", &pss_, network_thread_.get(), worker_thread_.get());
     webrtc::PeerConnectionInterface::IceServer ice_server;
     ice_server.uri = "stun:stun.l.google.com:19302";
@@ -102,10 +103,11 @@
   }
 
   void CreatePcs(
-      rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory1,
-      rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory1,
-      rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory2,
-      rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory2) {
+      webrtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory1,
+      webrtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory1,
+      webrtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory2,
+      webrtc::scoped_refptr<webrtc::AudioDecoderFactory>
+          audio_decoder_factory2) {
     EXPECT_TRUE(caller_->CreatePc(config_, audio_encoder_factory1,
                                   audio_decoder_factory1));
     EXPECT_TRUE(callee_->CreatePc(config_, audio_encoder_factory2,
@@ -119,8 +121,9 @@
   }
 
   void CreatePcs(
-      rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
-      rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory) {
+      webrtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
+      webrtc::scoped_refptr<webrtc::AudioDecoderFactory>
+          audio_decoder_factory) {
     CreatePcs(audio_encoder_factory, audio_decoder_factory,
               audio_encoder_factory, audio_decoder_factory);
   }
@@ -154,12 +157,12 @@
 
   void OnCallerAddedDataChanel(DataChannelInterface* dc) {
     caller_signaled_data_channels_.push_back(
-        rtc::scoped_refptr<DataChannelInterface>(dc));
+        webrtc::scoped_refptr<DataChannelInterface>(dc));
   }
 
   void OnCalleeAddedDataChannel(DataChannelInterface* dc) {
     callee_signaled_data_channels_.push_back(
-        rtc::scoped_refptr<DataChannelInterface>(dc));
+        webrtc::scoped_refptr<DataChannelInterface>(dc));
   }
 
   // Tests that `dc1` and `dc2` can send to and receive from each other.
@@ -188,7 +191,7 @@
     EXPECT_THAT(
         webrtc::WaitUntil(
             [&] {
-              return rtc::CopyOnWriteBuffer(dc2_observer->last_message());
+              return webrtc::CopyOnWriteBuffer(dc2_observer->last_message());
             },
             ::testing::Eq(buffer.data),
             {.timeout = webrtc::TimeDelta::Millis(kMaxWait)}),
@@ -198,7 +201,7 @@
     EXPECT_THAT(
         webrtc::WaitUntil(
             [&] {
-              return rtc::CopyOnWriteBuffer(dc1_observer->last_message());
+              return webrtc::CopyOnWriteBuffer(dc1_observer->last_message());
             },
             ::testing::Eq(buffer.data),
             {.timeout = webrtc::TimeDelta::Millis(kMaxWait)}),
@@ -253,8 +256,8 @@
   webrtc::PhysicalSocketServer pss_;
   std::unique_ptr<webrtc::Thread> network_thread_;
   std::unique_ptr<webrtc::Thread> worker_thread_;
-  rtc::scoped_refptr<PeerConnectionTestWrapper> caller_;
-  rtc::scoped_refptr<PeerConnectionTestWrapper> callee_;
+  webrtc::scoped_refptr<PeerConnectionTestWrapper> caller_;
+  webrtc::scoped_refptr<PeerConnectionTestWrapper> callee_;
   DataChannelList caller_signaled_data_channels_;
   DataChannelList callee_signaled_data_channels_;
   webrtc::PeerConnectionInterface::RTCConfiguration config_;
@@ -312,11 +315,11 @@
   return std::move(mock_decoder);
 }
 
-rtc::scoped_refptr<webrtc::AudioDecoderFactory>
+webrtc::scoped_refptr<webrtc::AudioDecoderFactory>
 CreateForwardingMockDecoderFactory(
     webrtc::AudioDecoderFactory* real_decoder_factory) {
-  rtc::scoped_refptr<webrtc::MockAudioDecoderFactory> mock_decoder_factory =
-      rtc::make_ref_counted<StrictMock<webrtc::MockAudioDecoderFactory>>();
+  webrtc::scoped_refptr<webrtc::MockAudioDecoderFactory> mock_decoder_factory =
+      webrtc::make_ref_counted<StrictMock<webrtc::MockAudioDecoderFactory>>();
   EXPECT_CALL(*mock_decoder_factory, GetSupportedDecoders())
       .Times(AtLeast(1))
       .WillRepeatedly(Invoke([real_decoder_factory] {
@@ -414,7 +417,7 @@
 }  // namespace
 
 TEST_P(PeerConnectionEndToEndTest, Call) {
-  rtc::scoped_refptr<webrtc::AudioDecoderFactory> real_decoder_factory =
+  webrtc::scoped_refptr<webrtc::AudioDecoderFactory> real_decoder_factory =
       webrtc::CreateOpusAudioDecoderFactory();
   CreatePcs(webrtc::CreateOpusAudioEncoderFactory(),
             CreateForwardingMockDecoderFactory(real_decoder_factory.get()));
@@ -438,7 +441,7 @@
   class IdLoggingAudioEncoderFactory : public webrtc::AudioEncoderFactory {
    public:
     IdLoggingAudioEncoderFactory(
-        rtc::scoped_refptr<AudioEncoderFactory> real_factory,
+        webrtc::scoped_refptr<AudioEncoderFactory> real_factory,
         std::vector<webrtc::AudioCodecPairId>* const codec_ids)
         : fact_(real_factory), codec_ids_(codec_ids) {}
     std::vector<webrtc::AudioCodecSpec> GetSupportedEncoders() override {
@@ -458,14 +461,14 @@
     }
 
    private:
-    const rtc::scoped_refptr<webrtc::AudioEncoderFactory> fact_;
+    const webrtc::scoped_refptr<webrtc::AudioEncoderFactory> fact_;
     std::vector<webrtc::AudioCodecPairId>* const codec_ids_;
   };
 
   class IdLoggingAudioDecoderFactory : public webrtc::AudioDecoderFactory {
    public:
     IdLoggingAudioDecoderFactory(
-        rtc::scoped_refptr<AudioDecoderFactory> real_factory,
+        webrtc::scoped_refptr<AudioDecoderFactory> real_factory,
         std::vector<webrtc::AudioCodecPairId>* const codec_ids)
         : fact_(real_factory), codec_ids_(codec_ids) {}
     std::vector<webrtc::AudioCodecSpec> GetSupportedDecoders() override {
@@ -484,25 +487,25 @@
     }
 
    private:
-    const rtc::scoped_refptr<webrtc::AudioDecoderFactory> fact_;
+    const webrtc::scoped_refptr<webrtc::AudioDecoderFactory> fact_;
     std::vector<webrtc::AudioCodecPairId>* const codec_ids_;
   };
 
   std::vector<webrtc::AudioCodecPairId> encoder_id1, encoder_id2, decoder_id1,
       decoder_id2;
-  CreatePcs(rtc::make_ref_counted<IdLoggingAudioEncoderFactory>(
+  CreatePcs(webrtc::make_ref_counted<IdLoggingAudioEncoderFactory>(
                 webrtc::CreateAudioEncoderFactory<
                     AudioEncoderUnicornSparklesRainbow>(),
                 &encoder_id1),
-            rtc::make_ref_counted<IdLoggingAudioDecoderFactory>(
+            webrtc::make_ref_counted<IdLoggingAudioDecoderFactory>(
                 webrtc::CreateAudioDecoderFactory<
                     AudioDecoderUnicornSparklesRainbow>(),
                 &decoder_id1),
-            rtc::make_ref_counted<IdLoggingAudioEncoderFactory>(
+            webrtc::make_ref_counted<IdLoggingAudioEncoderFactory>(
                 webrtc::CreateAudioEncoderFactory<
                     AudioEncoderUnicornSparklesRainbow>(),
                 &encoder_id2),
-            rtc::make_ref_counted<IdLoggingAudioDecoderFactory>(
+            webrtc::make_ref_counted<IdLoggingAudioDecoderFactory>(
                 webrtc::CreateAudioDecoderFactory<
                     AudioDecoderUnicornSparklesRainbow>(),
                 &decoder_id2));
@@ -529,9 +532,9 @@
             webrtc::MockAudioDecoderFactory::CreateEmptyFactory());
 
   webrtc::DataChannelInit init;
-  rtc::scoped_refptr<DataChannelInterface> caller_dc(
+  webrtc::scoped_refptr<DataChannelInterface> caller_dc(
       caller_->CreateDataChannel("data", init));
-  rtc::scoped_refptr<DataChannelInterface> callee_dc(
+  webrtc::scoped_refptr<DataChannelInterface> callee_dc(
       callee_->CreateDataChannel("data", init));
 
   Negotiate();
@@ -558,7 +561,7 @@
   webrtc::DataChannelInit init;
 
   // This DataChannel is for creating the data content in the negotiation.
-  rtc::scoped_refptr<DataChannelInterface> dummy(
+  webrtc::scoped_refptr<DataChannelInterface> dummy(
       caller_->CreateDataChannel("data", init));
   Negotiate();
   WaitForConnection();
@@ -567,9 +570,9 @@
   WaitForDataChannelsToOpen(dummy.get(), callee_signaled_data_channels_, 0);
 
   // Create new DataChannels after the negotiation and verify their states.
-  rtc::scoped_refptr<DataChannelInterface> caller_dc(
+  webrtc::scoped_refptr<DataChannelInterface> caller_dc(
       caller_->CreateDataChannel("hello", init));
-  rtc::scoped_refptr<DataChannelInterface> callee_dc(
+  webrtc::scoped_refptr<DataChannelInterface> callee_dc(
       callee_->CreateDataChannel("hello", init));
 
   WaitForDataChannelsToOpen(caller_dc.get(), callee_signaled_data_channels_, 1);
@@ -592,7 +595,7 @@
   webrtc::DataChannelInit init;
 
   // This DataChannel is for creating the data content in the negotiation.
-  rtc::scoped_refptr<DataChannelInterface> dummy(
+  webrtc::scoped_refptr<DataChannelInterface> dummy(
       caller_->CreateDataChannel("data", init));
   Negotiate();
   WaitForConnection();
@@ -601,9 +604,9 @@
   WaitForDataChannelsToOpen(dummy.get(), callee_signaled_data_channels_, 0);
 
   // Create new DataChannels after the negotiation and verify their states.
-  rtc::scoped_refptr<DataChannelInterface> caller_dc(
+  webrtc::scoped_refptr<DataChannelInterface> caller_dc(
       caller_->CreateDataChannel("hello", init));
-  rtc::scoped_refptr<DataChannelInterface> callee_dc(
+  webrtc::scoped_refptr<DataChannelInterface> callee_dc(
       callee_->CreateDataChannel("hello", init));
 
   WaitForDataChannelsToOpen(caller_dc.get(), callee_signaled_data_channels_, 1);
@@ -624,9 +627,9 @@
             webrtc::MockAudioDecoderFactory::CreateEmptyFactory());
 
   webrtc::DataChannelInit init;
-  rtc::scoped_refptr<DataChannelInterface> caller_dc_1(
+  webrtc::scoped_refptr<DataChannelInterface> caller_dc_1(
       caller_->CreateDataChannel("data", init));
-  rtc::scoped_refptr<DataChannelInterface> callee_dc_1(
+  webrtc::scoped_refptr<DataChannelInterface> callee_dc_1(
       callee_->CreateDataChannel("data", init));
 
   Negotiate();
@@ -635,9 +638,9 @@
   EXPECT_EQ(1, caller_dc_1->id() % 2);
   EXPECT_EQ(0, callee_dc_1->id() % 2);
 
-  rtc::scoped_refptr<DataChannelInterface> caller_dc_2(
+  webrtc::scoped_refptr<DataChannelInterface> caller_dc_2(
       caller_->CreateDataChannel("data", init));
-  rtc::scoped_refptr<DataChannelInterface> callee_dc_2(
+  webrtc::scoped_refptr<DataChannelInterface> callee_dc_2(
       callee_->CreateDataChannel("data", init));
 
   EXPECT_EQ(1, caller_dc_2->id() % 2);
@@ -653,9 +656,9 @@
 
   webrtc::DataChannelInit init;
 
-  rtc::scoped_refptr<DataChannelInterface> caller_dc_1(
+  webrtc::scoped_refptr<DataChannelInterface> caller_dc_1(
       caller_->CreateDataChannel("data", init));
-  rtc::scoped_refptr<DataChannelInterface> caller_dc_2(
+  webrtc::scoped_refptr<DataChannelInterface> caller_dc_2(
       caller_->CreateDataChannel("data", init));
 
   Negotiate();
@@ -704,7 +707,7 @@
             webrtc::MockAudioDecoderFactory::CreateEmptyFactory());
 
   webrtc::DataChannelInit init;
-  rtc::scoped_refptr<DataChannelInterface> caller_dc(
+  webrtc::scoped_refptr<DataChannelInterface> caller_dc(
       caller_->CreateDataChannel("data", init));
 
   Negotiate();
@@ -743,7 +746,7 @@
             webrtc::MockAudioDecoderFactory::CreateEmptyFactory());
 
   webrtc::DataChannelInit init;
-  rtc::scoped_refptr<DataChannelInterface> caller_dc(
+  webrtc::scoped_refptr<DataChannelInterface> caller_dc(
       caller_->CreateDataChannel("data", init));
 
   Negotiate();
@@ -770,9 +773,9 @@
             webrtc::MockAudioDecoderFactory::CreateEmptyFactory());
 
   webrtc::DataChannelInit init;
-  std::vector<rtc::scoped_refptr<DataChannelInterface>> channels;
+  std::vector<webrtc::scoped_refptr<DataChannelInterface>> channels;
   for (int i = 0; i <= webrtc::kMaxSctpStreams / 2; i++) {
-    rtc::scoped_refptr<DataChannelInterface> caller_dc(
+    webrtc::scoped_refptr<DataChannelInterface> caller_dc(
         caller_->CreateDataChannel("data", init));
     channels.push_back(std::move(caller_dc));
   }
@@ -792,7 +795,7 @@
 #endif  // WEBRTC_HAVE_SCTP
 
 TEST_P(PeerConnectionEndToEndTest, CanRestartIce) {
-  rtc::scoped_refptr<webrtc::AudioDecoderFactory> real_decoder_factory =
+  webrtc::scoped_refptr<webrtc::AudioDecoderFactory> real_decoder_factory =
       webrtc::CreateOpusAudioDecoderFactory();
   CreatePcs(webrtc::CreateOpusAudioEncoderFactory(),
             CreateForwardingMockDecoderFactory(real_decoder_factory.get()));
diff --git a/pc/peer_connection_factory.cc b/pc/peer_connection_factory.cc
index 34cc1da..e62d25a 100644
--- a/pc/peer_connection_factory.cc
+++ b/pc/peer_connection_factory.cc
@@ -68,7 +68,7 @@
 
 namespace webrtc {
 
-rtc::scoped_refptr<PeerConnectionFactoryInterface>
+scoped_refptr<PeerConnectionFactoryInterface>
 CreateModularPeerConnectionFactory(
     PeerConnectionFactoryDependencies dependencies) {
   // The PeerConnectionFactory must be created on the signaling thread.
@@ -91,7 +91,7 @@
 }
 
 // Static
-rtc::scoped_refptr<PeerConnectionFactory> PeerConnectionFactory::Create(
+scoped_refptr<PeerConnectionFactory> PeerConnectionFactory::Create(
     PeerConnectionFactoryDependencies dependencies) {
   auto context = ConnectionContext::Create(
       CreateEnvironment(std::move(dependencies.trials),
@@ -100,11 +100,11 @@
   if (!context) {
     return nullptr;
   }
-  return rtc::make_ref_counted<PeerConnectionFactory>(context, &dependencies);
+  return make_ref_counted<PeerConnectionFactory>(context, &dependencies);
 }
 
 PeerConnectionFactory::PeerConnectionFactory(
-    rtc::scoped_refptr<ConnectionContext> context,
+    scoped_refptr<ConnectionContext> context,
     PeerConnectionFactoryDependencies* dependencies)
     : context_(context),
       codec_vendor_(context_->media_engine(),
@@ -197,11 +197,10 @@
   RTC_CHECK_NOTREACHED();
 }
 
-rtc::scoped_refptr<AudioSourceInterface>
-PeerConnectionFactory::CreateAudioSource(const AudioOptions& options) {
+scoped_refptr<AudioSourceInterface> PeerConnectionFactory::CreateAudioSource(
+    const AudioOptions& options) {
   RTC_DCHECK(signaling_thread()->IsCurrent());
-  rtc::scoped_refptr<LocalAudioSource> source(
-      LocalAudioSource::Create(&options));
+  scoped_refptr<LocalAudioSource> source(LocalAudioSource::Create(&options));
   return source;
 }
 
@@ -221,7 +220,7 @@
   return context_->media_engine();
 }
 
-RTCErrorOr<rtc::scoped_refptr<PeerConnectionInterface>>
+RTCErrorOr<scoped_refptr<PeerConnectionInterface>>
 PeerConnectionFactory::CreatePeerConnectionOrError(
     const PeerConnectionInterface::RTCConfiguration& configuration,
     PeerConnectionDependencies dependencies) {
@@ -239,7 +238,7 @@
     return err;
   }
 
-  cricket::ServerAddresses stun_servers;
+  ServerAddresses stun_servers;
   std::vector<RelayServerConfig> turn_servers;
   err = ParseAndValidateIceServersFromConfiguration(configuration, stun_servers,
                                                     turn_servers);
@@ -319,33 +318,32 @@
   // which will point to the network thread (and not the factory's
   // worker_thread()).  All such methods have thread checks though, so the code
   // should still be clear (outside of macro expansion).
-  return rtc::scoped_refptr<PeerConnectionInterface>(
-      PeerConnectionProxy::Create(signaling_thread(), network_thread(),
-                                  std::move(pc)));
+  return scoped_refptr<PeerConnectionInterface>(PeerConnectionProxy::Create(
+      signaling_thread(), network_thread(), std::move(pc)));
 }
 
-rtc::scoped_refptr<MediaStreamInterface>
+scoped_refptr<MediaStreamInterface>
 PeerConnectionFactory::CreateLocalMediaStream(const std::string& stream_id) {
   RTC_DCHECK(signaling_thread()->IsCurrent());
   return MediaStreamProxy::Create(signaling_thread(),
                                   MediaStream::Create(stream_id));
 }
 
-rtc::scoped_refptr<VideoTrackInterface> PeerConnectionFactory::CreateVideoTrack(
-    rtc::scoped_refptr<VideoTrackSourceInterface> source,
+scoped_refptr<VideoTrackInterface> PeerConnectionFactory::CreateVideoTrack(
+    scoped_refptr<VideoTrackSourceInterface> source,
     absl::string_view id) {
   RTC_DCHECK(signaling_thread()->IsCurrent());
-  rtc::scoped_refptr<VideoTrackInterface> track =
+  scoped_refptr<VideoTrackInterface> track =
       VideoTrack::Create(id, source, worker_thread());
   return VideoTrackProxy::Create(signaling_thread(), worker_thread(), track);
 }
 
-rtc::scoped_refptr<AudioTrackInterface> PeerConnectionFactory::CreateAudioTrack(
+scoped_refptr<AudioTrackInterface> PeerConnectionFactory::CreateAudioTrack(
     const std::string& id,
     AudioSourceInterface* source) {
   RTC_DCHECK(signaling_thread()->IsCurrent());
-  rtc::scoped_refptr<AudioTrackInterface> track =
-      AudioTrack::Create(id, rtc::scoped_refptr<AudioSourceInterface>(source));
+  scoped_refptr<AudioTrackInterface> track =
+      AudioTrack::Create(id, scoped_refptr<AudioSourceInterface>(source));
   return AudioTrackProxy::Create(signaling_thread(), track);
 }
 
diff --git a/pc/peer_connection_factory.h b/pc/peer_connection_factory.h
index 82fa0db..5b99a69 100644
--- a/pc/peer_connection_factory.h
+++ b/pc/peer_connection_factory.h
@@ -54,12 +54,12 @@
   //
   // The Dependencies structure allows simple management of all new
   // dependencies being added to the PeerConnectionFactory.
-  static rtc::scoped_refptr<PeerConnectionFactory> Create(
+  static scoped_refptr<PeerConnectionFactory> Create(
       PeerConnectionFactoryDependencies dependencies);
 
   void SetOptions(const Options& options) override;
 
-  RTCErrorOr<rtc::scoped_refptr<PeerConnectionInterface>>
+  RTCErrorOr<scoped_refptr<PeerConnectionInterface>>
   CreatePeerConnectionOrError(
       const PeerConnectionInterface::RTCConfiguration& configuration,
       PeerConnectionDependencies dependencies) override;
@@ -70,17 +70,17 @@
   RtpCapabilities GetRtpReceiverCapabilities(
       webrtc::MediaType kind) const override;
 
-  rtc::scoped_refptr<MediaStreamInterface> CreateLocalMediaStream(
+  scoped_refptr<MediaStreamInterface> CreateLocalMediaStream(
       const std::string& stream_id) override;
 
-  rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource(
+  scoped_refptr<AudioSourceInterface> CreateAudioSource(
       const AudioOptions& options) override;
 
-  rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack(
-      rtc::scoped_refptr<VideoTrackSourceInterface> video_source,
+  scoped_refptr<VideoTrackInterface> CreateVideoTrack(
+      scoped_refptr<VideoTrackSourceInterface> video_source,
       absl::string_view id) override;
 
-  rtc::scoped_refptr<AudioTrackInterface> CreateAudioTrack(
+  scoped_refptr<AudioTrackInterface> CreateAudioTrack(
       const std::string& id,
       AudioSourceInterface* audio_source) override;
 
@@ -113,7 +113,7 @@
 
  protected:
   // Constructor used by the static Create() method. Modifies the dependencies.
-  PeerConnectionFactory(rtc::scoped_refptr<ConnectionContext> context,
+  PeerConnectionFactory(scoped_refptr<ConnectionContext> context,
                         PeerConnectionFactoryDependencies* dependencies);
 
   // Constructor for use in testing. Ignores the possibility of initialization
@@ -134,7 +134,7 @@
       std::unique_ptr<NetworkControllerFactoryInterface>
           network_controller_factory);
 
-  rtc::scoped_refptr<ConnectionContext> context_;
+  scoped_refptr<ConnectionContext> context_;
   PeerConnectionFactoryInterface::Options options_
       RTC_GUARDED_BY(signaling_thread());
   CodecVendor codec_vendor_;
diff --git a/pc/peer_connection_factory_proxy.h b/pc/peer_connection_factory_proxy.h
index afa5f2c..e046f66 100644
--- a/pc/peer_connection_factory_proxy.h
+++ b/pc/peer_connection_factory_proxy.h
@@ -32,7 +32,7 @@
 BEGIN_PROXY_MAP(PeerConnectionFactory)
 PROXY_PRIMARY_THREAD_DESTRUCTOR()
 PROXY_METHOD1(void, SetOptions, const Options&)
-PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<PeerConnectionInterface>>,
+PROXY_METHOD2(RTCErrorOr<webrtc::scoped_refptr<PeerConnectionInterface>>,
               CreatePeerConnectionOrError,
               const PeerConnectionInterface::RTCConfiguration&,
               PeerConnectionDependencies)
@@ -40,17 +40,17 @@
 PROXY_CONSTMETHOD1(RtpCapabilities,
                    GetRtpReceiverCapabilities,
                    webrtc::MediaType)
-PROXY_METHOD1(rtc::scoped_refptr<MediaStreamInterface>,
+PROXY_METHOD1(scoped_refptr<MediaStreamInterface>,
               CreateLocalMediaStream,
               const std::string&)
-PROXY_METHOD1(rtc::scoped_refptr<AudioSourceInterface>,
+PROXY_METHOD1(scoped_refptr<AudioSourceInterface>,
               CreateAudioSource,
               const AudioOptions&)
-PROXY_METHOD2(rtc::scoped_refptr<VideoTrackInterface>,
+PROXY_METHOD2(scoped_refptr<VideoTrackInterface>,
               CreateVideoTrack,
-              rtc::scoped_refptr<VideoTrackSourceInterface>,
+              scoped_refptr<VideoTrackSourceInterface>,
               absl::string_view)
-PROXY_METHOD2(rtc::scoped_refptr<AudioTrackInterface>,
+PROXY_METHOD2(scoped_refptr<AudioTrackInterface>,
               CreateAudioTrack,
               const std::string&,
               AudioSourceInterface*)
diff --git a/pc/peer_connection_factory_unittest.cc b/pc/peer_connection_factory_unittest.cc
index d9ad9f6..f895496 100644
--- a/pc/peer_connection_factory_unittest.cc
+++ b/pc/peer_connection_factory_unittest.cc
@@ -111,11 +111,10 @@
   virtual ~NullPeerConnectionObserver() = default;
   void OnSignalingChange(
       PeerConnectionInterface::SignalingState new_state) override {}
-  void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) override {}
-  void OnRemoveStream(
-      rtc::scoped_refptr<MediaStreamInterface> stream) override {}
+  void OnAddStream(scoped_refptr<MediaStreamInterface> stream) override {}
+  void OnRemoveStream(scoped_refptr<MediaStreamInterface> stream) override {}
   void OnDataChannel(
-      rtc::scoped_refptr<DataChannelInterface> data_channel) override {}
+      scoped_refptr<DataChannelInterface> data_channel) override {}
   void OnRenegotiationNeeded() override {}
   void OnIceConnectionChange(
       PeerConnectionInterface::IceConnectionState new_state) override {}
@@ -151,7 +150,7 @@
     // parallel.
     factory_ = CreatePeerConnectionFactory(
         Thread::Current(), Thread::Current(), Thread::Current(),
-        rtc::scoped_refptr<AudioDeviceModule>(FakeAudioCaptureModule::Create()),
+        scoped_refptr<AudioDeviceModule>(FakeAudioCaptureModule::Create()),
         CreateBuiltinAudioEncoderFactory(), CreateBuiltinAudioDecoderFactory(),
         std::make_unique<VideoEncoderFactoryTemplate<
             LibvpxVp8EncoderTemplateAdapter, LibvpxVp9EncoderTemplateAdapter,
@@ -168,7 +167,7 @@
   }
 
  protected:
-  void VerifyStunServers(cricket::ServerAddresses stun_servers) {
+  void VerifyStunServers(ServerAddresses stun_servers) {
     EXPECT_EQ(stun_servers, raw_port_allocator_->stun_servers());
   }
 
@@ -260,7 +259,7 @@
 
   std::unique_ptr<SocketServer> socket_server_;
   AutoSocketServerThread main_thread_;
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> factory_;
+  scoped_refptr<PeerConnectionFactoryInterface> factory_;
   NullPeerConnectionObserver observer_;
   std::unique_ptr<FakePortAllocator> port_allocator_;
   // Since the PC owns the port allocator after it's been initialized,
@@ -270,7 +269,7 @@
 
 // Since there is no public PeerConnectionFactory API to control RTX usage, need
 // to reconstruct factory with our own ConnectionContext.
-rtc::scoped_refptr<PeerConnectionFactoryInterface>
+scoped_refptr<PeerConnectionFactoryInterface>
 CreatePeerConnectionFactoryWithRtxDisabled() {
   PeerConnectionFactoryDependencies pcf_dependencies;
   pcf_dependencies.signaling_thread = Thread::Current();
@@ -291,11 +290,10 @@
           OpenH264DecoderTemplateAdapter, Dav1dDecoderTemplateAdapter>>(),
   EnableMedia(pcf_dependencies);
 
-  rtc::scoped_refptr<ConnectionContext> context =
+  scoped_refptr<ConnectionContext> context =
       ConnectionContext::Create(CreateEnvironment(), &pcf_dependencies);
   context->set_use_rtx(false);
-  return rtc::make_ref_counted<PeerConnectionFactory>(context,
-                                                      &pcf_dependencies);
+  return make_ref_counted<PeerConnectionFactory>(context, &pcf_dependencies);
 }
 
 // Verify creation of PeerConnection using internal ADM, video factory and
@@ -309,7 +307,7 @@
   InitializeAndroidObjects();
 #endif
 
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> factory(
+  scoped_refptr<PeerConnectionFactoryInterface> factory(
       CreatePeerConnectionFactory(
           nullptr /* network_thread */, nullptr /* worker_thread */,
           nullptr /* signaling_thread */, nullptr /* default_adm */,
@@ -461,16 +459,16 @@
   auto result =
       factory_->CreatePeerConnectionOrError(config, std::move(pc_dependencies));
   ASSERT_TRUE(result.ok());
-  cricket::ServerAddresses stun_servers;
+  ServerAddresses stun_servers;
   SocketAddress stun1("stun.l.google.com", 19302);
   stun_servers.insert(stun1);
   VerifyStunServers(stun_servers);
   std::vector<RelayServerConfig> turn_servers;
   RelayServerConfig turn1("test.com", 1234, kTurnUsername, kTurnPassword,
-                          cricket::PROTO_UDP);
+                          PROTO_UDP);
   turn_servers.push_back(turn1);
   RelayServerConfig turn2("hello.com", kDefaultStunPort, kTurnUsername,
-                          kTurnPassword, cricket::PROTO_TCP);
+                          kTurnPassword, PROTO_TCP);
   turn_servers.push_back(turn2);
   VerifyTurnServers(turn_servers);
 }
@@ -494,16 +492,16 @@
   auto result =
       factory_->CreatePeerConnectionOrError(config, std::move(pc_dependencies));
   ASSERT_TRUE(result.ok());
-  cricket::ServerAddresses stun_servers;
+  ServerAddresses stun_servers;
   SocketAddress stun1("stun.l.google.com", 19302);
   stun_servers.insert(stun1);
   VerifyStunServers(stun_servers);
   std::vector<RelayServerConfig> turn_servers;
   RelayServerConfig turn1("test.com", 1234, kTurnUsername, kTurnPassword,
-                          cricket::PROTO_UDP);
+                          PROTO_UDP);
   turn_servers.push_back(turn1);
   RelayServerConfig turn2("hello.com", kDefaultStunPort, kTurnUsername,
-                          kTurnPassword, cricket::PROTO_TCP);
+                          kTurnPassword, PROTO_TCP);
   turn_servers.push_back(turn2);
   VerifyTurnServers(turn_servers);
 }
@@ -527,7 +525,7 @@
   ASSERT_TRUE(result.ok());
   std::vector<RelayServerConfig> turn_servers;
   RelayServerConfig turn("test.com", 1234, kTurnUsername, kTurnPassword,
-                         cricket::PROTO_UDP);
+                         PROTO_UDP);
   turn_servers.push_back(turn);
   VerifyTurnServers(turn_servers);
 }
@@ -551,7 +549,7 @@
   ASSERT_TRUE(result.ok());
   std::vector<RelayServerConfig> turn_servers;
   RelayServerConfig turn("hello.com", kDefaultStunPort, kTurnUsername,
-                         kTurnPassword, cricket::PROTO_TCP);
+                         kTurnPassword, PROTO_TCP);
   turn_servers.push_back(turn);
   VerifyTurnServers(turn_servers);
 }
@@ -581,14 +579,14 @@
   ASSERT_TRUE(result.ok());
   std::vector<RelayServerConfig> turn_servers;
   RelayServerConfig turn1("hello.com", kDefaultStunTlsPort, kTurnUsername,
-                          kTurnPassword, cricket::PROTO_TLS);
+                          kTurnPassword, PROTO_TLS);
   turn_servers.push_back(turn1);
   // TURNS with transport param should be default to tcp.
   RelayServerConfig turn2("hello.com", 443, kTurnUsername, kTurnPassword,
-                          cricket::PROTO_TLS);
+                          PROTO_TLS);
   turn_servers.push_back(turn2);
   RelayServerConfig turn3("hello.com", kDefaultStunTlsPort, kTurnUsername,
-                          kTurnPassword, cricket::PROTO_TLS);
+                          kTurnPassword, PROTO_TLS);
   turn_servers.push_back(turn3);
   VerifyTurnServers(turn_servers);
 }
@@ -616,7 +614,7 @@
   auto result =
       factory_->CreatePeerConnectionOrError(config, std::move(pc_dependencies));
   ASSERT_TRUE(result.ok());
-  cricket::ServerAddresses stun_servers;
+  ServerAddresses stun_servers;
   SocketAddress stun1("1.2.3.4", 1234);
   stun_servers.insert(stun1);
   SocketAddress stun2("1.2.3.4", 3478);
@@ -629,7 +627,7 @@
 
   std::vector<RelayServerConfig> turn_servers;
   RelayServerConfig turn1("2401:fa00:4::", 1234, kTurnUsername, kTurnPassword,
-                          cricket::PROTO_UDP);
+                          PROTO_UDP);
   turn_servers.push_back(turn1);
   VerifyTurnServers(turn_servers);
 }
@@ -637,13 +635,13 @@
 // This test verifies the captured stream is rendered locally using a
 // local video track.
 TEST_F(PeerConnectionFactoryTest, LocalRendering) {
-  rtc::scoped_refptr<FakeVideoTrackSource> source =
+  scoped_refptr<FakeVideoTrackSource> source =
       FakeVideoTrackSource::Create(/*is_screencast=*/false);
 
   FakeFrameSource frame_source(1280, 720, kNumMicrosecsPerSec / 30);
 
   ASSERT_TRUE(source.get() != NULL);
-  rtc::scoped_refptr<VideoTrackInterface> track(
+  scoped_refptr<VideoTrackInterface> track(
       factory_->CreateVideoTrack(source, "testlabel"));
   ASSERT_TRUE(track.get() != NULL);
   FakeVideoTrackRenderer local_renderer(track.get());
@@ -676,7 +674,7 @@
   PeerConnectionFactoryDependencies pcf_dependencies;
   pcf_dependencies.network_manager = std::move(mock_network_manager);
 
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pcf =
+  scoped_refptr<PeerConnectionFactoryInterface> pcf =
       CreateModularPeerConnectionFactory(std::move(pcf_dependencies));
 
   PeerConnectionInterface::RTCConfiguration config;
@@ -705,7 +703,7 @@
   PeerConnectionFactoryDependencies pcf_dependencies;
   pcf_dependencies.packet_socket_factory = std::move(mock_socket_factory);
 
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pcf =
+  scoped_refptr<PeerConnectionFactoryInterface> pcf =
       CreateModularPeerConnectionFactory(std::move(pcf_dependencies));
 
   // By default, localhost addresses are ignored, which makes tests fail if test
diff --git a/pc/peer_connection_field_trial_tests.cc b/pc/peer_connection_field_trial_tests.cc
index 0c2352f..9ce3f16 100644
--- a/pc/peer_connection_field_trial_tests.cc
+++ b/pc/peer_connection_field_trial_tests.cc
@@ -93,7 +93,7 @@
   Clock* const clock_;
   std::unique_ptr<SocketServer> socket_server_;
   AutoSocketServerThread main_thread_;
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_ = nullptr;
+  scoped_refptr<PeerConnectionFactoryInterface> pc_factory_ = nullptr;
   PeerConnectionInterface::RTCConfiguration config_;
 };
 
@@ -113,7 +113,7 @@
   const MediaContentDescription* media_description1 =
       contents1[0].media_description();
   EXPECT_EQ(webrtc::MediaType::VIDEO, media_description1->type());
-  const cricket::RtpHeaderExtensions& rtp_header_extensions1 =
+  const RtpHeaderExtensions& rtp_header_extensions1 =
       media_description1->rtp_header_extensions();
 
   bool found =
@@ -141,13 +141,13 @@
   caller->AddTransceiver(webrtc::MediaType::VIDEO);
 
   auto offer = caller->CreateOffer();
-  cricket::ContentInfos& contents1 = offer->description()->contents();
+  ContentInfos& contents1 = offer->description()->contents();
   ASSERT_EQ(1u, contents1.size());
 
   MediaContentDescription* media_description1 =
       contents1[0].media_description();
   EXPECT_EQ(webrtc::MediaType::VIDEO, media_description1->type());
-  cricket::RtpHeaderExtensions rtp_header_extensions1 =
+  RtpHeaderExtensions rtp_header_extensions1 =
       media_description1->rtp_header_extensions();
 
   bool found1 =
@@ -185,13 +185,13 @@
   ASSERT_TRUE(callee->SetRemoteDescription(std::move(offer)));
   auto answer = callee->CreateAnswer();
 
-  cricket::ContentInfos& contents2 = answer->description()->contents();
+  ContentInfos& contents2 = answer->description()->contents();
   ASSERT_EQ(1u, contents2.size());
 
   MediaContentDescription* media_description2 =
       contents2[0].media_description();
   EXPECT_EQ(webrtc::MediaType::VIDEO, media_description2->type());
-  cricket::RtpHeaderExtensions rtp_header_extensions2 =
+  RtpHeaderExtensions rtp_header_extensions2 =
       media_description2->rtp_header_extensions();
 
   bool found2 =
diff --git a/pc/peer_connection_header_extension_unittest.cc b/pc/peer_connection_header_extension_unittest.cc
index fd2c27b..b62d68b 100644
--- a/pc/peer_connection_header_extension_unittest.cc
+++ b/pc/peer_connection_header_extension_unittest.cc
@@ -564,7 +564,7 @@
       webrtc::MediaType media_type;
       SdpSemantics semantics;
       std::tie(media_type, semantics) = info.param;
-      return (rtc::StringBuilder("With")
+      return (StringBuilder("With")
               << (semantics == SdpSemantics::kPlanB_DEPRECATED ? "PlanB"
                                                                : "UnifiedPlan")
               << "And"
diff --git a/pc/peer_connection_ice_unittest.cc b/pc/peer_connection_ice_unittest.cc
index 20ee339..7d763db 100644
--- a/pc/peer_connection_ice_unittest.cc
+++ b/pc/peer_connection_ice_unittest.cc
@@ -175,9 +175,8 @@
         CreateModularPeerConnectionFactory(std::move(pcf_deps));
 
     RTCConfiguration modified_config = config;
-    modified_config.set_port_allocator_flags(
-        cricket::PORTALLOCATOR_DISABLE_TCP |
-        cricket::PORTALLOCATOR_DISABLE_RELAY);
+    modified_config.set_port_allocator_flags(PORTALLOCATOR_DISABLE_TCP |
+                                             PORTALLOCATOR_DISABLE_RELAY);
     modified_config.sdp_semantics = sdp_semantics_;
     auto observer = std::make_unique<MockPeerConnectionObserver>();
     PeerConnectionDependencies pc_dependencies(observer.get());
@@ -826,7 +825,7 @@
 
   // Chain an operation that will block AddIceCandidate() from executing.
   auto answer_observer =
-      rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+      make_ref_counted<MockCreateSessionDescriptionObserver>();
   callee->pc()->CreateAnswer(answer_observer.get(), RTCOfferAnswerOptions());
 
   auto jsep_candidate =
@@ -880,7 +879,7 @@
 
   // Chain an operation that will block AddIceCandidate() from executing.
   auto answer_observer =
-      rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+      make_ref_counted<MockCreateSessionDescriptionObserver>();
   callee->pc()->CreateAnswer(answer_observer.get(), RTCOfferAnswerOptions());
 
   auto jsep_candidate =
@@ -1482,8 +1481,8 @@
 
   std::unique_ptr<SocketServer> socket_server_;
   AutoSocketServerThread main_thread_;
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_ = nullptr;
-  rtc::scoped_refptr<PeerConnectionInterface> pc_ = nullptr;
+  scoped_refptr<PeerConnectionFactoryInterface> pc_factory_ = nullptr;
+  scoped_refptr<PeerConnectionInterface> pc_ = nullptr;
   FakePortAllocator* port_allocator_ = nullptr;
 
   MockPeerConnectionObserver observer_;
diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc
index 0e732b6..1c1f1ae 100644
--- a/pc/peer_connection_integrationtest.cc
+++ b/pc/peer_connection_integrationtest.cc
@@ -290,7 +290,7 @@
 void TestDtmfFromSenderToReceiver(PeerConnectionIntegrationWrapper* sender,
                                   PeerConnectionIntegrationWrapper* receiver) {
   // We should be able to get a DTMF sender from the local sender.
-  rtc::scoped_refptr<DtmfSenderInterface> dtmf_sender =
+  scoped_refptr<DtmfSenderInterface> dtmf_sender =
       sender->pc()->GetSenders().at(0)->GetDtmfSender();
   ASSERT_TRUE(dtmf_sender);
   DummyDtmfObserver observer;
@@ -429,7 +429,7 @@
       CreateOneDirectionalPeerConnectionWrappers(/*caller_to_callee=*/true));
   ConnectFakeSignaling();
   // Add one-directional video, from caller to callee.
-  rtc::scoped_refptr<VideoTrackInterface> caller_track =
+  scoped_refptr<VideoTrackInterface> caller_track =
       caller()->CreateLocalVideoTrack();
   caller()->AddTrack(caller_track);
   PeerConnectionInterface::RTCOfferAnswerOptions options;
@@ -456,7 +456,7 @@
       CreateOneDirectionalPeerConnectionWrappers(/*caller_to_callee=*/false));
   ConnectFakeSignaling();
   // Add one-directional video, from callee to caller.
-  rtc::scoped_refptr<VideoTrackInterface> callee_track =
+  scoped_refptr<VideoTrackInterface> callee_track =
       callee()->CreateLocalVideoTrack();
   callee()->AddTrack(callee_track);
   PeerConnectionInterface::RTCOfferAnswerOptions options;
@@ -481,7 +481,7 @@
   ASSERT_TRUE(CreatePeerConnectionWrappers());
   ConnectFakeSignaling();
   // Add one-directional video, from caller to callee.
-  rtc::scoped_refptr<VideoTrackInterface> caller_track =
+  scoped_refptr<VideoTrackInterface> caller_track =
       caller()->CreateLocalVideoTrack();
   caller()->AddTrack(caller_track);
   caller()->CreateAndSetAndSignalOffer();
@@ -490,7 +490,7 @@
       IsRtcOk());
 
   // Add receive video.
-  rtc::scoped_refptr<VideoTrackInterface> callee_track =
+  scoped_refptr<VideoTrackInterface> callee_track =
       callee()->CreateLocalVideoTrack();
   callee()->AddTrack(callee_track);
   caller()->CreateAndSetAndSignalOffer();
@@ -509,7 +509,7 @@
   ASSERT_TRUE(CreatePeerConnectionWrappers());
   ConnectFakeSignaling();
   // Add one-directional video, from callee to caller.
-  rtc::scoped_refptr<VideoTrackInterface> callee_track =
+  scoped_refptr<VideoTrackInterface> callee_track =
       callee()->CreateLocalVideoTrack();
   callee()->AddTrack(callee_track);
   caller()->CreateAndSetAndSignalOffer();
@@ -518,7 +518,7 @@
       IsRtcOk());
 
   // Add send video.
-  rtc::scoped_refptr<VideoTrackInterface> caller_track =
+  scoped_refptr<VideoTrackInterface> caller_track =
       caller()->CreateLocalVideoTrack();
   caller()->AddTrack(caller_track);
   caller()->CreateAndSetAndSignalOffer();
@@ -537,15 +537,15 @@
   ASSERT_TRUE(CreatePeerConnectionWrappers());
   ConnectFakeSignaling();
   // Add send video, from caller to callee.
-  rtc::scoped_refptr<VideoTrackInterface> caller_track =
+  scoped_refptr<VideoTrackInterface> caller_track =
       caller()->CreateLocalVideoTrack();
-  rtc::scoped_refptr<RtpSenderInterface> caller_sender =
+  scoped_refptr<RtpSenderInterface> caller_sender =
       caller()->AddTrack(caller_track);
   // Add receive video, from callee to caller.
-  rtc::scoped_refptr<VideoTrackInterface> callee_track =
+  scoped_refptr<VideoTrackInterface> callee_track =
       callee()->CreateLocalVideoTrack();
 
-  rtc::scoped_refptr<RtpSenderInterface> callee_sender =
+  scoped_refptr<RtpSenderInterface> callee_sender =
       callee()->AddTrack(callee_track);
   caller()->CreateAndSetAndSignalOffer();
   ASSERT_THAT(
@@ -573,15 +573,15 @@
   ASSERT_TRUE(CreatePeerConnectionWrappers());
   ConnectFakeSignaling();
   // Add send video, from caller to callee.
-  rtc::scoped_refptr<VideoTrackInterface> caller_track =
+  scoped_refptr<VideoTrackInterface> caller_track =
       caller()->CreateLocalVideoTrack();
-  rtc::scoped_refptr<RtpSenderInterface> caller_sender =
+  scoped_refptr<RtpSenderInterface> caller_sender =
       caller()->AddTrack(caller_track);
   // Add receive video, from callee to caller.
-  rtc::scoped_refptr<VideoTrackInterface> callee_track =
+  scoped_refptr<VideoTrackInterface> callee_track =
       callee()->CreateLocalVideoTrack();
 
-  rtc::scoped_refptr<RtpSenderInterface> callee_sender =
+  scoped_refptr<RtpSenderInterface> callee_sender =
       callee()->AddTrack(callee_track);
   caller()->CreateAndSetAndSignalOffer();
   ASSERT_THAT(
@@ -981,7 +981,7 @@
   if (sdp_semantics_ == SdpSemantics::kPlanB_DEPRECATED) {
     caller()->SetGeneratedSdpMunger(
         [](std::unique_ptr<SessionDescriptionInterface>& sdp) {
-          for (cricket::ContentInfo& content : sdp->description()->contents()) {
+          for (ContentInfo& content : sdp->description()->contents()) {
             if (IsVideoContent(&content)) {
               content.rejected = true;
             }
@@ -1021,9 +1021,8 @@
   ConnectFakeSignaling();
 
   // Add audio track, do normal offer/answer.
-  rtc::scoped_refptr<AudioTrackInterface> track =
-      caller()->CreateLocalAudioTrack();
-  rtc::scoped_refptr<RtpSenderInterface> sender =
+  scoped_refptr<AudioTrackInterface> track = caller()->CreateLocalAudioTrack();
+  scoped_refptr<RtpSenderInterface> sender =
       caller()->pc()->AddTrack(track, {"stream"}).MoveValue();
   caller()->CreateAndSetAndSignalOffer();
   ASSERT_THAT(
@@ -1106,8 +1105,7 @@
   ASSERT_TRUE(CreatePeerConnectionWrappers());
   ConnectFakeSignaling();
   // Add one-directional video, from caller to callee.
-  rtc::scoped_refptr<VideoTrackInterface> track =
-      caller()->CreateLocalVideoTrack();
+  scoped_refptr<VideoTrackInterface> track = caller()->CreateLocalVideoTrack();
 
   RtpTransceiverInit video_transceiver_init;
   video_transceiver_init.stream_ids = {"video1"};
@@ -1122,7 +1120,7 @@
   // Add receive direction.
   video_sender->SetDirectionWithError(RtpTransceiverDirection::kSendRecv);
 
-  rtc::scoped_refptr<VideoTrackInterface> callee_track =
+  scoped_refptr<VideoTrackInterface> callee_track =
       callee()->CreateLocalVideoTrack();
 
   callee()->AddTrack(callee_track);
@@ -1170,7 +1168,7 @@
   sdp->description()->RemoveGroupByName("BUNDLE");
   for (ContentInfo& content : sdp->description()->contents()) {
     MediaContentDescription* media = content.media_description();
-    cricket::RtpHeaderExtensions extensions = media->rtp_header_extensions();
+    RtpHeaderExtensions extensions = media->rtp_header_extensions();
     extensions.erase(std::remove_if(extensions.begin(), extensions.end(),
                                     [](const RtpExtension& extension) {
                                       return extension.uri ==
@@ -1219,7 +1217,7 @@
   int pt = 96;
   for (ContentInfo& content : sdp->description()->contents()) {
     MediaContentDescription* media = content.media_description();
-    cricket::RtpHeaderExtensions extensions = media->rtp_header_extensions();
+    RtpHeaderExtensions extensions = media->rtp_header_extensions();
     extensions.erase(std::remove_if(extensions.begin(), extensions.end(),
                                     [](const RtpExtension& extension) {
                                       return extension.uri ==
@@ -1322,7 +1320,7 @@
 static void MakeSpecCompliantMaxBundleOffer(
     std::unique_ptr<SessionDescriptionInterface>& sdp) {
   bool first = true;
-  for (cricket::ContentInfo& content : sdp->description()->contents()) {
+  for (ContentInfo& content : sdp->description()->contents()) {
     if (first) {
       first = false;
       continue;
@@ -1330,15 +1328,14 @@
     content.bundle_only = true;
   }
   first = true;
-  for (cricket::TransportInfo& transport :
-       sdp->description()->transport_infos()) {
+  for (TransportInfo& transport : sdp->description()->transport_infos()) {
     if (first) {
       first = false;
       continue;
     }
     transport.description.ice_ufrag.clear();
     transport.description.ice_pwd.clear();
-    transport.description.connection_role = cricket::CONNECTIONROLE_NONE;
+    transport.description.connection_role = CONNECTIONROLE_NONE;
     transport.description.identity_fingerprint.reset(nullptr);
   }
 }
@@ -1517,8 +1514,7 @@
       audio_sender_1->track()->id(), video_sender_1->track()->id(),
       audio_sender_2->track()->id(), video_sender_2->track()->id()};
 
-  rtc::scoped_refptr<const RTCStatsReport> caller_report =
-      caller()->NewGetStats();
+  scoped_refptr<const RTCStatsReport> caller_report = caller()->NewGetStats();
   ASSERT_TRUE(caller_report);
   auto outbound_stream_stats =
       caller_report->GetStatsOfType<RTCOutboundRtpStreamStats>();
@@ -1542,8 +1538,7 @@
   }
   EXPECT_THAT(outbound_track_ids, UnorderedElementsAreArray(track_ids));
 
-  rtc::scoped_refptr<const RTCStatsReport> callee_report =
-      callee()->NewGetStats();
+  scoped_refptr<const RTCStatsReport> callee_report = callee()->NewGetStats();
   ASSERT_TRUE(callee_report);
   auto inbound_stream_stats =
       callee_report->GetStatsOfType<RTCInboundRtpStreamStats>();
@@ -1583,7 +1578,7 @@
 
   // We received a frame, so we should have nonzero "bytes received" stats for
   // the unsignaled stream, if stats are working for it.
-  rtc::scoped_refptr<const RTCStatsReport> report = callee()->NewGetStats();
+  scoped_refptr<const RTCStatsReport> report = callee()->NewGetStats();
   ASSERT_NE(nullptr, report);
   auto inbound_stream_stats =
       report->GetStatsOfType<RTCInboundRtpStreamStats>();
@@ -1635,7 +1630,7 @@
   media_expectations.CalleeExpectsSomeVideo(1);
   ASSERT_TRUE(ExpectNewFrames(media_expectations));
 
-  rtc::scoped_refptr<const RTCStatsReport> report = callee()->NewGetStats();
+  scoped_refptr<const RTCStatsReport> report = callee()->NewGetStats();
   ASSERT_NE(nullptr, report);
 
   auto inbound_rtps = report->GetStatsOfType<RTCInboundRtpStreamStats>();
@@ -1878,9 +1873,9 @@
               IsRtcOk());
 }
 
-constexpr int kOnlyLocalPorts = cricket::PORTALLOCATOR_DISABLE_STUN |
-                                cricket::PORTALLOCATOR_DISABLE_RELAY |
-                                cricket::PORTALLOCATOR_DISABLE_TCP;
+constexpr int kOnlyLocalPorts = PORTALLOCATOR_DISABLE_STUN |
+                                PORTALLOCATOR_DISABLE_RELAY |
+                                PORTALLOCATOR_DISABLE_TCP;
 
 // Use a mock resolver to resolve the hostname back to the original IP on both
 // sides and check that the ICE connection connects.
@@ -1976,7 +1971,7 @@
   }
 
   bool TestIPv6() {
-    return (port_allocator_flags_ & cricket::PORTALLOCATOR_ENABLE_IPV6);
+    return (port_allocator_flags_ & PORTALLOCATOR_ENABLE_IPV6);
   }
 
   std::vector<SocketAddress> CallerAddresses() {
@@ -2033,7 +2028,7 @@
   // Block connections to/from the caller and wait for ICE to become
   // disconnected.
   for (const auto& caller_address : CallerAddresses()) {
-    firewall()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, caller_address);
+    firewall()->AddRule(false, FP_ANY, FD_ANY, caller_address);
   }
 
   PeerConnectionInterface::RTCConfiguration config;
@@ -2115,14 +2110,14 @@
                             kIceCandidatePairHostPublicHostPublic));
 }
 
-constexpr uint32_t kFlagsIPv4NoStun = cricket::PORTALLOCATOR_DISABLE_TCP |
-                                      cricket::PORTALLOCATOR_DISABLE_STUN |
-                                      cricket::PORTALLOCATOR_DISABLE_RELAY;
+constexpr uint32_t kFlagsIPv4NoStun = PORTALLOCATOR_DISABLE_TCP |
+                                      PORTALLOCATOR_DISABLE_STUN |
+                                      PORTALLOCATOR_DISABLE_RELAY;
 constexpr uint32_t kFlagsIPv6NoStun =
-    cricket::PORTALLOCATOR_DISABLE_TCP | cricket::PORTALLOCATOR_DISABLE_STUN |
-    cricket::PORTALLOCATOR_ENABLE_IPV6 | cricket::PORTALLOCATOR_DISABLE_RELAY;
+    PORTALLOCATOR_DISABLE_TCP | PORTALLOCATOR_DISABLE_STUN |
+    PORTALLOCATOR_ENABLE_IPV6 | PORTALLOCATOR_DISABLE_RELAY;
 constexpr uint32_t kFlagsIPv4Stun =
-    cricket::PORTALLOCATOR_DISABLE_TCP | cricket::PORTALLOCATOR_DISABLE_RELAY;
+    PORTALLOCATOR_DISABLE_TCP | PORTALLOCATOR_DISABLE_RELAY;
 
 INSTANTIATE_TEST_SUITE_P(
     PeerConnectionIntegrationTest,
@@ -2254,11 +2249,11 @@
   // Sanity check that ICE renomination was actually negotiated.
   const SessionDescription* desc =
       caller()->pc()->local_description()->description();
-  for (const cricket::TransportInfo& info : desc->transport_infos()) {
+  for (const TransportInfo& info : desc->transport_infos()) {
     ASSERT_THAT(info.description.transport_options, Contains("renomination"));
   }
   desc = callee()->pc()->local_description()->description();
-  for (const cricket::TransportInfo& info : desc->transport_infos()) {
+  for (const TransportInfo& info : desc->transport_infos()) {
     ASSERT_THAT(info.description.transport_options, Contains("renomination"));
   }
   MediaExpectations media_expectations;
@@ -2600,8 +2595,7 @@
   caller()->AddAudioTrack();
 
   // Call getStats, assert there are no candidates.
-  rtc::scoped_refptr<const RTCStatsReport> first_report =
-      caller()->NewGetStats();
+  scoped_refptr<const RTCStatsReport> first_report = caller()->NewGetStats();
   ASSERT_TRUE(first_report);
   auto first_candidate_stats =
       first_report->GetStatsOfType<RTCLocalIceCandidateStats>();
@@ -2611,8 +2605,7 @@
   // callee.
   caller()->CreateAndSetAndSignalOffer();
   // Call getStats again, assert there are candidates now.
-  rtc::scoped_refptr<const RTCStatsReport> second_report =
-      caller()->NewGetStats();
+  scoped_refptr<const RTCStatsReport> second_report = caller()->NewGetStats();
   ASSERT_TRUE(second_report);
   auto second_candidate_stats =
       second_report->GetStatsOfType<RTCLocalIceCandidateStats>();
@@ -2637,8 +2630,7 @@
               IsRtcOk());
 
   // Call getStats, assert there are no candidates.
-  rtc::scoped_refptr<const RTCStatsReport> first_report =
-      caller()->NewGetStats();
+  scoped_refptr<const RTCStatsReport> first_report = caller()->NewGetStats();
   ASSERT_TRUE(first_report);
   auto first_candidate_stats =
       first_report->GetStatsOfType<RTCRemoteIceCandidateStats>();
@@ -2658,8 +2650,7 @@
   ASSERT_TRUE(result.value().ok());
 
   // Call getStats again, assert there is a remote candidate now.
-  rtc::scoped_refptr<const RTCStatsReport> second_report =
-      caller()->NewGetStats();
+  scoped_refptr<const RTCStatsReport> second_report = caller()->NewGetStats();
   ASSERT_TRUE(second_report);
   auto second_candidate_stats =
       second_report->GetStatsOfType<RTCRemoteIceCandidateStats>();
@@ -2731,7 +2722,7 @@
 
   // Enable TCP for the fake turn server.
   CreateTurnServer(turn_server_internal_address, turn_server_external_address,
-                   cricket::PROTO_TCP);
+                   PROTO_TCP);
 
   PeerConnectionInterface::IceServer ice_server;
   ice_server.urls.push_back("turn:88.88.88.0:3478?transport=tcp");
@@ -2781,7 +2772,7 @@
   // Enable TCP-TLS for the fake turn server. We need to pass in 88.88.88.0 so
   // that host name verification passes on the fake certificate.
   CreateTurnServer(turn_server_internal_address, turn_server_external_address,
-                   cricket::PROTO_TLS, "88.88.88.0");
+                   PROTO_TLS, "88.88.88.0");
 
   PeerConnectionInterface::IceServer ice_server;
   ice_server.urls.push_back("turns:88.88.88.0:3478?transport=tcp");
@@ -2847,7 +2838,7 @@
                                              /*reset_decoder_factory=*/false);
   ASSERT_TRUE(wrapper);
   wrapper->CreateDataChannel();
-  auto observer = rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+  auto observer = make_ref_counted<MockSetSessionDescriptionObserver>();
   wrapper->pc()->SetLocalDescription(observer.get(),
                                      wrapper->CreateOfferAndWait().release());
 }
@@ -3103,9 +3094,8 @@
   ConnectFakeSignaling();
 
   // Add track using stream 1, do offer/answer.
-  rtc::scoped_refptr<AudioTrackInterface> track =
-      caller()->CreateLocalAudioTrack();
-  rtc::scoped_refptr<RtpSenderInterface> sender =
+  scoped_refptr<AudioTrackInterface> track = caller()->CreateLocalAudioTrack();
+  scoped_refptr<RtpSenderInterface> sender =
       caller()->AddTrack(track, {"stream_1"});
   caller()->CreateAndSetAndSignalOffer();
   ASSERT_THAT(
@@ -3566,7 +3556,7 @@
   SetSignalIceCandidates(false);  // Workaround candidate outrace sdp.
   caller()->AddVideoTrack();
   callee()->AddVideoTrack();
-  auto observer = rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+  auto observer = make_ref_counted<MockSetSessionDescriptionObserver>();
   callee()->pc()->SetLocalDescription(observer.get(),
                                       callee()->CreateOfferAndWait().release());
   EXPECT_THAT(
@@ -3587,8 +3577,7 @@
 
   ASSERT_TRUE(CreatePeerConnectionWrappersWithConfig(config, config));
 
-  auto sld_observer =
-      rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+  auto sld_observer = make_ref_counted<MockSetSessionDescriptionObserver>();
   callee()->pc()->SetLocalDescription(sld_observer.get(),
                                       callee()->CreateOfferAndWait().release());
   EXPECT_THAT(
@@ -3596,8 +3585,7 @@
       IsRtcOk());
   EXPECT_EQ(sld_observer->error(), "");
 
-  auto srd_observer =
-      rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+  auto srd_observer = make_ref_counted<MockSetSessionDescriptionObserver>();
   callee()->pc()->SetRemoteDescription(
       srd_observer.get(), caller()->CreateOfferAndWait().release());
   EXPECT_THAT(
@@ -4159,7 +4147,7 @@
       CreateOneDirectionalPeerConnectionWrappers(/*caller_to_callee=*/true));
   ConnectFakeSignaling();
   // Add one-directional video, from caller to callee.
-  rtc::scoped_refptr<VideoTrackInterface> caller_track =
+  scoped_refptr<VideoTrackInterface> caller_track =
       caller()->CreateLocalVideoTrack();
   auto sender = caller()->AddTrack(caller_track);
   PeerConnectionInterface::RTCOfferAnswerOptions options;
@@ -4191,7 +4179,7 @@
       CreateOneDirectionalPeerConnectionWrappers(/*caller_to_callee=*/true));
   ConnectFakeSignaling();
   // Add one-directional video, from caller to callee.
-  rtc::scoped_refptr<VideoTrackInterface> caller_track =
+  scoped_refptr<VideoTrackInterface> caller_track =
       caller()->CreateLocalVideoTrack();
   auto sender = caller()->AddTrack(caller_track);
   PeerConnectionInterface::RTCOfferAnswerOptions options;
@@ -4231,7 +4219,7 @@
 }
 
 int NacksReceivedCount(PeerConnectionIntegrationWrapper& pc) {
-  rtc::scoped_refptr<const RTCStatsReport> report = pc.NewGetStats();
+  scoped_refptr<const RTCStatsReport> report = pc.NewGetStats();
   auto sender_stats = report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   if (sender_stats.size() != 1) {
     ADD_FAILURE();
@@ -4244,7 +4232,7 @@
 }
 
 int NacksSentCount(PeerConnectionIntegrationWrapper& pc) {
-  rtc::scoped_refptr<const RTCStatsReport> report = pc.NewGetStats();
+  scoped_refptr<const RTCStatsReport> report = pc.NewGetStats();
   auto receiver_stats = report->GetStatsOfType<RTCInboundRtpStreamStats>();
   if (receiver_stats.size() != 1) {
     ADD_FAILURE();
@@ -4579,7 +4567,7 @@
               IsRtcOk());
 
   for (const auto& pair : {caller(), callee()}) {
-    rtc::scoped_refptr<const RTCStatsReport> report = pair->NewGetStats();
+    scoped_refptr<const RTCStatsReport> report = pair->NewGetStats();
     ASSERT_TRUE(report);
     auto inbound_stream_stats =
         report->GetStatsOfType<RTCInboundRtpStreamStats>();
@@ -4641,7 +4629,7 @@
               IsRtcOk());
 
   for (const auto& pair : {caller(), callee()}) {
-    rtc::scoped_refptr<const RTCStatsReport> report = pair->NewGetStats();
+    scoped_refptr<const RTCStatsReport> report = pair->NewGetStats();
     ASSERT_TRUE(report);
     auto inbound_stream_stats =
         report->GetStatsOfType<RTCInboundRtpStreamStats>();
@@ -4694,7 +4682,7 @@
               IsRtcOk());
 
   for (const auto& pair : {caller(), callee()}) {
-    rtc::scoped_refptr<const RTCStatsReport> report = pair->NewGetStats();
+    scoped_refptr<const RTCStatsReport> report = pair->NewGetStats();
     ASSERT_TRUE(report);
     auto inbound_stream_stats =
         report->GetStatsOfType<RTCInboundRtpStreamStats>();
@@ -4841,8 +4829,7 @@
       "a=rtcp-fb:98 transport-cc\r\n"
       "a=rtpmap:99 rtx/90000\r\n"
       "a=fmtp:99 apt=96\r\n";
-  auto srd_observer =
-      rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+  auto srd_observer = make_ref_counted<MockSetSessionDescriptionObserver>();
   std::unique_ptr<SessionDescriptionInterface> remote_offer =
       CreateSessionDescription(SdpType::kOffer, remote_offer_string);
   EXPECT_TRUE(caller()->SetRemoteDescription(std::move(remote_offer)));
diff --git a/pc/peer_connection_interface_unittest.cc b/pc/peer_connection_interface_unittest.cc
index 1350d72..d56492a 100644
--- a/pc/peer_connection_interface_unittest.cc
+++ b/pc/peer_connection_interface_unittest.cc
@@ -456,8 +456,7 @@
 // behavior.
 std::vector<std::string> GetUfrags(const SessionDescriptionInterface* desc) {
   std::vector<std::string> ufrags;
-  for (const cricket::TransportInfo& info :
-       desc->description()->transport_infos()) {
+  for (const TransportInfo& info : desc->description()->transport_infos()) {
     ufrags.push_back(info.description.ice_ufrag);
   }
   return ufrags;
@@ -479,7 +478,7 @@
 bool ContainsTrack(const std::vector<StreamParams>& streams,
                    const std::string& stream_id,
                    const std::string& track_id) {
-  for (const cricket::StreamParams& params : streams) {
+  for (const StreamParams& params : streams) {
     if (params.first_stream_id() == stream_id && params.id == track_id) {
       return true;
     }
@@ -489,7 +488,7 @@
 
 // Check if `senders` contains the specified sender, by id.
 bool ContainsSender(
-    const std::vector<rtc::scoped_refptr<RtpSenderInterface>>& senders,
+    const std::vector<scoped_refptr<RtpSenderInterface>>& senders,
     const std::string& id) {
   for (const auto& sender : senders) {
     if (sender->id() == id) {
@@ -501,7 +500,7 @@
 
 // Check if `senders` contains the specified sender, by id and stream id.
 bool ContainsSender(
-    const std::vector<rtc::scoped_refptr<RtpSenderInterface>>& senders,
+    const std::vector<scoped_refptr<RtpSenderInterface>>& senders,
     const std::string& id,
     const std::string& stream_id) {
   for (const auto& sender : senders) {
@@ -516,24 +515,22 @@
 // CreateStreamCollection(1) creates a collection that
 // correspond to kSdpStringWithStream1.
 // CreateStreamCollection(2) correspond to kSdpStringWithStream1And2.
-rtc::scoped_refptr<StreamCollection> CreateStreamCollection(
-    int number_of_streams,
-    int tracks_per_stream) {
-  rtc::scoped_refptr<StreamCollection> local_collection(
-      StreamCollection::Create());
+scoped_refptr<StreamCollection> CreateStreamCollection(int number_of_streams,
+                                                       int tracks_per_stream) {
+  scoped_refptr<StreamCollection> local_collection(StreamCollection::Create());
 
   for (int i = 0; i < number_of_streams; ++i) {
-    rtc::scoped_refptr<MediaStreamInterface> stream(
+    scoped_refptr<MediaStreamInterface> stream(
         MediaStream::Create(kStreams[i]));
 
     for (int j = 0; j < tracks_per_stream; ++j) {
       // Add a local audio track.
-      rtc::scoped_refptr<AudioTrackInterface> audio_track(
+      scoped_refptr<AudioTrackInterface> audio_track(
           AudioTrack::Create(kAudioTracks[i * tracks_per_stream + j], nullptr));
       stream->AddTrack(audio_track);
 
       // Add a local video track.
-      rtc::scoped_refptr<VideoTrackInterface> video_track(VideoTrack::Create(
+      scoped_refptr<VideoTrackInterface> video_track(VideoTrack::Create(
           kVideoTracks[i * tracks_per_stream + j],
           FakeVideoTrackSource::Create(), Thread::Current()));
       stream->AddTrack(video_track);
@@ -609,7 +606,7 @@
 // exercised by these unittest.
 class PeerConnectionFactoryForTest : public PeerConnectionFactory {
  public:
-  static rtc::scoped_refptr<PeerConnectionFactoryForTest>
+  static scoped_refptr<PeerConnectionFactoryForTest>
   CreatePeerConnectionFactoryForTest() {
     PeerConnectionFactoryDependencies dependencies;
     dependencies.worker_thread = Thread::Current();
@@ -623,14 +620,14 @@
     EnableMediaWithDefaults(dependencies);
     dependencies.event_log_factory = std::make_unique<RtcEventLogFactory>();
 
-    return rtc::make_ref_counted<PeerConnectionFactoryForTest>(
+    return make_ref_counted<PeerConnectionFactoryForTest>(
         std::move(dependencies));
   }
 
   using PeerConnectionFactory::PeerConnectionFactory;
 
  private:
-  rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
+  scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
 };
 
 // TODO(steveanton): Convert to use the new PeerConnectionWrapper.
@@ -651,7 +648,7 @@
     fake_audio_capture_module_ = FakeAudioCaptureModule::Create();
     pc_factory_ = CreatePeerConnectionFactory(
         Thread::Current(), Thread::Current(), Thread::Current(),
-        rtc::scoped_refptr<AudioDeviceModule>(fake_audio_capture_module_),
+        scoped_refptr<AudioDeviceModule>(fake_audio_capture_module_),
         CreateBuiltinAudioEncoderFactory(), CreateBuiltinAudioDecoderFactory(),
         std::make_unique<VideoEncoderFactoryTemplate<
             LibvpxVp8EncoderTemplateAdapter, LibvpxVp9EncoderTemplateAdapter,
@@ -787,7 +784,7 @@
     observer_.SetPeerConnectionInterface(nullptr);
   }
 
-  rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack(
+  scoped_refptr<VideoTrackInterface> CreateVideoTrack(
       const std::string& label) {
     return pc_factory_->CreateVideoTrack(FakeVideoTrackSource::Create(), label);
   }
@@ -800,13 +797,13 @@
   }
 
   void AddVideoStream(const std::string& label) {
-    rtc::scoped_refptr<MediaStreamInterface> stream(
+    scoped_refptr<MediaStreamInterface> stream(
         pc_factory_->CreateLocalMediaStream(label));
     stream->AddTrack(CreateVideoTrack(label + "v0"));
     ASSERT_TRUE(pc_->AddStream(stream.get()));
   }
 
-  rtc::scoped_refptr<AudioTrackInterface> CreateAudioTrack(
+  scoped_refptr<AudioTrackInterface> CreateAudioTrack(
       const std::string& label) {
     return pc_factory_->CreateAudioTrack(label, nullptr);
   }
@@ -819,7 +816,7 @@
   }
 
   void AddAudioStream(const std::string& label) {
-    rtc::scoped_refptr<MediaStreamInterface> stream(
+    scoped_refptr<MediaStreamInterface> stream(
         pc_factory_->CreateLocalMediaStream(label));
     stream->AddTrack(CreateAudioTrack(label + "a0"));
     ASSERT_TRUE(pc_->AddStream(stream.get()));
@@ -829,14 +826,14 @@
                            const std::string& audio_track_label,
                            const std::string& video_track_label) {
     // Create a local stream.
-    rtc::scoped_refptr<MediaStreamInterface> stream(
+    scoped_refptr<MediaStreamInterface> stream(
         pc_factory_->CreateLocalMediaStream(stream_id));
     stream->AddTrack(CreateAudioTrack(audio_track_label));
     stream->AddTrack(CreateVideoTrack(video_track_label));
     ASSERT_TRUE(pc_->AddStream(stream.get()));
   }
 
-  rtc::scoped_refptr<RtpReceiverInterface> GetFirstReceiverOfType(
+  scoped_refptr<RtpReceiverInterface> GetFirstReceiverOfType(
       webrtc::MediaType media_type) {
     for (auto receiver : pc_->GetReceivers()) {
       if (receiver->media_type() == media_type) {
@@ -849,8 +846,7 @@
   bool DoCreateOfferAnswer(std::unique_ptr<SessionDescriptionInterface>* desc,
                            const RTCOfferAnswerOptions* options,
                            bool offer) {
-    auto observer =
-        rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+    auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
     if (offer) {
       pc_->CreateOffer(observer.get(),
                        options ? *options : RTCOfferAnswerOptions());
@@ -879,7 +875,7 @@
   bool DoSetSessionDescription(
       std::unique_ptr<SessionDescriptionInterface> desc,
       bool local) {
-    auto observer = rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+    auto observer = make_ref_counted<MockSetSessionDescriptionObserver>();
     if (local) {
       pc_->SetLocalDescription(observer.get(), desc.release());
     } else {
@@ -908,7 +904,7 @@
   // It does not verify the values in the StatReports since a RTCP packet might
   // be required.
   bool DoGetStats(MediaStreamTrackInterface* track) {
-    auto observer = rtc::make_ref_counted<MockStatsObserver>();
+    auto observer = make_ref_counted<MockStatsObserver>();
     if (!pc_->GetStats(observer.get(), track,
                        PeerConnectionInterface::kStatsOutputLevelStandard))
       return false;
@@ -921,7 +917,7 @@
 
   // Call the standards-compliant GetStats function.
   bool DoGetRTCStats() {
-    auto callback = rtc::make_ref_counted<MockRTCStatsCollectorCallback>();
+    auto callback = make_ref_counted<MockRTCStatsCollectorCallback>();
     pc_->GetStats(callback.get());
     EXPECT_THAT(
         WaitUntil([&] { return callback->called(); }, ::testing::IsTrue(),
@@ -1103,7 +1099,7 @@
 
     std::string mediastream_id = kStreams[0];
 
-    rtc::scoped_refptr<MediaStreamInterface> stream(
+    scoped_refptr<MediaStreamInterface> stream(
         MediaStream::Create(mediastream_id));
     reference_collection_->AddStream(stream);
 
@@ -1133,14 +1129,14 @@
 
   void AddAudioTrack(const std::string& track_id,
                      MediaStreamInterface* stream) {
-    rtc::scoped_refptr<AudioTrackInterface> audio_track(
+    scoped_refptr<AudioTrackInterface> audio_track(
         AudioTrack::Create(track_id, nullptr));
     ASSERT_TRUE(stream->AddTrack(audio_track));
   }
 
   void AddVideoTrack(const std::string& track_id,
                      MediaStreamInterface* stream) {
-    rtc::scoped_refptr<VideoTrackInterface> video_track(VideoTrack::Create(
+    scoped_refptr<VideoTrackInterface> video_track(VideoTrack::Create(
         track_id, FakeVideoTrackSource::Create(), Thread::Current()));
     ASSERT_TRUE(stream->AddTrack(video_track));
   }
@@ -1186,8 +1182,7 @@
   std::unique_ptr<SessionDescriptionInterface> CreateOfferWithOptions(
       const RTCOfferAnswerOptions& offer_answer_options) {
     RTC_DCHECK(pc_);
-    auto observer =
-        rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+    auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
     pc_->CreateOffer(observer.get(), offer_answer_options);
     EXPECT_THAT(
         WaitUntil([&] { return observer->called(); }, ::testing::IsTrue(),
@@ -1254,13 +1249,13 @@
 
   std::unique_ptr<VirtualSocketServer> vss_;
   AutoSocketServerThread main_;
-  rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
+  scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
   FakePortAllocator* port_allocator_ = nullptr;
   FakeRTCCertificateGenerator* fake_certificate_generator_ = nullptr;
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
-  rtc::scoped_refptr<PeerConnectionInterface> pc_;
+  scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
+  scoped_refptr<PeerConnectionInterface> pc_;
   MockPeerConnectionObserver observer_;
-  rtc::scoped_refptr<StreamCollection> reference_collection_;
+  scoped_refptr<StreamCollection> reference_collection_;
   const SdpSemantics sdp_semantics_;
 };
 
@@ -1372,7 +1367,7 @@
   config.prune_turn_ports = true;
 
   // Create the PC factory and PC with the above config.
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory(
+  scoped_refptr<PeerConnectionFactoryInterface> pc_factory(
       CreatePeerConnectionFactory(
           Thread::Current(), Thread::Current(), Thread::Current(),
           fake_audio_capture_module_, CreateBuiltinAudioEncoderFactory(),
@@ -1449,11 +1444,10 @@
   ASSERT_EQ(2u, pc_->local_streams()->count());
 
   // Test we can add multiple local streams to one peerconnection.
-  rtc::scoped_refptr<MediaStreamInterface> stream(
+  scoped_refptr<MediaStreamInterface> stream(
       pc_factory_->CreateLocalMediaStream(kStreamId3));
-  rtc::scoped_refptr<AudioTrackInterface> audio_track(
-      pc_factory_->CreateAudioTrack(
-          kStreamId3, static_cast<AudioSourceInterface*>(nullptr)));
+  scoped_refptr<AudioTrackInterface> audio_track(pc_factory_->CreateAudioTrack(
+      kStreamId3, static_cast<AudioSourceInterface*>(nullptr)));
   stream->AddTrack(audio_track);
   EXPECT_TRUE(pc_->AddStream(stream.get()));
   EXPECT_EQ(3u, pc_->local_streams()->count());
@@ -1518,9 +1512,9 @@
 // in peerconnection_jsep_unittests.cc
 TEST_F(PeerConnectionInterfaceTestPlanB, AddTrackRemoveTrack) {
   CreatePeerConnectionWithoutDtls();
-  rtc::scoped_refptr<AudioTrackInterface> audio_track(
+  scoped_refptr<AudioTrackInterface> audio_track(
       CreateAudioTrack("audio_track"));
-  rtc::scoped_refptr<VideoTrackInterface> video_track(
+  scoped_refptr<VideoTrackInterface> video_track(
       CreateVideoTrack("video_track"));
   auto audio_sender = pc_->AddTrack(audio_track, {kStreamId1}).MoveValue();
   auto video_sender = pc_->AddTrack(video_track, {kStreamId1}).MoveValue();
@@ -1573,9 +1567,9 @@
 // Test for AddTrack with init_send_encoding.
 TEST_F(PeerConnectionInterfaceTestPlanB, AddTrackWithSendEncodings) {
   CreatePeerConnectionWithoutDtls();
-  rtc::scoped_refptr<AudioTrackInterface> audio_track(
+  scoped_refptr<AudioTrackInterface> audio_track(
       CreateAudioTrack("audio_track"));
-  rtc::scoped_refptr<VideoTrackInterface> video_track(
+  scoped_refptr<VideoTrackInterface> video_track(
       CreateVideoTrack("video_track"));
   RtpEncodingParameters audio_encodings;
   audio_encodings.active = false;
@@ -1623,9 +1617,9 @@
 // expecting a random stream ID to be generated.
 TEST_P(PeerConnectionInterfaceTest, AddTrackWithoutStream) {
   CreatePeerConnectionWithoutDtls();
-  rtc::scoped_refptr<AudioTrackInterface> audio_track(
+  scoped_refptr<AudioTrackInterface> audio_track(
       CreateAudioTrack("audio_track"));
-  rtc::scoped_refptr<VideoTrackInterface> video_track(
+  scoped_refptr<VideoTrackInterface> video_track(
       CreateVideoTrack("video_track"));
   auto audio_sender =
       pc_->AddTrack(audio_track, std::vector<std::string>()).MoveValue();
@@ -1651,9 +1645,9 @@
 // the PeerConnection to a peer.
 TEST_P(PeerConnectionInterfaceTest, AddTrackBeforeConnecting) {
   CreatePeerConnection();
-  rtc::scoped_refptr<AudioTrackInterface> audio_track(
+  scoped_refptr<AudioTrackInterface> audio_track(
       CreateAudioTrack("audio_track"));
-  rtc::scoped_refptr<VideoTrackInterface> video_track(
+  scoped_refptr<VideoTrackInterface> video_track(
       CreateVideoTrack("video_track"));
   auto audio_sender = pc_->AddTrack(audio_track, std::vector<std::string>());
   auto video_sender = pc_->AddTrack(video_track, std::vector<std::string>());
@@ -1662,9 +1656,9 @@
 
 TEST_P(PeerConnectionInterfaceTest, AttachmentIdIsSetOnAddTrack) {
   CreatePeerConnection();
-  rtc::scoped_refptr<AudioTrackInterface> audio_track(
+  scoped_refptr<AudioTrackInterface> audio_track(
       CreateAudioTrack("audio_track"));
-  rtc::scoped_refptr<VideoTrackInterface> video_track(
+  scoped_refptr<VideoTrackInterface> video_track(
       CreateVideoTrack("video_track"));
   auto audio_sender = pc_->AddTrack(audio_track, std::vector<std::string>());
   ASSERT_TRUE(audio_sender.ok());
@@ -1848,7 +1842,7 @@
   MediaStreamInterface* stream = pc_->local_streams()->at(0);
 
   // Add video track to the audio-only stream.
-  rtc::scoped_refptr<VideoTrackInterface> video_track(
+  scoped_refptr<VideoTrackInterface> video_track(
       CreateVideoTrack("video_label"));
   stream->AddTrack(video_track);
 
@@ -1903,7 +1897,7 @@
   InitiateCall();
   ASSERT_LT(0u, pc_->GetSenders().size());
   ASSERT_LT(0u, pc_->GetReceivers().size());
-  rtc::scoped_refptr<MediaStreamTrackInterface> remote_audio =
+  scoped_refptr<MediaStreamTrackInterface> remote_audio =
       pc_->GetReceivers()[0]->track();
   EXPECT_TRUE(DoGetStats(remote_audio.get()));
 
@@ -1929,7 +1923,7 @@
 // Test that we don't get statistics for an invalid track.
 TEST_P(PeerConnectionInterfaceTest, GetStatsForInvalidTrack) {
   InitiateCall();
-  rtc::scoped_refptr<AudioTrackInterface> unknown_audio_track(
+  scoped_refptr<AudioTrackInterface> unknown_audio_track(
       pc_factory_->CreateAudioTrack("unknown track", nullptr));
   EXPECT_FALSE(DoGetStats(unknown_audio_track.get()));
 }
@@ -2477,8 +2471,7 @@
   CreateAnswerAsLocalDescription();
 
   ASSERT_EQ(1u, pc_->local_streams()->count());
-  rtc::scoped_refptr<MediaStreamInterface> local_stream(
-      pc_->local_streams()->at(0));
+  scoped_refptr<MediaStreamInterface> local_stream(pc_->local_streams()->at(0));
 
   pc_->Close();
 
@@ -2526,7 +2519,7 @@
   CreatePeerConnection(config);
   CreateAndSetRemoteOffer(GetSdpStringWithStream1());
 
-  rtc::scoped_refptr<StreamCollection> reference(CreateStreamCollection(1, 1));
+  scoped_refptr<StreamCollection> reference(CreateStreamCollection(1, 1));
   EXPECT_TRUE(
       CompareStreamCollections(observer_.remote_streams(), reference.get()));
   MediaStreamInterface* remote_stream = observer_.remote_streams()->at(0);
@@ -2536,7 +2529,7 @@
   // MediaStream.
   CreateAndSetRemoteOffer(GetSdpStringWithStream1And2());
 
-  rtc::scoped_refptr<StreamCollection> reference2(CreateStreamCollection(2, 1));
+  scoped_refptr<StreamCollection> reference2(CreateStreamCollection(2, 1));
   EXPECT_TRUE(
       CompareStreamCollections(observer_.remote_streams(), reference2.get()));
 }
@@ -2561,10 +2554,10 @@
   EXPECT_TRUE(DoSetRemoteDescription(std::move(desc_ms1_two_tracks)));
   EXPECT_TRUE(CompareStreamCollections(observer_.remote_streams(),
                                        reference_collection_.get()));
-  rtc::scoped_refptr<AudioTrackInterface> audio_track2 =
+  scoped_refptr<AudioTrackInterface> audio_track2 =
       observer_.remote_streams()->at(0)->GetAudioTracks()[1];
   EXPECT_EQ(MediaStreamTrackInterface::kLive, audio_track2->state());
-  rtc::scoped_refptr<VideoTrackInterface> video_track2 =
+  scoped_refptr<VideoTrackInterface> video_track2 =
       observer_.remote_streams()->at(0)->GetVideoTracks()[1];
   EXPECT_EQ(MediaStreamTrackInterface::kLive, video_track2->state());
 
@@ -2603,10 +2596,10 @@
   auto video_receiver = GetFirstReceiverOfType(webrtc::MediaType::VIDEO);
   ASSERT_TRUE(video_receiver);
 
-  rtc::scoped_refptr<MediaStreamTrackInterface> remote_audio =
+  scoped_refptr<MediaStreamTrackInterface> remote_audio =
       audio_receiver->track();
   EXPECT_EQ(MediaStreamTrackInterface::kLive, remote_audio->state());
-  rtc::scoped_refptr<MediaStreamTrackInterface> remote_video =
+  scoped_refptr<MediaStreamTrackInterface> remote_video =
       video_receiver->track();
   EXPECT_EQ(MediaStreamTrackInterface::kLive, remote_video->state());
 
@@ -2797,7 +2790,7 @@
   RTCConfiguration config;
   CreatePeerConnection(config);
   CreateAndSetRemoteOffer(GetSdpStringWithStream1());
-  rtc::scoped_refptr<StreamCollection> reference(CreateStreamCollection(1, 1));
+  scoped_refptr<StreamCollection> reference(CreateStreamCollection(1, 1));
   EXPECT_TRUE(
       CompareStreamCollections(observer_.remote_streams(), reference.get()));
 
@@ -2872,7 +2865,7 @@
   CreatePeerConnection(config);
 
   // Create an offer with 1 stream with 2 tracks of each type.
-  rtc::scoped_refptr<StreamCollection> stream_collection =
+  scoped_refptr<StreamCollection> stream_collection =
       CreateStreamCollection(1, 2);
   pc_->AddStream(stream_collection->at(0));
   std::unique_ptr<SessionDescriptionInterface> offer;
@@ -2909,7 +2902,7 @@
   RTCConfiguration config;
   CreatePeerConnection(config);
 
-  rtc::scoped_refptr<StreamCollection> stream_collection =
+  scoped_refptr<StreamCollection> stream_collection =
       CreateStreamCollection(1, 2);
   // Add a stream to create the offer, but remove it afterwards.
   pc_->AddStream(stream_collection->at(0));
@@ -2988,7 +2981,7 @@
   RTCConfiguration config;
   CreatePeerConnection(config);
 
-  rtc::scoped_refptr<StreamCollection> stream_collection =
+  scoped_refptr<StreamCollection> stream_collection =
       CreateStreamCollection(2, 1);
   pc_->AddStream(stream_collection->at(0));
   std::unique_ptr<SessionDescriptionInterface> offer;
@@ -3001,7 +2994,7 @@
   EXPECT_TRUE(ContainsSender(senders, kVideoTracks[0], kStreams[0]));
 
   // Add a new MediaStream but with the same tracks as in the first stream.
-  rtc::scoped_refptr<MediaStreamInterface> stream_1(
+  scoped_refptr<MediaStreamInterface> stream_1(
       MediaStream::Create(kStreams[1]));
   stream_1->AddTrack(stream_collection->at(0)->GetVideoTracks()[0]);
   stream_1->AddTrack(stream_collection->at(0)->GetAudioTracks()[0]);
@@ -3616,12 +3609,12 @@
 TEST_F(PeerConnectionInterfaceTestPlanB,
        MediaStreamAddTrackRemoveTrackRenegotiate) {
   CreatePeerConnectionWithoutDtls();
-  rtc::scoped_refptr<MediaStreamInterface> stream(
+  scoped_refptr<MediaStreamInterface> stream(
       pc_factory_->CreateLocalMediaStream(kStreamId1));
   pc_->AddStream(stream.get());
-  rtc::scoped_refptr<AudioTrackInterface> audio_track(
+  scoped_refptr<AudioTrackInterface> audio_track(
       CreateAudioTrack("audio_track"));
-  rtc::scoped_refptr<VideoTrackInterface> video_track(
+  scoped_refptr<VideoTrackInterface> video_track(
       CreateVideoTrack("video_track"));
   stream->AddTrack(audio_track);
   EXPECT_THAT(WaitUntil([&] { return observer_.renegotiation_needed_; },
@@ -3706,11 +3699,11 @@
   CreatePeerConnection();
   AddVideoTrack("video_label");
 
-  std::vector<rtc::scoped_refptr<RtpSenderInterface>> rtp_senders =
+  std::vector<scoped_refptr<RtpSenderInterface>> rtp_senders =
       pc_->GetSenders();
   ASSERT_EQ(rtp_senders.size(), 1u);
   ASSERT_EQ(rtp_senders[0]->media_type(), webrtc::MediaType::VIDEO);
-  rtc::scoped_refptr<RtpSenderInterface> video_rtp_sender = rtp_senders[0];
+  scoped_refptr<RtpSenderInterface> video_rtp_sender = rtp_senders[0];
   RtpParameters parameters = video_rtp_sender->GetParameters();
   ASSERT_NE(parameters.degradation_preference,
             DegradationPreference::MAINTAIN_RESOLUTION);
@@ -3746,7 +3739,7 @@
     return result.value()->GetConfiguration().media_config;
   }
 
-  rtc::scoped_refptr<PeerConnectionFactoryForTest> pcf_;
+  scoped_refptr<PeerConnectionFactoryForTest> pcf_;
   MockPeerConnectionObserver observer_;
 };
 
diff --git a/pc/peer_connection_internal.h b/pc/peer_connection_internal.h
index 11bdb07..daa0649 100644
--- a/pc/peer_connection_internal.h
+++ b/pc/peer_connection_internal.h
@@ -119,11 +119,11 @@
 
   // Internal implementation for AddTransceiver family of methods. If
   // `fire_callback` is set, fires OnRenegotiationNeeded callback if successful.
-  virtual RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
-  AddTransceiver(webrtc::MediaType media_type,
-                 rtc::scoped_refptr<MediaStreamTrackInterface> track,
-                 const RtpTransceiverInit& init,
-                 bool fire_callback = true) = 0;
+  virtual RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
+      webrtc::MediaType media_type,
+      scoped_refptr<MediaStreamTrackInterface> track,
+      const RtpTransceiverInit& init,
+      bool fire_callback = true) = 0;
   // Asynchronously calls SctpTransport::Start() on the network thread for
   // `sctp_mid()` if set. Called as part of setting the local description.
   virtual RTCError StartSctpTransport(const SctpOptions& options) = 0;
@@ -172,7 +172,7 @@
   virtual bool initial_offerer() const = 0;
 
   virtual std::vector<
-      rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
+      scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
   GetTransceiversInternal() const = 0;
 
   // Call on the network thread to fetch stats for all the data channels.
@@ -183,7 +183,7 @@
 
   virtual std::optional<std::string> sctp_transport_name() const = 0;
 
-  virtual cricket::CandidateStatsList GetPooledCandidateStats() const = 0;
+  virtual CandidateStatsList GetPooledCandidateStats() const = 0;
 
   // Returns a map from transport name to transport stats for all given
   // transport names.
@@ -197,7 +197,7 @@
 
   virtual bool GetLocalCertificate(
       const std::string& transport_name,
-      rtc::scoped_refptr<RTCCertificate>* certificate) = 0;
+      scoped_refptr<RTCCertificate>* certificate) = 0;
   virtual std::unique_ptr<SSLCertChain> GetRemoteSSLCertChain(
       const std::string& transport_name) = 0;
 
diff --git a/pc/peer_connection_jsep_unittest.cc b/pc/peer_connection_jsep_unittest.cc
index 577d84d..27aba15 100644
--- a/pc/peer_connection_jsep_unittest.cc
+++ b/pc/peer_connection_jsep_unittest.cc
@@ -60,7 +60,7 @@
 
 namespace webrtc {
 
-using cricket::MediaContentDescription;
+using webrtc::MediaContentDescription;
 using RTCConfiguration = PeerConnectionInterface::RTCConfiguration;
 using ::testing::Combine;
 using ::testing::ElementsAre;
@@ -98,7 +98,7 @@
   }
 
   WrapperPtr CreatePeerConnection(const RTCConfiguration& config) {
-    rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory =
+    scoped_refptr<PeerConnectionFactoryInterface> pc_factory =
         CreateModularPeerConnectionFactory(
             CreatePeerConnectionFactoryDependencies());
     auto observer = std::make_unique<MockPeerConnectionObserver>();
diff --git a/pc/peer_connection_media_unittest.cc b/pc/peer_connection_media_unittest.cc
index 7bcf4aa..242984a 100644
--- a/pc/peer_connection_media_unittest.cc
+++ b/pc/peer_connection_media_unittest.cc
@@ -77,7 +77,7 @@
 using ::testing::Values;
 
 RtpTransceiver* RtpTransceiverInternal(
-    rtc::scoped_refptr<RtpTransceiverInterface> transceiver) {
+    scoped_refptr<RtpTransceiverInterface> transceiver) {
   auto transceiver_with_internal = static_cast<
       RefCountedObject<RtpTransceiverProxyWithInternal<RtpTransceiver>>*>(
       transceiver.get());
@@ -87,34 +87,34 @@
 }
 
 MediaSendChannelInterface* SendChannelInternal(
-    rtc::scoped_refptr<RtpTransceiverInterface> transceiver) {
+    scoped_refptr<RtpTransceiverInterface> transceiver) {
   auto transceiver_internal = RtpTransceiverInternal(transceiver);
   return transceiver_internal->channel()->media_send_channel();
 }
 
 MediaReceiveChannelInterface* ReceiveChannelInternal(
-    rtc::scoped_refptr<RtpTransceiverInterface> transceiver) {
+    scoped_refptr<RtpTransceiverInterface> transceiver) {
   auto transceiver_internal = RtpTransceiverInternal(transceiver);
   return transceiver_internal->channel()->media_receive_channel();
 }
 
 FakeVideoMediaSendChannel* VideoMediaSendChannel(
-    rtc::scoped_refptr<RtpTransceiverInterface> transceiver) {
+    scoped_refptr<RtpTransceiverInterface> transceiver) {
   return static_cast<FakeVideoMediaSendChannel*>(
       SendChannelInternal(transceiver));
 }
 FakeVideoMediaReceiveChannel* VideoMediaReceiveChannel(
-    rtc::scoped_refptr<RtpTransceiverInterface> transceiver) {
+    scoped_refptr<RtpTransceiverInterface> transceiver) {
   return static_cast<FakeVideoMediaReceiveChannel*>(
       ReceiveChannelInternal(transceiver));
 }
 FakeVoiceMediaSendChannel* VoiceMediaSendChannel(
-    rtc::scoped_refptr<RtpTransceiverInterface> transceiver) {
+    scoped_refptr<RtpTransceiverInterface> transceiver) {
   return static_cast<FakeVoiceMediaSendChannel*>(
       SendChannelInternal(transceiver));
 }
 FakeVoiceMediaReceiveChannel* VoiceMediaReceiveChannel(
-    rtc::scoped_refptr<RtpTransceiverInterface> transceiver) {
+    scoped_refptr<RtpTransceiverInterface> transceiver) {
   return static_cast<FakeVoiceMediaReceiveChannel*>(
       ReceiveChannelInternal(transceiver));
 }
diff --git a/pc/peer_connection_message_handler.cc b/pc/peer_connection_message_handler.cc
index 24ddc17..a4494f5 100644
--- a/pc/peer_connection_message_handler.cc
+++ b/pc/peer_connection_message_handler.cc
@@ -28,8 +28,8 @@
 namespace {
 
 template <typename T>
-rtc::scoped_refptr<T> WrapScoped(T* ptr) {
-  return rtc::scoped_refptr<T>(ptr);
+scoped_refptr<T> WrapScoped(T* ptr) {
+  return scoped_refptr<T>(ptr);
 }
 
 }  // namespace
diff --git a/pc/peer_connection_proxy.h b/pc/peer_connection_proxy.h
index 93f947f..4f809ab 100644
--- a/pc/peer_connection_proxy.h
+++ b/pc/peer_connection_proxy.h
@@ -53,45 +53,42 @@
 // an implementation detail.
 BEGIN_PROXY_MAP(PeerConnection)
 PROXY_PRIMARY_THREAD_DESTRUCTOR()
-PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, local_streams)
-PROXY_METHOD0(rtc::scoped_refptr<StreamCollectionInterface>, remote_streams)
+PROXY_METHOD0(scoped_refptr<StreamCollectionInterface>, local_streams)
+PROXY_METHOD0(scoped_refptr<StreamCollectionInterface>, remote_streams)
 PROXY_METHOD1(bool, AddStream, MediaStreamInterface*)
 PROXY_METHOD1(void, RemoveStream, MediaStreamInterface*)
-PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>,
+PROXY_METHOD2(RTCErrorOr<scoped_refptr<RtpSenderInterface>>,
               AddTrack,
-              rtc::scoped_refptr<MediaStreamTrackInterface>,
+              scoped_refptr<MediaStreamTrackInterface>,
               const std::vector<std::string>&)
-PROXY_METHOD3(RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>,
+PROXY_METHOD3(RTCErrorOr<scoped_refptr<RtpSenderInterface>>,
               AddTrack,
-              rtc::scoped_refptr<MediaStreamTrackInterface>,
+              scoped_refptr<MediaStreamTrackInterface>,
               const std::vector<std::string>&,
               const std::vector<RtpEncodingParameters>&)
-PROXY_METHOD1(RTCError,
-              RemoveTrackOrError,
-              rtc::scoped_refptr<RtpSenderInterface>)
-PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
+PROXY_METHOD1(RTCError, RemoveTrackOrError, scoped_refptr<RtpSenderInterface>)
+PROXY_METHOD1(RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>,
               AddTransceiver,
-              rtc::scoped_refptr<MediaStreamTrackInterface>)
-PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
+              scoped_refptr<MediaStreamTrackInterface>)
+PROXY_METHOD2(RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>,
               AddTransceiver,
-              rtc::scoped_refptr<MediaStreamTrackInterface>,
+              scoped_refptr<MediaStreamTrackInterface>,
               const RtpTransceiverInit&)
-PROXY_METHOD1(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
+PROXY_METHOD1(RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>,
               AddTransceiver,
               webrtc::MediaType)
-PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
+PROXY_METHOD2(RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>,
               AddTransceiver,
               webrtc::MediaType,
               const RtpTransceiverInit&)
-PROXY_METHOD2(rtc::scoped_refptr<RtpSenderInterface>,
+PROXY_METHOD2(scoped_refptr<RtpSenderInterface>,
               CreateSender,
               const std::string&,
               const std::string&)
-PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpSenderInterface>>,
-                   GetSenders)
-PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>,
+PROXY_CONSTMETHOD0(std::vector<scoped_refptr<RtpSenderInterface>>, GetSenders)
+PROXY_CONSTMETHOD0(std::vector<scoped_refptr<RtpReceiverInterface>>,
                    GetReceivers)
-PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>,
+PROXY_CONSTMETHOD0(std::vector<scoped_refptr<RtpTransceiverInterface>>,
                    GetTransceivers)
 PROXY_METHOD3(bool,
               GetStats,
@@ -101,14 +98,14 @@
 PROXY_METHOD1(void, GetStats, RTCStatsCollectorCallback*)
 PROXY_METHOD2(void,
               GetStats,
-              rtc::scoped_refptr<RtpSenderInterface>,
-              rtc::scoped_refptr<RTCStatsCollectorCallback>)
+              scoped_refptr<RtpSenderInterface>,
+              scoped_refptr<RTCStatsCollectorCallback>)
 PROXY_METHOD2(void,
               GetStats,
-              rtc::scoped_refptr<RtpReceiverInterface>,
-              rtc::scoped_refptr<RTCStatsCollectorCallback>)
+              scoped_refptr<RtpReceiverInterface>,
+              scoped_refptr<RTCStatsCollectorCallback>)
 PROXY_METHOD0(void, ClearStatsCache)
-PROXY_METHOD2(RTCErrorOr<rtc::scoped_refptr<DataChannelInterface>>,
+PROXY_METHOD2(RTCErrorOr<scoped_refptr<DataChannelInterface>>,
               CreateDataChannelOrError,
               const std::string&,
               const DataChannelInit*)
@@ -134,10 +131,10 @@
 PROXY_METHOD2(void,
               SetLocalDescription,
               std::unique_ptr<SessionDescriptionInterface>,
-              rtc::scoped_refptr<SetLocalDescriptionObserverInterface>)
+              scoped_refptr<SetLocalDescriptionObserverInterface>)
 PROXY_METHOD1(void,
               SetLocalDescription,
-              rtc::scoped_refptr<SetLocalDescriptionObserverInterface>)
+              scoped_refptr<SetLocalDescriptionObserverInterface>)
 PROXY_METHOD2(void,
               SetLocalDescription,
               SetSessionDescriptionObserver*,
@@ -146,7 +143,7 @@
 PROXY_METHOD2(void,
               SetRemoteDescription,
               std::unique_ptr<SessionDescriptionInterface>,
-              rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>)
+              scoped_refptr<SetRemoteDescriptionObserverInterface>)
 PROXY_METHOD2(void,
               SetRemoteDescription,
               SetSessionDescriptionObserver*,
@@ -170,12 +167,12 @@
 PROXY_METHOD1(void, SetAudioRecording, bool)
 // This method will be invoked on the network thread. See
 // PeerConnectionFactory::CreatePeerConnectionOrError for more details.
-PROXY_SECONDARY_METHOD1(rtc::scoped_refptr<DtlsTransportInterface>,
+PROXY_SECONDARY_METHOD1(scoped_refptr<DtlsTransportInterface>,
                         LookupDtlsTransportByMid,
                         const std::string&)
 // This method will be invoked on the network thread. See
 // PeerConnectionFactory::CreatePeerConnectionOrError for more details.
-PROXY_SECONDARY_CONSTMETHOD0(rtc::scoped_refptr<SctpTransportInterface>,
+PROXY_SECONDARY_CONSTMETHOD0(scoped_refptr<SctpTransportInterface>,
                              GetSctpTransport)
 PROXY_METHOD0(SignalingState, signaling_state)
 PROXY_METHOD0(IceConnectionState, ice_connection_state)
@@ -183,7 +180,7 @@
 PROXY_METHOD0(PeerConnectionState, peer_connection_state)
 PROXY_METHOD0(IceGatheringState, ice_gathering_state)
 PROXY_METHOD0(std::optional<bool>, can_trickle_ice_candidates)
-PROXY_METHOD1(void, AddAdaptationResource, rtc::scoped_refptr<Resource>)
+PROXY_METHOD1(void, AddAdaptationResource, scoped_refptr<Resource>)
 PROXY_METHOD2(bool,
               StartRtcEventLog,
               std::unique_ptr<RtcEventLogOutput>,
diff --git a/pc/peer_connection_rampup_tests.cc b/pc/peer_connection_rampup_tests.cc
index 8a848b7..17cc3a2 100644
--- a/pc/peer_connection_rampup_tests.cc
+++ b/pc/peer_connection_rampup_tests.cc
@@ -104,8 +104,8 @@
   using PeerConnectionWrapper::PeerConnectionWrapper;
 
   PeerConnectionWrapperForRampUpTest(
-      rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory,
-      rtc::scoped_refptr<PeerConnectionInterface> pc,
+      scoped_refptr<PeerConnectionFactoryInterface> pc_factory,
+      scoped_refptr<PeerConnectionInterface> pc,
       std::unique_ptr<MockPeerConnectionObserver> observer)
       : PeerConnectionWrapper::PeerConnectionWrapper(pc_factory,
                                                      pc,
@@ -121,27 +121,26 @@
     return success;
   }
 
-  rtc::scoped_refptr<VideoTrackInterface> CreateLocalVideoTrack(
+  scoped_refptr<VideoTrackInterface> CreateLocalVideoTrack(
       FrameGeneratorCapturerVideoTrackSource::Config config,
       Clock* clock) {
     video_track_sources_.emplace_back(
-        rtc::make_ref_counted<FrameGeneratorCapturerVideoTrackSource>(
+        make_ref_counted<FrameGeneratorCapturerVideoTrackSource>(
             config, clock, /*is_screencast=*/false));
     video_track_sources_.back()->Start();
-    return rtc::scoped_refptr<VideoTrackInterface>(
-        pc_factory()->CreateVideoTrack(video_track_sources_.back(),
-                                       CreateRandomUuid()));
+    return scoped_refptr<VideoTrackInterface>(pc_factory()->CreateVideoTrack(
+        video_track_sources_.back(), CreateRandomUuid()));
   }
 
-  rtc::scoped_refptr<AudioTrackInterface> CreateLocalAudioTrack(
+  scoped_refptr<AudioTrackInterface> CreateLocalAudioTrack(
       const AudioOptions options) {
-    rtc::scoped_refptr<AudioSourceInterface> source =
+    scoped_refptr<AudioSourceInterface> source =
         pc_factory()->CreateAudioSource(options);
     return pc_factory()->CreateAudioTrack(CreateRandomUuid(), source.get());
   }
 
  private:
-  std::vector<rtc::scoped_refptr<FrameGeneratorCapturerVideoTrackSource>>
+  std::vector<scoped_refptr<FrameGeneratorCapturerVideoTrackSource>>
       video_track_sources_;
 };
 
diff --git a/pc/peer_connection_rtp_unittest.cc b/pc/peer_connection_rtp_unittest.cc
index 2371c61..ad39b76 100644
--- a/pc/peer_connection_rtp_unittest.cc
+++ b/pc/peer_connection_rtp_unittest.cc
@@ -138,7 +138,7 @@
 
  protected:
   const SdpSemantics sdp_semantics_;
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
+  scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
 
  private:
   // Private so that tests don't accidentally bypass the SdpSemantics
@@ -291,7 +291,7 @@
   ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal()));
   ASSERT_EQ(callee->observer()->add_track_events_.size(), 2u);
   EXPECT_EQ(
-      std::vector<rtc::scoped_refptr<RtpReceiverInterface>>{
+      std::vector<scoped_refptr<RtpReceiverInterface>>{
           callee->observer()->add_track_events_[0].receiver},
       callee->observer()->remove_track_events_);
   ASSERT_EQ(1u, callee->observer()->remote_streams()->count());
@@ -360,9 +360,9 @@
             callee->pc()->GetTransceivers()[0]->mid());
   EXPECT_EQ(video_transceiver->mid(),
             callee->pc()->GetTransceivers()[1]->mid());
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> audio_streams =
+  std::vector<scoped_refptr<MediaStreamInterface>> audio_streams =
       callee->pc()->GetTransceivers()[0]->receiver()->streams();
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> video_streams =
+  std::vector<scoped_refptr<MediaStreamInterface>> video_streams =
       callee->pc()->GetTransceivers()[1]->receiver()->streams();
   ASSERT_EQ(0u, audio_streams.size());
   ASSERT_EQ(2u, video_streams.size());
@@ -747,11 +747,11 @@
   // when the first callback is invoked.
   callee->pc()->SetRemoteDescription(
       std::move(srd1_sdp),
-      rtc::make_ref_counted<OnSuccessObserver<decltype(srd1_callback)>>(
+      make_ref_counted<OnSuccessObserver<decltype(srd1_callback)>>(
           srd1_callback));
   callee->pc()->SetRemoteDescription(
       std::move(srd2_sdp),
-      rtc::make_ref_counted<OnSuccessObserver<decltype(srd2_callback)>>(
+      make_ref_counted<OnSuccessObserver<decltype(srd2_callback)>>(
           srd2_callback));
   EXPECT_THAT(
       WaitUntil([&] { return srd1_callback_called; }, ::testing::IsTrue()),
@@ -933,8 +933,8 @@
   auto caller = CreatePeerConnection();
   auto callee = CreatePeerConnection();
 
-  rtc::scoped_refptr<MockSetSessionDescriptionObserver> observer =
-      rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+  scoped_refptr<MockSetSessionDescriptionObserver> observer =
+      make_ref_counted<MockSetSessionDescriptionObserver>();
 
   auto offer = caller->CreateOfferAndSetAsLocal();
   callee->pc()->SetRemoteDescription(observer.get(), offer.release());
@@ -1013,16 +1013,13 @@
   auto caller = CreatePeerConnection();
 
   auto transceiver = caller->AddTransceiver(webrtc::MediaType::AUDIO);
+  EXPECT_EQ(std::vector<scoped_refptr<RtpTransceiverInterface>>{transceiver},
+            caller->pc()->GetTransceivers());
   EXPECT_EQ(
-      std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>{transceiver},
-      caller->pc()->GetTransceivers());
-  EXPECT_EQ(
-      std::vector<rtc::scoped_refptr<RtpSenderInterface>>{
-          transceiver->sender()},
+      std::vector<scoped_refptr<RtpSenderInterface>>{transceiver->sender()},
       caller->pc()->GetSenders());
   EXPECT_EQ(
-      std::vector<rtc::scoped_refptr<RtpReceiverInterface>>{
-          transceiver->receiver()},
+      std::vector<scoped_refptr<RtpReceiverInterface>>{transceiver->receiver()},
       caller->pc()->GetReceivers());
 }
 
diff --git a/pc/peer_connection_signaling_unittest.cc b/pc/peer_connection_signaling_unittest.cc
index 904d2fd..645d62d 100644
--- a/pc/peer_connection_signaling_unittest.cc
+++ b/pc/peer_connection_signaling_unittest.cc
@@ -132,7 +132,7 @@
 #endif
     pc_factory_ = CreatePeerConnectionFactory(
         Thread::Current(), Thread::Current(), Thread::Current(),
-        rtc::scoped_refptr<AudioDeviceModule>(FakeAudioCaptureModule::Create()),
+        scoped_refptr<AudioDeviceModule>(FakeAudioCaptureModule::Create()),
         CreateBuiltinAudioEncoderFactory(), CreateBuiltinAudioDecoderFactory(),
         std::make_unique<VideoEncoderFactoryTemplate<
             LibvpxVp8EncoderTemplateAdapter, LibvpxVp9EncoderTemplateAdapter,
@@ -199,7 +199,7 @@
 
   std::unique_ptr<VirtualSocketServer> vss_;
   AutoSocketServerThread main_;
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
+  scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
   const SdpSemantics sdp_semantics_;
 };
 
@@ -572,9 +572,9 @@
   options.offer_to_receive_audio =
       RTCOfferAnswerOptions::kOfferToReceiveMediaTrue;
 
-  rtc::scoped_refptr<MockCreateSessionDescriptionObserver> observers[100];
+  scoped_refptr<MockCreateSessionDescriptionObserver> observers[100];
   for (auto& observer : observers) {
-    observer = rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+    observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
     caller->pc()->CreateOffer(observer.get(), options);
   }
 
@@ -598,7 +598,7 @@
 // the WebRtcSessionDescriptionFactory is responsible for it.
 TEST_P(PeerConnectionSignalingTest, CloseCreateOfferAndShutdown) {
   auto caller = CreatePeerConnection();
-  auto observer = rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+  auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
   caller->pc()->Close();
   caller->pc()->CreateOffer(observer.get(), RTCOfferAnswerOptions());
   caller.reset(nullptr);
@@ -619,7 +619,7 @@
 
 TEST_P(PeerConnectionSignalingTest, ImplicitCreateOfferAndShutdown) {
   auto caller = CreatePeerConnection();
-  auto observer = rtc::make_ref_counted<FakeSetLocalDescriptionObserver>();
+  auto observer = make_ref_counted<FakeSetLocalDescriptionObserver>();
   caller->pc()->SetLocalDescription(observer);
   caller.reset(nullptr);
   // The new observer gets invoked because it is called immediately.
@@ -640,7 +640,7 @@
 
 TEST_P(PeerConnectionSignalingTest, CloseBeforeImplicitCreateOfferAndShutdown) {
   auto caller = CreatePeerConnection();
-  auto observer = rtc::make_ref_counted<FakeSetLocalDescriptionObserver>();
+  auto observer = make_ref_counted<FakeSetLocalDescriptionObserver>();
   caller->pc()->Close();
   caller->pc()->SetLocalDescription(observer);
   caller.reset(nullptr);
@@ -662,7 +662,7 @@
 
 TEST_P(PeerConnectionSignalingTest, CloseAfterImplicitCreateOfferAndShutdown) {
   auto caller = CreatePeerConnection();
-  auto observer = rtc::make_ref_counted<FakeSetLocalDescriptionObserver>();
+  auto observer = make_ref_counted<FakeSetLocalDescriptionObserver>();
   caller->pc()->SetLocalDescription(observer);
   caller->pc()->Close();
   caller.reset(nullptr);
@@ -676,7 +676,7 @@
   auto caller = CreatePeerConnection();
   auto offer = caller->CreateOffer(RTCOfferAnswerOptions());
 
-  auto observer = rtc::make_ref_counted<FakeSetLocalDescriptionObserver>();
+  auto observer = make_ref_counted<FakeSetLocalDescriptionObserver>();
   caller->pc()->SetLocalDescription(std::move(offer), observer);
   // The new observer is invoked immediately.
   EXPECT_TRUE(observer->called());
@@ -713,8 +713,7 @@
   // By not waiting for the observer's callback we can verify that the operation
   // executed immediately.
   callee->pc()->SetRemoteDescription(
-      std::move(offer),
-      rtc::make_ref_counted<FakeSetRemoteDescriptionObserver>());
+      std::move(offer), make_ref_counted<FakeSetRemoteDescriptionObserver>());
   EXPECT_EQ(2u, callee->pc()->GetReceivers().size());
 }
 
@@ -727,14 +726,13 @@
 
   EXPECT_EQ(0u, callee->pc()->GetReceivers().size());
   auto offer_observer =
-      rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+      make_ref_counted<MockCreateSessionDescriptionObserver>();
   // Synchronously invoke CreateOffer() and SetRemoteDescription(). The
   // SetRemoteDescription() operation should be chained to be executed
   // asynchronously, when CreateOffer() completes.
   callee->pc()->CreateOffer(offer_observer.get(), RTCOfferAnswerOptions());
   callee->pc()->SetRemoteDescription(
-      std::move(offer),
-      rtc::make_ref_counted<FakeSetRemoteDescriptionObserver>());
+      std::move(offer), make_ref_counted<FakeSetRemoteDescriptionObserver>());
   // CreateOffer() is asynchronous; without message processing this operation
   // should not have completed.
   EXPECT_FALSE(offer_observer->called());
@@ -1145,7 +1143,7 @@
   // waiting for it would not ensure synchronicity.
   RTC_DCHECK(!caller->pc()->GetTransceivers()[0]->mid().has_value());
   caller->pc()->SetLocalDescription(
-      rtc::make_ref_counted<MockSetSessionDescriptionObserver>().get(),
+      make_ref_counted<MockSetSessionDescriptionObserver>().get(),
       offer.release());
   EXPECT_TRUE(caller->pc()->GetTransceivers()[0]->mid().has_value());
 }
@@ -1162,8 +1160,7 @@
   // other tests.)
   RTC_DCHECK(!caller->pc()->GetTransceivers()[0]->mid().has_value());
   caller->pc()->SetLocalDescription(
-      std::move(offer),
-      rtc::make_ref_counted<FakeSetLocalDescriptionObserver>());
+      std::move(offer), make_ref_counted<FakeSetLocalDescriptionObserver>());
   EXPECT_TRUE(caller->pc()->GetTransceivers()[0]->mid().has_value());
 }
 
@@ -1175,14 +1172,13 @@
   auto offer = caller->CreateOffer(RTCOfferAnswerOptions());
 
   auto offer_observer =
-      rtc::make_ref_counted<ExecuteFunctionOnCreateSessionDescriptionObserver>(
+      make_ref_counted<ExecuteFunctionOnCreateSessionDescriptionObserver>(
           [pc = caller->pc()](SessionDescriptionInterface* desc) {
             // By not waiting for the observer's callback we can verify that the
             // operation executed immediately.
             RTC_DCHECK(!pc->GetTransceivers()[0]->mid().has_value());
             pc->SetLocalDescription(
-                rtc::make_ref_counted<MockSetSessionDescriptionObserver>()
-                    .get(),
+                make_ref_counted<MockSetSessionDescriptionObserver>().get(),
                 desc);
             EXPECT_TRUE(pc->GetTransceivers()[0]->mid().has_value());
           });
@@ -1275,7 +1271,7 @@
       caller->AddTransceiver(webrtc::MediaType::AUDIO, RtpTransceiverInit());
   EXPECT_TRUE(caller->observer()->has_negotiation_needed_event());
 
-  auto observer = rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+  auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
   caller->pc()->CreateOffer(observer.get(), RTCOfferAnswerOptions());
   // For this test to work, the operation has to be pending, i.e. the observer
   // has not yet been invoked.
diff --git a/pc/peer_connection_simulcast_unittest.cc b/pc/peer_connection_simulcast_unittest.cc
index aedc80a..7ff413d 100644
--- a/pc/peer_connection_simulcast_unittest.cc
+++ b/pc/peer_connection_simulcast_unittest.cc
@@ -67,7 +67,7 @@
 using ::testing::SizeIs;
 using ::testing::StartsWith;
 
-using cricket::MediaContentDescription;
+using webrtc::MediaContentDescription;
 using ::webrtc::RidDescription;
 using ::webrtc::SimulcastDescription;
 using ::webrtc::SimulcastLayer;
@@ -98,7 +98,7 @@
             nullptr,
             nullptr)) {}
 
-  rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
+  scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
       MockPeerConnectionObserver* observer) {
     PeerConnectionInterface::RTCConfiguration config;
     config.sdp_semantics = SdpSemantics::kUnifiedPlan;
@@ -135,7 +135,7 @@
     EXPECT_TRUE(local->SetRemoteDescription(std::move(answer), &err)) << err;
   }
 
-  rtc::scoped_refptr<RtpTransceiverInterface> AddTransceiver(
+  scoped_refptr<RtpTransceiverInterface> AddTransceiver(
       PeerConnectionWrapper* pc,
       const std::vector<SimulcastLayer>& layers,
       webrtc::MediaType media_type = webrtc::MediaType::VIDEO) {
@@ -155,7 +155,7 @@
   }
 
   void ValidateTransceiverParameters(
-      rtc::scoped_refptr<RtpTransceiverInterface> transceiver,
+      scoped_refptr<RtpTransceiverInterface> transceiver,
       const std::vector<SimulcastLayer>& layers) {
     auto parameters = transceiver->sender()->GetParameters();
     std::vector<SimulcastLayer> result_layers;
@@ -167,7 +167,7 @@
   }
 
  private:
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
+  scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
 };
 
 // Validates that RIDs are supported arguments when adding a transceiver.
@@ -496,7 +496,7 @@
   for (const SimulcastLayer& layer : layers) {
     receive_layers.AddLayer(layer);
   }
-  cricket::RtpHeaderExtensions extensions;
+  RtpHeaderExtensions extensions;
   for (auto extension : mcd_answer->rtp_header_extensions()) {
     if (extension.uri != RtpExtension::kRidUri) {
       extensions.push_back(extension);
diff --git a/pc/peer_connection_stability_integrationtest.cc b/pc/peer_connection_stability_integrationtest.cc
index 02cd30b..61c6ba0 100644
--- a/pc/peer_connection_stability_integrationtest.cc
+++ b/pc/peer_connection_stability_integrationtest.cc
@@ -72,10 +72,10 @@
  private:
   // Extract a set of strings characterizing the factory in use.
   void ExtractSignatureStrings() {
-    rtc::scoped_refptr<AudioDecoderFactory> audio_decoders =
+    scoped_refptr<AudioDecoderFactory> audio_decoders =
         CreateBuiltinAudioDecoderFactory();
     for (const auto& codec : audio_decoders->GetSupportedDecoders()) {
-      rtc::StringBuilder sb;
+      StringBuilder sb;
       sb << "Decode audio/";
       sb << codec.format.name << "/" << codec.format.clockrate_hz << "/"
          << codec.format.num_channels;
@@ -84,10 +84,10 @@
       }
       signature_.push_back(sb.Release());
     }
-    rtc::scoped_refptr<AudioEncoderFactory> audio_encoders =
+    scoped_refptr<AudioEncoderFactory> audio_encoders =
         CreateBuiltinAudioEncoderFactory();
     for (const auto& codec : audio_encoders->GetSupportedEncoders()) {
-      rtc::StringBuilder sb;
+      StringBuilder sb;
       sb << "Encode audio/";
       sb << codec.format.name << "/" << codec.format.clockrate_hz << "/"
          << codec.format.num_channels;
@@ -99,7 +99,7 @@
     std::unique_ptr<VideoDecoderFactory> video_decoders =
         CreateBuiltinVideoDecoderFactory();
     for (const SdpVideoFormat& format : video_decoders->GetSupportedFormats()) {
-      rtc::StringBuilder sb;
+      StringBuilder sb;
       sb << "Decode video/";
       sb << format.name;
       for (const auto& kv : format.parameters) {
@@ -110,7 +110,7 @@
     std::unique_ptr<VideoEncoderFactory> video_encoders =
         CreateBuiltinVideoEncoderFactory();
     for (const auto& format : video_encoders->GetSupportedFormats()) {
-      rtc::StringBuilder sb;
+      StringBuilder sb;
       sb << "Encode video/";
       // We don't use format.ToString because that includes scalability modes,
       // which aren't supposed to influence SDP.
@@ -324,7 +324,7 @@
       return Id::kGoogleInternal;
     }
     // If unrecognized, produce a debug printout.
-    rtc::StringBuilder sb;
+    StringBuilder sb;
     sb << "{\n";
     for (std::string str : signature_) {
       sb << "\"" << str << "\",\n";
@@ -362,7 +362,7 @@
       const auto* media_description = content.media_description();
       const auto& codecs = media_description->codecs();
       for (const auto& codec : codecs) {
-        rtc::StringBuilder str;
+        StringBuilder str;
         str << media_section_counter << " " << absl::StrCat(codec);
         results.push_back(str.Release());
       }
@@ -378,7 +378,7 @@
                                        std::vector<std::string> caller_remote,
                                        std::vector<std::string> callee_local,
                                        std::vector<std::string> callee_remote) {
-    rtc::StringBuilder sb;
+    StringBuilder sb;
     // TODO: issues.webrtc.org/397895867 - change kChangeThis to the name of
     // the value. Requires adding an AbslStringifier to the enum.
     sb << "\n{" << ".factory_id = FactorySignature::Id::kChangeThis"
diff --git a/pc/peer_connection_svc_integrationtest.cc b/pc/peer_connection_svc_integrationtest.cc
index 9aa4ea8..de3b035 100644
--- a/pc/peer_connection_svc_integrationtest.cc
+++ b/pc/peer_connection_svc_integrationtest.cc
@@ -42,7 +42,7 @@
       : PeerConnectionIntegrationBaseTest(SdpSemantics::kUnifiedPlan) {}
 
   RTCError SetCodecPreferences(
-      rtc::scoped_refptr<RtpTransceiverInterface> transceiver,
+      scoped_refptr<RtpTransceiverInterface> transceiver,
       absl::string_view codec_name) {
     RtpCapabilities capabilities =
         caller()->pc_factory()->GetRtpReceiverCapabilities(
diff --git a/pc/peer_connection_wrapper.cc b/pc/peer_connection_wrapper.cc
index 20491fe..4f547c7 100644
--- a/pc/peer_connection_wrapper.cc
+++ b/pc/peer_connection_wrapper.cc
@@ -49,8 +49,8 @@
 using RTCOfferAnswerOptions = PeerConnectionInterface::RTCOfferAnswerOptions;
 
 PeerConnectionWrapper::PeerConnectionWrapper(
-    rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory,
-    rtc::scoped_refptr<PeerConnectionInterface> pc,
+    scoped_refptr<PeerConnectionFactoryInterface> pc_factory,
+    scoped_refptr<PeerConnectionInterface> pc,
     std::unique_ptr<MockPeerConnectionObserver> observer)
     : pc_factory_(std::move(pc_factory)),
       observer_(std::move(observer)),
@@ -156,7 +156,7 @@
 std::unique_ptr<SessionDescriptionInterface> PeerConnectionWrapper::CreateSdp(
     FunctionView<void(CreateSessionDescriptionObserver*)> fn,
     std::string* error_out) {
-  auto observer = rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+  auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
   fn(observer.get());
   EXPECT_THAT(
       WaitUntil([&] { return observer->called(); }, ::testing::IsTrue()),
@@ -180,7 +180,7 @@
 bool PeerConnectionWrapper::SetLocalDescription(
     std::unique_ptr<SessionDescriptionInterface> desc,
     RTCError* error_out) {
-  auto observer = rtc::make_ref_counted<FakeSetLocalDescriptionObserver>();
+  auto observer = make_ref_counted<FakeSetLocalDescriptionObserver>();
   pc()->SetLocalDescription(std::move(desc), observer);
   EXPECT_THAT(
       WaitUntil([&] { return observer->called(); }, ::testing::IsTrue()),
@@ -204,7 +204,7 @@
 bool PeerConnectionWrapper::SetRemoteDescription(
     std::unique_ptr<SessionDescriptionInterface> desc,
     RTCError* error_out) {
-  auto observer = rtc::make_ref_counted<FakeSetRemoteDescriptionObserver>();
+  auto observer = make_ref_counted<FakeSetRemoteDescriptionObserver>();
   pc()->SetRemoteDescription(std::move(desc), observer);
   EXPECT_THAT(
       WaitUntil([&] { return observer->called(); }, ::testing::IsTrue()),
@@ -218,7 +218,7 @@
 bool PeerConnectionWrapper::SetSdp(
     FunctionView<void(SetSessionDescriptionObserver*)> fn,
     std::string* error_out) {
-  auto observer = rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+  auto observer = make_ref_counted<MockSetSessionDescriptionObserver>();
   fn(observer.get());
   EXPECT_THAT(
       WaitUntil([&] { return observer->called(); }, ::testing::IsTrue()),
@@ -276,85 +276,82 @@
   return set_remote_answer;
 }
 
-rtc::scoped_refptr<RtpTransceiverInterface>
-PeerConnectionWrapper::AddTransceiver(webrtc::MediaType media_type) {
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> result =
+scoped_refptr<RtpTransceiverInterface> PeerConnectionWrapper::AddTransceiver(
+    webrtc::MediaType media_type) {
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> result =
       pc()->AddTransceiver(media_type);
   EXPECT_EQ(RTCErrorType::NONE, result.error().type());
   return result.MoveValue();
 }
 
-rtc::scoped_refptr<RtpTransceiverInterface>
-PeerConnectionWrapper::AddTransceiver(webrtc::MediaType media_type,
-                                      const RtpTransceiverInit& init) {
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> result =
+scoped_refptr<RtpTransceiverInterface> PeerConnectionWrapper::AddTransceiver(
+    webrtc::MediaType media_type,
+    const RtpTransceiverInit& init) {
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> result =
       pc()->AddTransceiver(media_type, init);
   EXPECT_EQ(RTCErrorType::NONE, result.error().type());
   return result.MoveValue();
 }
 
-rtc::scoped_refptr<RtpTransceiverInterface>
-PeerConnectionWrapper::AddTransceiver(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track) {
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> result =
+scoped_refptr<RtpTransceiverInterface> PeerConnectionWrapper::AddTransceiver(
+    scoped_refptr<MediaStreamTrackInterface> track) {
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> result =
       pc()->AddTransceiver(track);
   EXPECT_EQ(RTCErrorType::NONE, result.error().type());
   return result.MoveValue();
 }
 
-rtc::scoped_refptr<RtpTransceiverInterface>
-PeerConnectionWrapper::AddTransceiver(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+scoped_refptr<RtpTransceiverInterface> PeerConnectionWrapper::AddTransceiver(
+    scoped_refptr<MediaStreamTrackInterface> track,
     const RtpTransceiverInit& init) {
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> result =
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> result =
       pc()->AddTransceiver(track, init);
   EXPECT_EQ(RTCErrorType::NONE, result.error().type());
   return result.MoveValue();
 }
 
-rtc::scoped_refptr<AudioTrackInterface> PeerConnectionWrapper::CreateAudioTrack(
+scoped_refptr<AudioTrackInterface> PeerConnectionWrapper::CreateAudioTrack(
     const std::string& label) {
   return pc_factory()->CreateAudioTrack(label, nullptr);
 }
 
-rtc::scoped_refptr<VideoTrackInterface> PeerConnectionWrapper::CreateVideoTrack(
+scoped_refptr<VideoTrackInterface> PeerConnectionWrapper::CreateVideoTrack(
     const std::string& label) {
   return pc_factory()->CreateVideoTrack(FakeVideoTrackSource::Create(), label);
 }
 
-rtc::scoped_refptr<RtpSenderInterface> PeerConnectionWrapper::AddTrack(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+scoped_refptr<RtpSenderInterface> PeerConnectionWrapper::AddTrack(
+    scoped_refptr<MediaStreamTrackInterface> track,
     const std::vector<std::string>& stream_ids) {
-  RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> result =
+  RTCErrorOr<scoped_refptr<RtpSenderInterface>> result =
       pc()->AddTrack(track, stream_ids);
   EXPECT_EQ(RTCErrorType::NONE, result.error().type());
   return result.MoveValue();
 }
 
-rtc::scoped_refptr<RtpSenderInterface> PeerConnectionWrapper::AddTrack(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+scoped_refptr<RtpSenderInterface> PeerConnectionWrapper::AddTrack(
+    scoped_refptr<MediaStreamTrackInterface> track,
     const std::vector<std::string>& stream_ids,
     const std::vector<RtpEncodingParameters>& init_send_encodings) {
-  RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> result =
+  RTCErrorOr<scoped_refptr<RtpSenderInterface>> result =
       pc()->AddTrack(track, stream_ids, init_send_encodings);
   EXPECT_EQ(RTCErrorType::NONE, result.error().type());
   return result.MoveValue();
 }
 
-rtc::scoped_refptr<RtpSenderInterface> PeerConnectionWrapper::AddAudioTrack(
+scoped_refptr<RtpSenderInterface> PeerConnectionWrapper::AddAudioTrack(
     const std::string& track_label,
     const std::vector<std::string>& stream_ids) {
   return AddTrack(CreateAudioTrack(track_label), stream_ids);
 }
 
-rtc::scoped_refptr<RtpSenderInterface> PeerConnectionWrapper::AddVideoTrack(
+scoped_refptr<RtpSenderInterface> PeerConnectionWrapper::AddVideoTrack(
     const std::string& track_label,
     const std::vector<std::string>& stream_ids) {
   return AddTrack(CreateVideoTrack(track_label), stream_ids);
 }
 
-rtc::scoped_refptr<DataChannelInterface>
-PeerConnectionWrapper::CreateDataChannel(
+scoped_refptr<DataChannelInterface> PeerConnectionWrapper::CreateDataChannel(
     const std::string& label,
     const std::optional<DataChannelInit>& config) {
   const DataChannelInit* config_ptr = config.has_value() ? &(*config) : nullptr;
@@ -381,8 +378,8 @@
   return observer()->ice_connected_;
 }
 
-rtc::scoped_refptr<const RTCStatsReport> PeerConnectionWrapper::GetStats() {
-  auto callback = rtc::make_ref_counted<MockRTCStatsCollectorCallback>();
+scoped_refptr<const RTCStatsReport> PeerConnectionWrapper::GetStats() {
+  auto callback = make_ref_counted<MockRTCStatsCollectorCallback>();
   pc()->GetStats(callback.get());
   EXPECT_THAT(
       WaitUntil([&] { return callback->called(); }, ::testing::IsTrue()),
diff --git a/pc/peer_connection_wrapper.h b/pc/peer_connection_wrapper.h
index 49b2da7..e9996cb 100644
--- a/pc/peer_connection_wrapper.h
+++ b/pc/peer_connection_wrapper.h
@@ -54,8 +54,8 @@
   // PeerConnection and the MockPeerConnectionObserver should be the observer
   // that is watching the PeerConnection.
   PeerConnectionWrapper(
-      rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory,
-      rtc::scoped_refptr<PeerConnectionInterface> pc,
+      scoped_refptr<PeerConnectionFactoryInterface> pc_factory,
+      scoped_refptr<PeerConnectionInterface> pc,
       std::unique_ptr<MockPeerConnectionObserver> observer);
   virtual ~PeerConnectionWrapper();
 
@@ -131,51 +131,49 @@
   // The following are wrappers for the underlying PeerConnection's
   // AddTransceiver method. They return the result of calling AddTransceiver
   // with the given arguments, DCHECKing if there is an error.
-  rtc::scoped_refptr<RtpTransceiverInterface> AddTransceiver(
+  scoped_refptr<RtpTransceiverInterface> AddTransceiver(
       webrtc::MediaType media_type);
-  rtc::scoped_refptr<RtpTransceiverInterface> AddTransceiver(
+  scoped_refptr<RtpTransceiverInterface> AddTransceiver(
       webrtc::MediaType media_type,
       const RtpTransceiverInit& init);
-  rtc::scoped_refptr<RtpTransceiverInterface> AddTransceiver(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track);
-  rtc::scoped_refptr<RtpTransceiverInterface> AddTransceiver(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  scoped_refptr<RtpTransceiverInterface> AddTransceiver(
+      scoped_refptr<MediaStreamTrackInterface> track);
+  scoped_refptr<RtpTransceiverInterface> AddTransceiver(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const RtpTransceiverInit& init);
 
   // Returns a new dummy audio track with the given label.
-  rtc::scoped_refptr<AudioTrackInterface> CreateAudioTrack(
-      const std::string& label);
+  scoped_refptr<AudioTrackInterface> CreateAudioTrack(const std::string& label);
 
   // Returns a new dummy video track with the given label.
-  rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack(
-      const std::string& label);
+  scoped_refptr<VideoTrackInterface> CreateVideoTrack(const std::string& label);
 
   // Wrapper for the underlying PeerConnection's AddTrack method. DCHECKs if
   // AddTrack fails.
-  rtc::scoped_refptr<RtpSenderInterface> AddTrack(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  scoped_refptr<RtpSenderInterface> AddTrack(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<std::string>& stream_ids = {});
 
-  rtc::scoped_refptr<RtpSenderInterface> AddTrack(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  scoped_refptr<RtpSenderInterface> AddTrack(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<std::string>& stream_ids,
       const std::vector<RtpEncodingParameters>& init_send_encodings);
 
   // Calls the underlying PeerConnection's AddTrack method with an audio media
   // stream track not bound to any source.
-  rtc::scoped_refptr<RtpSenderInterface> AddAudioTrack(
+  scoped_refptr<RtpSenderInterface> AddAudioTrack(
       const std::string& track_label,
       const std::vector<std::string>& stream_ids = {});
 
   // Calls the underlying PeerConnection's AddTrack method with a video media
   // stream track fed by a FakeVideoTrackSource.
-  rtc::scoped_refptr<RtpSenderInterface> AddVideoTrack(
+  scoped_refptr<RtpSenderInterface> AddVideoTrack(
       const std::string& track_label,
       const std::vector<std::string>& stream_ids = {});
 
   // Calls the underlying PeerConnection's CreateDataChannel method with default
   // initialization parameters.
-  rtc::scoped_refptr<DataChannelInterface> CreateDataChannel(
+  scoped_refptr<DataChannelInterface> CreateDataChannel(
       const std::string& label,
       const std::optional<DataChannelInit>& config = std::nullopt);
 
@@ -190,7 +188,7 @@
 
   // Calls GetStats() on the underlying PeerConnection and returns the resulting
   // report. If GetStats() fails, this method returns null and fails the test.
-  rtc::scoped_refptr<const RTCStatsReport> GetStats();
+  scoped_refptr<const RTCStatsReport> GetStats();
 
  private:
   std::unique_ptr<SessionDescriptionInterface> CreateSdp(
@@ -199,9 +197,9 @@
   bool SetSdp(FunctionView<void(SetSessionDescriptionObserver*)> fn,
               std::string* error_out);
 
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
+  scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
   std::unique_ptr<MockPeerConnectionObserver> observer_;
-  rtc::scoped_refptr<PeerConnectionInterface> pc_;
+  scoped_refptr<PeerConnectionInterface> pc_;
 };
 
 }  // namespace webrtc
diff --git a/pc/proxy.h b/pc/proxy.h
index 60ef713..fbc6634 100644
--- a/pc/proxy.h
+++ b/pc/proxy.h
@@ -206,27 +206,27 @@
   constexpr char class_name##ProxyWithInternal<INTERNAL_CLASS>::proxy_name_[];
 // clang-format on
 
-#define PRIMARY_PROXY_MAP_BOILERPLATE(class_name)                     \
- protected:                                                           \
-  class_name##ProxyWithInternal(rtc::Thread* primary_thread,          \
-                                rtc::scoped_refptr<INTERNAL_CLASS> c) \
-      : primary_thread_(primary_thread), c_(std::move(c)) {}          \
-                                                                      \
- private:                                                             \
-  mutable rtc::Thread* primary_thread_;
+#define PRIMARY_PROXY_MAP_BOILERPLATE(class_name)                \
+ protected:                                                      \
+  class_name##ProxyWithInternal(Thread* primary_thread,          \
+                                scoped_refptr<INTERNAL_CLASS> c) \
+      : primary_thread_(primary_thread), c_(std::move(c)) {}     \
+                                                                 \
+ private:                                                        \
+  mutable Thread* primary_thread_;
 
-#define SECONDARY_PROXY_MAP_BOILERPLATE(class_name)                   \
- protected:                                                           \
-  class_name##ProxyWithInternal(rtc::Thread* primary_thread,          \
-                                rtc::Thread* secondary_thread,        \
-                                rtc::scoped_refptr<INTERNAL_CLASS> c) \
-      : primary_thread_(primary_thread),                              \
-        secondary_thread_(secondary_thread),                          \
-        c_(std::move(c)) {}                                           \
-                                                                      \
- private:                                                             \
-  mutable rtc::Thread* primary_thread_;                               \
-  mutable rtc::Thread* secondary_thread_;
+#define SECONDARY_PROXY_MAP_BOILERPLATE(class_name)              \
+ protected:                                                      \
+  class_name##ProxyWithInternal(Thread* primary_thread,          \
+                                Thread* secondary_thread,        \
+                                scoped_refptr<INTERNAL_CLASS> c) \
+      : primary_thread_(primary_thread),                         \
+        secondary_thread_(secondary_thread),                     \
+        c_(std::move(c)) {}                                      \
+                                                                 \
+ private:                                                        \
+  mutable Thread* primary_thread_;                               \
+  mutable Thread* secondary_thread_;
 
 // Note that the destructor is protected so that the proxy can only be
 // destroyed via RefCountInterface.
@@ -248,7 +248,7 @@
   void DestroyInternal() {                                      \
     c_ = nullptr;                                               \
   }                                                             \
-  rtc::scoped_refptr<INTERNAL_CLASS> c_;
+  scoped_refptr<INTERNAL_CLASS> c_;
 
 // Note: This doesn't use a unique_ptr, because it intends to handle a corner
 // case where an object's deletion triggers a callback that calls back into
@@ -280,35 +280,35 @@
   PRIMARY_PROXY_MAP_BOILERPLATE(class_name)                                \
   REFCOUNTED_PROXY_MAP_BOILERPLATE(class_name)                             \
  public:                                                                   \
-  static rtc::scoped_refptr<class_name##ProxyWithInternal> Create(         \
-      rtc::Thread* primary_thread, rtc::scoped_refptr<INTERNAL_CLASS> c) { \
-    return rtc::make_ref_counted<class_name##ProxyWithInternal>(           \
-        primary_thread, std::move(c));                                     \
+  static scoped_refptr<class_name##ProxyWithInternal> Create(              \
+      Thread* primary_thread, scoped_refptr<INTERNAL_CLASS> c) {           \
+    return make_ref_counted<class_name##ProxyWithInternal>(primary_thread, \
+                                                           std::move(c));  \
   }
 
-#define BEGIN_PROXY_MAP(class_name)                                \
-  PROXY_MAP_BOILERPLATE(class_name)                                \
-  SECONDARY_PROXY_MAP_BOILERPLATE(class_name)                      \
-  REFCOUNTED_PROXY_MAP_BOILERPLATE(class_name)                     \
- public:                                                           \
-  static rtc::scoped_refptr<class_name##ProxyWithInternal> Create( \
-      rtc::Thread* primary_thread, rtc::Thread* secondary_thread,  \
-      rtc::scoped_refptr<INTERNAL_CLASS> c) {                      \
-    return rtc::make_ref_counted<class_name##ProxyWithInternal>(   \
-        primary_thread, secondary_thread, std::move(c));           \
+#define BEGIN_PROXY_MAP(class_name)                           \
+  PROXY_MAP_BOILERPLATE(class_name)                           \
+  SECONDARY_PROXY_MAP_BOILERPLATE(class_name)                 \
+  REFCOUNTED_PROXY_MAP_BOILERPLATE(class_name)                \
+ public:                                                      \
+  static scoped_refptr<class_name##ProxyWithInternal> Create( \
+      Thread* primary_thread, Thread* secondary_thread,       \
+      scoped_refptr<INTERNAL_CLASS> c) {                      \
+    return make_ref_counted<class_name##ProxyWithInternal>(   \
+        primary_thread, secondary_thread, std::move(c));      \
   }
 
-#define PROXY_PRIMARY_THREAD_DESTRUCTOR()  \
- private:                                  \
-  rtc::Thread* destructor_thread() const { \
-    return primary_thread_;                \
-  }                                        \
-                                           \
+#define PROXY_PRIMARY_THREAD_DESTRUCTOR() \
+ private:                                 \
+  Thread* destructor_thread() const {     \
+    return primary_thread_;               \
+  }                                       \
+                                          \
  public:  // NOLINTNEXTLINE
 
 #define PROXY_SECONDARY_THREAD_DESTRUCTOR() \
  private:                                   \
-  rtc::Thread* destructor_thread() const {  \
+  Thread* destructor_thread() const {       \
     return secondary_thread_;               \
   }                                         \
                                             \
@@ -319,11 +319,11 @@
   do {                            \
   } while (0)
 #else  // if defined(RTC_DISABLE_PROXY_TRACE_EVENTS)
-#define TRACE_BOILERPLATE(method)                       \
-  static constexpr auto class_and_method_name =         \
-      rtc::MakeCompileTimeString(proxy_name_)           \
-          .Concat(rtc::MakeCompileTimeString("::"))     \
-          .Concat(rtc::MakeCompileTimeString(#method)); \
+#define TRACE_BOILERPLATE(method)                          \
+  static constexpr auto class_and_method_name =            \
+      webrtc::MakeCompileTimeString(proxy_name_)           \
+          .Concat(webrtc::MakeCompileTimeString("::"))     \
+          .Concat(webrtc::MakeCompileTimeString(#method)); \
   TRACE_EVENT0("webrtc", class_and_method_name.string)
 
 #endif  // if defined(RTC_DISABLE_PROXY_TRACE_EVENTS)
diff --git a/pc/proxy_unittest.cc b/pc/proxy_unittest.cc
index c7bf3b8..a12e581 100644
--- a/pc/proxy_unittest.cc
+++ b/pc/proxy_unittest.cc
@@ -45,9 +45,7 @@
 // Implementation of the test interface.
 class Fake : public FakeInterface {
  public:
-  static rtc::scoped_refptr<Fake> Create() {
-    return rtc::make_ref_counted<Fake>();
-  }
+  static scoped_refptr<Fake> Create() { return make_ref_counted<Fake>(); }
   // Used to verify destructor is called on the correct thread.
   MOCK_METHOD(void, Destroy, ());
 
@@ -106,8 +104,8 @@
 
  protected:
   std::unique_ptr<Thread> signaling_thread_;
-  rtc::scoped_refptr<FakeInterface> fake_signaling_proxy_;
-  rtc::scoped_refptr<Fake> fake_;
+  scoped_refptr<FakeInterface> fake_signaling_proxy_;
+  scoped_refptr<Fake> fake_;
 };
 
 TEST_F(SignalingProxyTest, SignalingThreadDestructor) {
@@ -196,8 +194,8 @@
  protected:
   std::unique_ptr<Thread> signaling_thread_;
   std::unique_ptr<Thread> worker_thread_;
-  rtc::scoped_refptr<FakeInterface> fake_proxy_;
-  rtc::scoped_refptr<Fake> fake_;
+  scoped_refptr<FakeInterface> fake_proxy_;
+  scoped_refptr<Fake> fake_;
 };
 
 TEST_F(ProxyTest, WorkerThreadDestructor) {
diff --git a/pc/remote_audio_source.cc b/pc/remote_audio_source.cc
index 2e20700..ecebff5 100644
--- a/pc/remote_audio_source.cc
+++ b/pc/remote_audio_source.cc
@@ -53,7 +53,7 @@
   }
 
  private:
-  const rtc::scoped_refptr<RemoteAudioSource> source_;
+  const scoped_refptr<RemoteAudioSource> source_;
 };
 
 RemoteAudioSource::RemoteAudioSource(
@@ -176,7 +176,7 @@
   // processed (because the task queue was destroyed shortly after this call),
   // but that is fine because the task queue destructor will take care of
   // destroying task which will release the reference on RemoteAudioSource.
-  rtc::scoped_refptr<RemoteAudioSource> thiz(this);
+  scoped_refptr<RemoteAudioSource> thiz(this);
   main_thread_->PostTask([thiz = std::move(thiz)] {
     thiz->sinks_.clear();
     thiz->SetState(MediaSourceInterface::kEnded);
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc
index d208c76..a2df878 100644
--- a/pc/rtc_stats_collector.cc
+++ b/pc/rtc_stats_collector.cc
@@ -1065,12 +1065,11 @@
 
 }  // namespace
 
-rtc::scoped_refptr<RTCStatsReport>
-RTCStatsCollector::CreateReportFilteredBySelector(
+scoped_refptr<RTCStatsReport> RTCStatsCollector::CreateReportFilteredBySelector(
     bool filter_by_sender_selector,
-    rtc::scoped_refptr<const RTCStatsReport> report,
-    rtc::scoped_refptr<RtpSenderInternal> sender_selector,
-    rtc::scoped_refptr<RtpReceiverInternal> receiver_selector) {
+    scoped_refptr<const RTCStatsReport> report,
+    scoped_refptr<RtpSenderInternal> sender_selector,
+    scoped_refptr<RtpReceiverInternal> receiver_selector) {
   std::vector<std::string> rtpstream_ids;
   if (filter_by_sender_selector) {
     // Filter mode: RTCStatsCollector::RequestInfo::kSenderSelector
@@ -1121,20 +1120,20 @@
 }
 
 RTCStatsCollector::RequestInfo::RequestInfo(
-    rtc::scoped_refptr<RTCStatsCollectorCallback> callback)
+    scoped_refptr<RTCStatsCollectorCallback> callback)
     : RequestInfo(FilterMode::kAll, std::move(callback), nullptr, nullptr) {}
 
 RTCStatsCollector::RequestInfo::RequestInfo(
-    rtc::scoped_refptr<RtpSenderInternal> selector,
-    rtc::scoped_refptr<RTCStatsCollectorCallback> callback)
+    scoped_refptr<RtpSenderInternal> selector,
+    scoped_refptr<RTCStatsCollectorCallback> callback)
     : RequestInfo(FilterMode::kSenderSelector,
                   std::move(callback),
                   std::move(selector),
                   nullptr) {}
 
 RTCStatsCollector::RequestInfo::RequestInfo(
-    rtc::scoped_refptr<RtpReceiverInternal> selector,
-    rtc::scoped_refptr<RTCStatsCollectorCallback> callback)
+    scoped_refptr<RtpReceiverInternal> selector,
+    scoped_refptr<RTCStatsCollectorCallback> callback)
     : RequestInfo(FilterMode::kReceiverSelector,
                   std::move(callback),
                   nullptr,
@@ -1142,9 +1141,9 @@
 
 RTCStatsCollector::RequestInfo::RequestInfo(
     RTCStatsCollector::RequestInfo::FilterMode filter_mode,
-    rtc::scoped_refptr<RTCStatsCollectorCallback> callback,
-    rtc::scoped_refptr<RtpSenderInternal> sender_selector,
-    rtc::scoped_refptr<RtpReceiverInternal> receiver_selector)
+    scoped_refptr<RTCStatsCollectorCallback> callback,
+    scoped_refptr<RtpSenderInternal> sender_selector,
+    scoped_refptr<RtpReceiverInternal> receiver_selector)
     : filter_mode_(filter_mode),
       callback_(std::move(callback)),
       sender_selector_(std::move(sender_selector)),
@@ -1153,11 +1152,11 @@
   RTC_DCHECK(!sender_selector_ || !receiver_selector_);
 }
 
-rtc::scoped_refptr<RTCStatsCollector> RTCStatsCollector::Create(
+scoped_refptr<RTCStatsCollector> RTCStatsCollector::Create(
     PeerConnectionInternal* pc,
     const Environment& env,
     int64_t cache_lifetime_us) {
-  return rtc::make_ref_counted<RTCStatsCollector>(pc, env, cache_lifetime_us);
+  return make_ref_counted<RTCStatsCollector>(pc, env, cache_lifetime_us);
 }
 
 RTCStatsCollector::RTCStatsCollector(PeerConnectionInternal* pc,
@@ -1188,19 +1187,19 @@
 }
 
 void RTCStatsCollector::GetStatsReport(
-    rtc::scoped_refptr<RTCStatsCollectorCallback> callback) {
+    scoped_refptr<RTCStatsCollectorCallback> callback) {
   GetStatsReportInternal(RequestInfo(std::move(callback)));
 }
 
 void RTCStatsCollector::GetStatsReport(
-    rtc::scoped_refptr<RtpSenderInternal> selector,
-    rtc::scoped_refptr<RTCStatsCollectorCallback> callback) {
+    scoped_refptr<RtpSenderInternal> selector,
+    scoped_refptr<RTCStatsCollectorCallback> callback) {
   GetStatsReportInternal(RequestInfo(std::move(selector), std::move(callback)));
 }
 
 void RTCStatsCollector::GetStatsReport(
-    rtc::scoped_refptr<RtpReceiverInternal> selector,
-    rtc::scoped_refptr<RTCStatsCollectorCallback> callback) {
+    scoped_refptr<RtpReceiverInternal> selector,
+    scoped_refptr<RTCStatsCollectorCallback> callback) {
   GetStatsReportInternal(RequestInfo(std::move(selector), std::move(callback)));
 }
 
@@ -1218,8 +1217,8 @@
     // reentrancy problems.
     signaling_thread_->PostTask(
         absl::bind_front(&RTCStatsCollector::DeliverCachedReport,
-                         rtc::scoped_refptr<RTCStatsCollector>(this),
-                         cached_report_, std::move(requests_)));
+                         scoped_refptr<RTCStatsCollector>(this), cached_report_,
+                         std::move(requests_)));
   } else if (!num_pending_partial_reports_) {
     // Only start gathering stats if we're not already gathering stats. In the
     // case of already gathering stats, `callback_` will be invoked when there
@@ -1247,7 +1246,7 @@
     // ProducePartialResultsOnNetworkThread() has signaled the
     // `network_report_event_`.
     network_report_event_.Reset();
-    rtc::scoped_refptr<RTCStatsCollector> collector(this);
+    scoped_refptr<RTCStatsCollector> collector(this);
     network_thread_->PostTask([collector,
                                sctp_transport_name = pc_->sctp_transport_name(),
                                timestamp]() mutable {
@@ -1336,7 +1335,7 @@
   // Signal that it is now safe to touch `network_report_` on the signaling
   // thread, and post a task to merge it into the final results.
   network_report_event_.Set();
-  rtc::scoped_refptr<RTCStatsCollector> collector(this);
+  scoped_refptr<RTCStatsCollector> collector(this);
   signaling_thread_->PostTask(
       [collector] { collector->MergeNetworkReport_s(); });
 }
@@ -1399,7 +1398,7 @@
 }
 
 void RTCStatsCollector::DeliverCachedReport(
-    rtc::scoped_refptr<const RTCStatsReport> cached_report,
+    scoped_refptr<const RTCStatsReport> cached_report,
     std::vector<RTCStatsCollector::RequestInfo> requests) {
   RTC_DCHECK_RUN_ON(signaling_thread_);
   RTC_DCHECK(!requests.empty());
@@ -1410,8 +1409,8 @@
       request.callback()->OnStatsDelivered(cached_report);
     } else {
       bool filter_by_sender_selector;
-      rtc::scoped_refptr<RtpSenderInternal> sender_selector;
-      rtc::scoped_refptr<RtpReceiverInternal> receiver_selector;
+      scoped_refptr<RtpSenderInternal> sender_selector;
+      scoped_refptr<RtpReceiverInternal> receiver_selector;
       if (request.filter_mode() == RequestInfo::FilterMode::kSenderSelector) {
         filter_by_sender_selector = true;
         sender_selector = request.sender_selector();
@@ -1597,7 +1596,7 @@
       // to multiple senders which should result in multiple senders referencing
       // the same media-source stats. When all media source related metrics are
       // moved to the track's source (e.g. input frame rate is moved from
-      // cricket::VideoSenderInfo to VideoTrackSourceInterface::Stats and audio
+      // webrtc::VideoSenderInfo to VideoTrackSourceInterface::Stats and audio
       // levels are moved to the corresponding audio track/source object), don't
       // create separate media source stats objects on a per-attachment basis.
       std::unique_ptr<RTCMediaSourceStats> media_source_stats;
@@ -1735,7 +1734,7 @@
   // Inbound and remote-outbound.
   // The remote-outbound stats are based on RTCP sender reports sent from the
   // remote endpoint providing metrics about the remote outbound streams.
-  for (const cricket::VoiceReceiverInfo& voice_receiver_info :
+  for (const VoiceReceiverInfo& voice_receiver_info :
        stats.track_media_info_map.voice_media_info()->receivers) {
     if (!voice_receiver_info.connected())
       continue;
@@ -1744,7 +1743,7 @@
         *stats.track_media_info_map.voice_media_info(), voice_receiver_info,
         transport_id, mid, timestamp, report);
     // TODO(hta): This lookup should look for the sender, not the track.
-    rtc::scoped_refptr<AudioTrackInterface> audio_track =
+    scoped_refptr<AudioTrackInterface> audio_track =
         stats.track_media_info_map.GetAudioTrack(voice_receiver_info);
     if (audio_track) {
       inbound_audio->track_identifier = audio_track->id();
@@ -1781,14 +1780,14 @@
   }
   // Outbound.
   std::map<std::string, RTCOutboundRtpStreamStats*> audio_outbound_rtps;
-  for (const cricket::VoiceSenderInfo& voice_sender_info :
+  for (const VoiceSenderInfo& voice_sender_info :
        stats.track_media_info_map.voice_media_info()->senders) {
     if (!voice_sender_info.connected())
       continue;
     auto outbound_audio = CreateOutboundRTPStreamStatsFromVoiceSenderInfo(
         transport_id, mid, *stats.track_media_info_map.voice_media_info(),
         voice_sender_info, timestamp, report);
-    rtc::scoped_refptr<AudioTrackInterface> audio_track =
+    scoped_refptr<AudioTrackInterface> audio_track =
         stats.track_media_info_map.GetAudioTrack(voice_sender_info);
     if (audio_track) {
       int attachment_id =
@@ -1812,7 +1811,7 @@
   // providing metrics about our Outbound streams. We take advantage of the fact
   // that RTCOutboundRtpStreamStats, RTCCodecStats and RTCTransport have already
   // been added to the report.
-  for (const cricket::VoiceSenderInfo& voice_sender_info :
+  for (const VoiceSenderInfo& voice_sender_info :
        stats.track_media_info_map.voice_media_info()->senders) {
     for (const auto& report_block_data : voice_sender_info.report_block_datas) {
       report->AddStats(ProduceRemoteInboundRtpStreamStatsFromReportBlockData(
@@ -1838,14 +1837,14 @@
   std::string transport_id = RTCTransportStatsIDFromTransportChannel(
       *stats.transport_name, ICE_CANDIDATE_COMPONENT_RTP);
   // Inbound and remote-outbound.
-  for (const cricket::VideoReceiverInfo& video_receiver_info :
+  for (const VideoReceiverInfo& video_receiver_info :
        stats.track_media_info_map.video_media_info()->receivers) {
     if (!video_receiver_info.connected())
       continue;
     auto inbound_video = CreateInboundRTPStreamStatsFromVideoReceiverInfo(
         transport_id, mid, *stats.track_media_info_map.video_media_info(),
         video_receiver_info, timestamp, report);
-    rtc::scoped_refptr<VideoTrackInterface> video_track =
+    scoped_refptr<VideoTrackInterface> video_track =
         stats.track_media_info_map.GetVideoTrack(video_receiver_info);
     if (video_track) {
       inbound_video->track_identifier = video_track->id();
@@ -1876,14 +1875,14 @@
   }
   // Outbound
   std::map<std::string, RTCOutboundRtpStreamStats*> video_outbound_rtps;
-  for (const cricket::VideoSenderInfo& video_sender_info :
+  for (const VideoSenderInfo& video_sender_info :
        stats.track_media_info_map.video_media_info()->senders) {
     if (!video_sender_info.connected())
       continue;
     auto outbound_video = CreateOutboundRTPStreamStatsFromVideoSenderInfo(
         transport_id, mid, *stats.track_media_info_map.video_media_info(),
         video_sender_info, timestamp, report);
-    rtc::scoped_refptr<VideoTrackInterface> video_track =
+    scoped_refptr<VideoTrackInterface> video_track =
         stats.track_media_info_map.GetVideoTrack(video_sender_info);
     if (video_track) {
       int attachment_id =
@@ -1907,7 +1906,7 @@
   // providing metrics about our Outbound streams. We take advantage of the fact
   // that RTCOutboundRtpStreamStats, RTCCodecStats and RTCTransport have already
   // been added to the report.
-  for (const cricket::VideoSenderInfo& video_sender_info :
+  for (const VideoSenderInfo& video_sender_info :
        stats.track_media_info_map.video_media_info()->senders) {
     for (const auto& report_block_data : video_sender_info.report_block_datas) {
       report->AddStats(ProduceRemoteInboundRtpStreamStatsFromReportBlockData(
@@ -1932,7 +1931,7 @@
 
     // Get reference to RTCP channel, if it exists.
     std::string rtcp_transport_stats_id;
-    for (const cricket::TransportChannelStats& channel_stats :
+    for (const TransportChannelStats& channel_stats :
          transport_stats.channel_stats) {
       if (channel_stats.component == ICE_CANDIDATE_COMPONENT_RTCP) {
         rtcp_transport_stats_id = RTCTransportStatsIDFromTransportChannel(
@@ -1959,7 +1958,7 @@
     }
 
     // There is one transport stats for each channel.
-    for (const cricket::TransportChannelStats& channel_stats :
+    for (const TransportChannelStats& channel_stats :
          transport_stats.channel_stats) {
       auto channel_transport_stats = std::make_unique<RTCTransportStats>(
           RTCTransportStatsIDFromTransportChannel(transport_name,
@@ -1984,7 +1983,7 @@
       channel_transport_stats->ice_state =
           IceTransportStateToRTCIceTransportState(
               channel_stats.ice_transport_stats.ice_state);
-      for (const cricket::ConnectionInfo& info :
+      for (const ConnectionInfo& info :
            channel_stats.ice_transport_stats.connection_infos) {
         if (info.best_connection) {
           channel_transport_stats->selected_candidate_pair_id =
@@ -2036,7 +2035,7 @@
   {
     MutexLock lock(&cached_certificates_mutex_);
     // Copy the certificate info from the cache, avoiding expensive
-    // rtc::SSLCertChain::GetStats() calls.
+    // webrtc::SSLCertChain::GetStats() calls.
     for (const auto& pair : cached_certificates_by_transport_) {
       transport_cert_stats.insert(
           std::make_pair(pair.first, pair.second.Copy()));
@@ -2048,7 +2047,7 @@
       const std::string& transport_name = entry.first;
 
       CertificateStatsPair certificate_stats_pair;
-      rtc::scoped_refptr<RTCCertificate> local_certificate;
+      scoped_refptr<RTCCertificate> local_certificate;
       if (pc_->GetLocalCertificate(transport_name, &local_certificate)) {
         certificate_stats_pair.local =
             local_certificate->GetSSLCertificateChain().GetStats();
@@ -2196,15 +2195,14 @@
               std::move(video_receive_stats[video_receive_channel]));
         }
       }
-      std::vector<rtc::scoped_refptr<RtpSenderInternal>> senders;
+      std::vector<scoped_refptr<RtpSenderInternal>> senders;
       for (const auto& sender : transceiver->senders()) {
-        senders.push_back(
-            rtc::scoped_refptr<RtpSenderInternal>(sender->internal()));
+        senders.push_back(scoped_refptr<RtpSenderInternal>(sender->internal()));
       }
-      std::vector<rtc::scoped_refptr<RtpReceiverInternal>> receivers;
+      std::vector<scoped_refptr<RtpReceiverInternal>> receivers;
       for (const auto& receiver : transceiver->receivers()) {
         receivers.push_back(
-            rtc::scoped_refptr<RtpReceiverInternal>(receiver->internal()));
+            scoped_refptr<RtpReceiverInternal>(receiver->internal()));
       }
       stats.track_media_info_map.Initialize(std::move(voice_media_info),
                                             std::move(video_media_info),
diff --git a/pc/rtc_stats_collector.h b/pc/rtc_stats_collector.h
index 1bf91ec..016afb4 100644
--- a/pc/rtc_stats_collector.h
+++ b/pc/rtc_stats_collector.h
@@ -57,7 +57,7 @@
 // reports are cached for `cache_lifetime_` ms.
 class RTCStatsCollector : public RefCountInterface {
  public:
-  static rtc::scoped_refptr<RTCStatsCollector> Create(
+  static scoped_refptr<RTCStatsCollector> Create(
       PeerConnectionInternal* pc,
       const Environment& env,
       int64_t cache_lifetime_us = 50 * kNumMicrosecsPerMillisec);
@@ -69,15 +69,15 @@
   // If the optional selector argument is used, stats are filtered according to
   // stats selection algorithm before delivery.
   // https://w3c.github.io/webrtc-pc/#dfn-stats-selection-algorithm
-  void GetStatsReport(rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
+  void GetStatsReport(scoped_refptr<RTCStatsCollectorCallback> callback);
   // If `selector` is null the selection algorithm is still applied (interpreted
   // as: no RTP streams are sent by selector). The result is empty.
-  void GetStatsReport(rtc::scoped_refptr<RtpSenderInternal> selector,
-                      rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
+  void GetStatsReport(scoped_refptr<RtpSenderInternal> selector,
+                      scoped_refptr<RTCStatsCollectorCallback> callback);
   // If `selector` is null the selection algorithm is still applied (interpreted
   // as: no RTP streams are received by selector). The result is empty.
-  void GetStatsReport(rtc::scoped_refptr<RtpReceiverInternal> selector,
-                      rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
+  void GetStatsReport(scoped_refptr<RtpReceiverInternal> selector,
+                      scoped_refptr<RTCStatsCollectorCallback> callback);
   // Clears the cache's reference to the most recent stats report. Subsequently
   // calling `GetStatsReport` guarantees fresh stats. This method must be called
   // any time the PeerConnection visibly changes as a result of an API call as
@@ -123,40 +123,39 @@
     enum class FilterMode { kAll, kSenderSelector, kReceiverSelector };
 
     // Constructs with FilterMode::kAll.
-    explicit RequestInfo(
-        rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
+    explicit RequestInfo(scoped_refptr<RTCStatsCollectorCallback> callback);
     // Constructs with FilterMode::kSenderSelector. The selection algorithm is
     // applied even if `selector` is null, resulting in an empty report.
-    RequestInfo(rtc::scoped_refptr<RtpSenderInternal> selector,
-                rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
+    RequestInfo(scoped_refptr<RtpSenderInternal> selector,
+                scoped_refptr<RTCStatsCollectorCallback> callback);
     // Constructs with FilterMode::kReceiverSelector. The selection algorithm is
     // applied even if `selector` is null, resulting in an empty report.
-    RequestInfo(rtc::scoped_refptr<RtpReceiverInternal> selector,
-                rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
+    RequestInfo(scoped_refptr<RtpReceiverInternal> selector,
+                scoped_refptr<RTCStatsCollectorCallback> callback);
 
     FilterMode filter_mode() const { return filter_mode_; }
-    rtc::scoped_refptr<RTCStatsCollectorCallback> callback() const {
+    scoped_refptr<RTCStatsCollectorCallback> callback() const {
       return callback_;
     }
-    rtc::scoped_refptr<RtpSenderInternal> sender_selector() const {
+    scoped_refptr<RtpSenderInternal> sender_selector() const {
       RTC_DCHECK(filter_mode_ == FilterMode::kSenderSelector);
       return sender_selector_;
     }
-    rtc::scoped_refptr<RtpReceiverInternal> receiver_selector() const {
+    scoped_refptr<RtpReceiverInternal> receiver_selector() const {
       RTC_DCHECK(filter_mode_ == FilterMode::kReceiverSelector);
       return receiver_selector_;
     }
 
    private:
     RequestInfo(FilterMode filter_mode,
-                rtc::scoped_refptr<RTCStatsCollectorCallback> callback,
-                rtc::scoped_refptr<RtpSenderInternal> sender_selector,
-                rtc::scoped_refptr<RtpReceiverInternal> receiver_selector);
+                scoped_refptr<RTCStatsCollectorCallback> callback,
+                scoped_refptr<RtpSenderInternal> sender_selector,
+                scoped_refptr<RtpReceiverInternal> receiver_selector);
 
     FilterMode filter_mode_;
-    rtc::scoped_refptr<RTCStatsCollectorCallback> callback_;
-    rtc::scoped_refptr<RtpSenderInternal> sender_selector_;
-    rtc::scoped_refptr<RtpReceiverInternal> receiver_selector_;
+    scoped_refptr<RTCStatsCollectorCallback> callback_;
+    scoped_refptr<RtpSenderInternal> sender_selector_;
+    scoped_refptr<RtpReceiverInternal> receiver_selector_;
   };
 
   void GetStatsReportInternal(RequestInfo request);
@@ -169,7 +168,7 @@
   // If a BaseChannel is not available (e.g., if signaling has not started),
   // then `mid` and `transport_name` will be null.
   struct RtpTransceiverStatsInfo {
-    rtc::scoped_refptr<RtpTransceiver> transceiver;
+    scoped_refptr<RtpTransceiver> transceiver;
     webrtc::MediaType media_type;
     std::optional<std::string> mid;
     std::optional<std::string> transport_name;
@@ -177,9 +176,8 @@
     std::optional<RtpTransceiverDirection> current_direction;
   };
 
-  void DeliverCachedReport(
-      rtc::scoped_refptr<const RTCStatsReport> cached_report,
-      std::vector<RequestInfo> requests);
+  void DeliverCachedReport(scoped_refptr<const RTCStatsReport> cached_report,
+                           std::vector<RequestInfo> requests);
 
   // Produces `RTCCertificateStats`.
   void ProduceCertificateStats_n(
@@ -243,11 +241,11 @@
   // This is a NO-OP if `network_report_` is null.
   void MergeNetworkReport_s();
 
-  rtc::scoped_refptr<RTCStatsReport> CreateReportFilteredBySelector(
+  scoped_refptr<RTCStatsReport> CreateReportFilteredBySelector(
       bool filter_by_sender_selector,
-      rtc::scoped_refptr<const RTCStatsReport> report,
-      rtc::scoped_refptr<RtpSenderInternal> sender_selector,
-      rtc::scoped_refptr<RtpReceiverInternal> receiver_selector);
+      scoped_refptr<const RTCStatsReport> report,
+      scoped_refptr<RtpSenderInternal> sender_selector,
+      scoped_refptr<RtpReceiverInternal> receiver_selector);
 
   PeerConnectionInternal* const pc_;
   const Environment env_;
@@ -261,13 +259,13 @@
   // Reports that are produced on the signaling thread or the network thread are
   // merged into this report. It is only touched on the signaling thread. Once
   // all partial reports are merged this is the result of a request.
-  rtc::scoped_refptr<RTCStatsReport> partial_report_;
+  scoped_refptr<RTCStatsReport> partial_report_;
   std::vector<RequestInfo> requests_;
   // Holds the result of ProducePartialResultsOnNetworkThread(). It is merged
   // into `partial_report_` on the signaling thread and then nulled by
   // MergeNetworkReport_s(). Thread-safety is ensured by using
   // `network_report_event_`.
-  rtc::scoped_refptr<RTCStatsReport> network_report_;
+  scoped_refptr<RTCStatsReport> network_report_;
   // If set, it is safe to touch the `network_report_` on the signaling thread.
   // This is reset before async-invoking ProducePartialResultsOnNetworkThread()
   // and set when ProducePartialResultsOnNetworkThread() is complete, after it
@@ -284,8 +282,8 @@
   // now get rid of the variable and keep the data scoped within a stats
   // collection sequence.
   std::vector<RtpTransceiverStatsInfo> transceiver_stats_infos_;
-  // This cache avoids having to call rtc::SSLCertChain::GetStats(), which can
-  // relatively expensive. ClearCachedStatsReport() needs to be called on
+  // This cache avoids having to call webrtc::SSLCertChain::GetStats(), which
+  // can relatively expensive. ClearCachedStatsReport() needs to be called on
   // negotiation to ensure the cache is not obsolete.
   Mutex cached_certificates_mutex_;
   std::map<std::string, CertificateStatsPair> cached_certificates_by_transport_
@@ -301,7 +299,7 @@
   // report is.
   int64_t cache_timestamp_us_;
   int64_t cache_lifetime_us_;
-  rtc::scoped_refptr<const RTCStatsReport> cached_report_;
+  scoped_refptr<const RTCStatsReport> cached_report_;
 
   // Data recorded and maintained by the stats collector during its lifetime.
   // Some stats are produced from this record instead of other components.
diff --git a/pc/rtc_stats_collector_unittest.cc b/pc/rtc_stats_collector_unittest.cc
index 70666b8..7ec0991 100644
--- a/pc/rtc_stats_collector_unittest.cc
+++ b/pc/rtc_stats_collector_unittest.cc
@@ -117,7 +117,7 @@
 constexpr uint64_t kRemoteOutboundStatsReportsCount = 9u;
 
 struct CertificateInfo {
-  rtc::scoped_refptr<RTCCertificate> certificate;
+  scoped_refptr<RTCCertificate> certificate;
   std::vector<std::string> ders;
   std::vector<std::string> pems;
   std::vector<std::string> fingerprints;
@@ -206,15 +206,14 @@
 
 class FakeAudioTrackForStats : public MediaStreamTrack<AudioTrackInterface> {
  public:
-  static rtc::scoped_refptr<FakeAudioTrackForStats> Create(
+  static scoped_refptr<FakeAudioTrackForStats> Create(
       const std::string& id,
       MediaStreamTrackInterface::TrackState state,
       bool create_fake_audio_processor) {
-    auto audio_track_stats = rtc::make_ref_counted<FakeAudioTrackForStats>(id);
+    auto audio_track_stats = make_ref_counted<FakeAudioTrackForStats>(id);
     audio_track_stats->set_state(state);
     if (create_fake_audio_processor) {
-      audio_track_stats->processor_ =
-          rtc::make_ref_counted<FakeAudioProcessor>();
+      audio_track_stats->processor_ = make_ref_counted<FakeAudioProcessor>();
     }
     return audio_track_stats;
   }
@@ -229,21 +228,20 @@
   void AddSink(AudioTrackSinkInterface* sink) override {}
   void RemoveSink(AudioTrackSinkInterface* sink) override {}
   bool GetSignalLevel(int* level) override { return false; }
-  rtc::scoped_refptr<AudioProcessorInterface> GetAudioProcessor() override {
+  scoped_refptr<AudioProcessorInterface> GetAudioProcessor() override {
     return processor_;
   }
 
  private:
-  rtc::scoped_refptr<FakeAudioProcessor> processor_;
+  scoped_refptr<FakeAudioProcessor> processor_;
 };
 
 class FakeVideoTrackSourceForStats : public VideoTrackSourceInterface {
  public:
-  static rtc::scoped_refptr<FakeVideoTrackSourceForStats> Create(
-      int input_width,
-      int input_height) {
-    return rtc::make_ref_counted<FakeVideoTrackSourceForStats>(input_width,
-                                                               input_height);
+  static scoped_refptr<FakeVideoTrackSourceForStats> Create(int input_width,
+                                                            int input_height) {
+    return make_ref_counted<FakeVideoTrackSourceForStats>(input_width,
+                                                          input_height);
   }
 
   FakeVideoTrackSourceForStats(int input_width, int input_height)
@@ -266,16 +264,17 @@
   // NotifierInterface (part of MediaSourceInterface)
   void RegisterObserver(ObserverInterface* observer) override {}
   void UnregisterObserver(ObserverInterface* observer) override {}
-  // rtc::VideoSourceInterface<VideoFrame> (part of VideoTrackSourceInterface)
-  void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
+  // webrtc::VideoSourceInterface<VideoFrame> (part of
+  // VideoTrackSourceInterface)
+  void AddOrUpdateSink(VideoSinkInterface<VideoFrame>* sink,
                        const VideoSinkWants& wants) override {}
-  void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override {}
+  void RemoveSink(VideoSinkInterface<VideoFrame>* sink) override {}
   bool SupportsEncodedOutput() const override { return false; }
   void GenerateKeyFrame() override {}
   void AddEncodedSink(
-      rtc::VideoSinkInterface<RecordableEncodedFrame>* sink) override {}
+      VideoSinkInterface<RecordableEncodedFrame>* sink) override {}
   void RemoveEncodedSink(
-      rtc::VideoSinkInterface<RecordableEncodedFrame>* sink) override {}
+      VideoSinkInterface<RecordableEncodedFrame>* sink) override {}
 
  private:
   int input_width_;
@@ -284,37 +283,37 @@
 
 class FakeVideoTrackForStats : public MediaStreamTrack<VideoTrackInterface> {
  public:
-  static rtc::scoped_refptr<FakeVideoTrackForStats> Create(
+  static scoped_refptr<FakeVideoTrackForStats> Create(
       const std::string& id,
       MediaStreamTrackInterface::TrackState state,
-      rtc::scoped_refptr<VideoTrackSourceInterface> source) {
+      scoped_refptr<VideoTrackSourceInterface> source) {
     auto video_track =
-        rtc::make_ref_counted<FakeVideoTrackForStats>(id, std::move(source));
+        make_ref_counted<FakeVideoTrackForStats>(id, std::move(source));
     video_track->set_state(state);
     return video_track;
   }
 
   FakeVideoTrackForStats(const std::string& id,
-                         rtc::scoped_refptr<VideoTrackSourceInterface> source)
+                         scoped_refptr<VideoTrackSourceInterface> source)
       : MediaStreamTrack<VideoTrackInterface>(id), source_(source) {}
 
   std::string kind() const override {
     return MediaStreamTrackInterface::kVideoKind;
   }
 
-  void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
+  void AddOrUpdateSink(VideoSinkInterface<VideoFrame>* sink,
                        const VideoSinkWants& wants) override {}
-  void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override {}
+  void RemoveSink(VideoSinkInterface<VideoFrame>* sink) override {}
 
   VideoTrackSourceInterface* GetSource() const override {
     return source_.get();
   }
 
  private:
-  rtc::scoped_refptr<VideoTrackSourceInterface> source_;
+  scoped_refptr<VideoTrackSourceInterface> source_;
 };
 
-rtc::scoped_refptr<MediaStreamTrackInterface> CreateFakeTrack(
+scoped_refptr<MediaStreamTrackInterface> CreateFakeTrack(
     webrtc::MediaType media_type,
     const std::string& track_id,
     MediaStreamTrackInterface::TrackState track_state,
@@ -328,9 +327,9 @@
   }
 }
 
-rtc::scoped_refptr<MockRtpSenderInternal> CreateMockSender(
+scoped_refptr<MockRtpSenderInternal> CreateMockSender(
     webrtc::MediaType media_type,
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+    scoped_refptr<MediaStreamTrackInterface> track,
     uint32_t ssrc,
     int attachment_id,
     std::vector<std::string> local_stream_ids) {
@@ -339,7 +338,7 @@
               media_type == webrtc::MediaType::AUDIO) ||
              (track->kind() == MediaStreamTrackInterface::kVideoKind &&
               media_type == webrtc::MediaType::VIDEO));
-  auto sender = rtc::make_ref_counted<MockRtpSenderInternal>();
+  auto sender = make_ref_counted<MockRtpSenderInternal>();
   EXPECT_CALL(*sender, track()).WillRepeatedly(Return(track));
   EXPECT_CALL(*sender, ssrc()).WillRepeatedly(Return(ssrc));
   EXPECT_CALL(*sender, media_type()).WillRepeatedly(Return(media_type));
@@ -358,18 +357,18 @@
   return sender;
 }
 
-rtc::scoped_refptr<MockRtpReceiverInternal> CreateMockReceiver(
-    const rtc::scoped_refptr<MediaStreamTrackInterface>& track,
+scoped_refptr<MockRtpReceiverInternal> CreateMockReceiver(
+    const scoped_refptr<MediaStreamTrackInterface>& track,
     uint32_t ssrc,
     int attachment_id) {
-  auto receiver = rtc::make_ref_counted<MockRtpReceiverInternal>();
+  auto receiver = make_ref_counted<MockRtpReceiverInternal>();
   EXPECT_CALL(*receiver, track()).WillRepeatedly(Return(track));
   EXPECT_CALL(*receiver, ssrc()).WillRepeatedly(Invoke([ssrc]() {
     return ssrc;
   }));
   EXPECT_CALL(*receiver, streams())
       .WillRepeatedly(
-          Return(std::vector<rtc::scoped_refptr<MediaStreamInterface>>({})));
+          Return(std::vector<scoped_refptr<MediaStreamInterface>>({})));
 
   EXPECT_CALL(*receiver, media_type())
       .WillRepeatedly(
@@ -390,7 +389,7 @@
 class RTCStatsCollectorWrapper {
  public:
   explicit RTCStatsCollectorWrapper(
-      rtc::scoped_refptr<FakePeerConnectionForStats> pc,
+      scoped_refptr<FakePeerConnectionForStats> pc,
       const Environment& env)
       : pc_(pc),
         stats_collector_(
@@ -398,65 +397,65 @@
                                       env,
                                       50 * kNumMicrosecsPerMillisec)) {}
 
-  rtc::scoped_refptr<RTCStatsCollector> stats_collector() {
+  scoped_refptr<RTCStatsCollector> stats_collector() {
     return stats_collector_;
   }
 
-  rtc::scoped_refptr<const RTCStatsReport> GetStatsReport() {
-    rtc::scoped_refptr<RTCStatsObtainer> callback = RTCStatsObtainer::Create();
+  scoped_refptr<const RTCStatsReport> GetStatsReport() {
+    scoped_refptr<RTCStatsObtainer> callback = RTCStatsObtainer::Create();
     stats_collector_->GetStatsReport(callback);
     return WaitForReport(callback);
   }
 
-  rtc::scoped_refptr<const RTCStatsReport> GetStatsReportWithSenderSelector(
-      rtc::scoped_refptr<RtpSenderInternal> selector) {
-    rtc::scoped_refptr<RTCStatsObtainer> callback = RTCStatsObtainer::Create();
+  scoped_refptr<const RTCStatsReport> GetStatsReportWithSenderSelector(
+      scoped_refptr<RtpSenderInternal> selector) {
+    scoped_refptr<RTCStatsObtainer> callback = RTCStatsObtainer::Create();
     stats_collector_->GetStatsReport(selector, callback);
     return WaitForReport(callback);
   }
 
-  rtc::scoped_refptr<const RTCStatsReport> GetStatsReportWithReceiverSelector(
-      rtc::scoped_refptr<RtpReceiverInternal> selector) {
-    rtc::scoped_refptr<RTCStatsObtainer> callback = RTCStatsObtainer::Create();
+  scoped_refptr<const RTCStatsReport> GetStatsReportWithReceiverSelector(
+      scoped_refptr<RtpReceiverInternal> selector) {
+    scoped_refptr<RTCStatsObtainer> callback = RTCStatsObtainer::Create();
     stats_collector_->GetStatsReport(selector, callback);
     return WaitForReport(callback);
   }
 
-  rtc::scoped_refptr<const RTCStatsReport> GetFreshStatsReport() {
+  scoped_refptr<const RTCStatsReport> GetFreshStatsReport() {
     stats_collector_->ClearCachedStatsReport();
     return GetStatsReport();
   }
 
-  rtc::scoped_refptr<MockRtpSenderInternal> SetupLocalTrackAndSender(
+  scoped_refptr<MockRtpSenderInternal> SetupLocalTrackAndSender(
       webrtc::MediaType media_type,
       const std::string& track_id,
       uint32_t ssrc,
       bool add_stream,
       int attachment_id) {
-    rtc::scoped_refptr<MediaStream> local_stream;
+    scoped_refptr<MediaStream> local_stream;
     if (add_stream) {
       local_stream = MediaStream::Create("LocalStreamId");
       pc_->mutable_local_streams()->AddStream(local_stream);
     }
 
-    rtc::scoped_refptr<MediaStreamTrackInterface> track;
+    scoped_refptr<MediaStreamTrackInterface> track;
     if (media_type == webrtc::MediaType::AUDIO) {
       track = CreateFakeTrack(media_type, track_id,
                               MediaStreamTrackInterface::kLive);
       if (add_stream) {
-        local_stream->AddTrack(rtc::scoped_refptr<AudioTrackInterface>(
+        local_stream->AddTrack(scoped_refptr<AudioTrackInterface>(
             static_cast<AudioTrackInterface*>(track.get())));
       }
     } else {
       track = CreateFakeTrack(media_type, track_id,
                               MediaStreamTrackInterface::kLive);
       if (add_stream) {
-        local_stream->AddTrack(rtc::scoped_refptr<VideoTrackInterface>(
+        local_stream->AddTrack(scoped_refptr<VideoTrackInterface>(
             static_cast<VideoTrackInterface*>(track.get())));
       }
     }
 
-    rtc::scoped_refptr<MockRtpSenderInternal> sender =
+    scoped_refptr<MockRtpSenderInternal> sender =
         CreateMockSender(media_type, track, ssrc, attachment_id, {});
     EXPECT_CALL(*sender, Stop());
     EXPECT_CALL(*sender, SetMediaChannel(_));
@@ -465,34 +464,32 @@
     return sender;
   }
 
-  rtc::scoped_refptr<MockRtpReceiverInternal> SetupRemoteTrackAndReceiver(
+  scoped_refptr<MockRtpReceiverInternal> SetupRemoteTrackAndReceiver(
       webrtc::MediaType media_type,
       const std::string& track_id,
       const std::string& stream_id,
       uint32_t ssrc) {
-    rtc::scoped_refptr<MediaStream> remote_stream =
-        MediaStream::Create(stream_id);
+    scoped_refptr<MediaStream> remote_stream = MediaStream::Create(stream_id);
     pc_->mutable_remote_streams()->AddStream(remote_stream);
 
-    rtc::scoped_refptr<MediaStreamTrackInterface> track;
+    scoped_refptr<MediaStreamTrackInterface> track;
     if (media_type == webrtc::MediaType::AUDIO) {
       track = CreateFakeTrack(media_type, track_id,
                               MediaStreamTrackInterface::kLive);
-      remote_stream->AddTrack(rtc::scoped_refptr<AudioTrackInterface>(
+      remote_stream->AddTrack(scoped_refptr<AudioTrackInterface>(
           static_cast<AudioTrackInterface*>(track.get())));
     } else {
       track = CreateFakeTrack(media_type, track_id,
                               MediaStreamTrackInterface::kLive);
-      remote_stream->AddTrack(rtc::scoped_refptr<VideoTrackInterface>(
+      remote_stream->AddTrack(scoped_refptr<VideoTrackInterface>(
           static_cast<VideoTrackInterface*>(track.get())));
     }
 
-    rtc::scoped_refptr<MockRtpReceiverInternal> receiver =
+    scoped_refptr<MockRtpReceiverInternal> receiver =
         CreateMockReceiver(track, ssrc, 62);
     EXPECT_CALL(*receiver, streams())
-        .WillRepeatedly(
-            Return(std::vector<rtc::scoped_refptr<MediaStreamInterface>>(
-                {remote_stream})));
+        .WillRepeatedly(Return(
+            std::vector<scoped_refptr<MediaStreamInterface>>({remote_stream})));
     EXPECT_CALL(*receiver, SetMediaChannel(_)).WillRepeatedly(Return());
     pc_->AddReceiver(receiver);
     return receiver;
@@ -518,7 +515,7 @@
           std::pair<MediaStreamTrackInterface*, VideoReceiverInfo>>
           remote_video_track_info_pairs,
       std::vector<std::string> local_stream_ids,
-      std::vector<rtc::scoped_refptr<MediaStreamInterface>> remote_streams) {
+      std::vector<scoped_refptr<MediaStreamInterface>> remote_streams) {
     VoiceMediaInfo voice_media_info;
     VideoMediaInfo video_media_info;
 
@@ -530,9 +527,9 @@
                     MediaStreamTrackInterface::kAudioKind);
 
       voice_media_info.senders.push_back(voice_sender_info);
-      rtc::scoped_refptr<MockRtpSenderInternal> rtp_sender = CreateMockSender(
+      scoped_refptr<MockRtpSenderInternal> rtp_sender = CreateMockSender(
           webrtc::MediaType::AUDIO,
-          rtc::scoped_refptr<MediaStreamTrackInterface>(local_audio_track),
+          scoped_refptr<MediaStreamTrackInterface>(local_audio_track),
           voice_sender_info.local_stats[0].ssrc,
           voice_sender_info.local_stats[0].ssrc + 10, local_stream_ids);
       EXPECT_CALL(*rtp_sender, SetMediaChannel(_)).WillRepeatedly(Return());
@@ -549,11 +546,10 @@
                     MediaStreamTrackInterface::kAudioKind);
 
       voice_media_info.receivers.push_back(voice_receiver_info);
-      rtc::scoped_refptr<MockRtpReceiverInternal> rtp_receiver =
-          CreateMockReceiver(
-              rtc::scoped_refptr<MediaStreamTrackInterface>(remote_audio_track),
-              voice_receiver_info.local_stats[0].ssrc,
-              voice_receiver_info.local_stats[0].ssrc + 10);
+      scoped_refptr<MockRtpReceiverInternal> rtp_receiver = CreateMockReceiver(
+          scoped_refptr<MediaStreamTrackInterface>(remote_audio_track),
+          voice_receiver_info.local_stats[0].ssrc,
+          voice_receiver_info.local_stats[0].ssrc + 10);
       EXPECT_CALL(*rtp_receiver, streams())
           .WillRepeatedly(Return(remote_streams));
       EXPECT_CALL(*rtp_receiver, SetMediaChannel(_)).WillRepeatedly(Return());
@@ -569,9 +565,9 @@
 
       video_media_info.senders.push_back(video_sender_info);
       video_media_info.aggregated_senders.push_back(video_sender_info);
-      rtc::scoped_refptr<MockRtpSenderInternal> rtp_sender = CreateMockSender(
+      scoped_refptr<MockRtpSenderInternal> rtp_sender = CreateMockSender(
           webrtc::MediaType::VIDEO,
-          rtc::scoped_refptr<MediaStreamTrackInterface>(local_video_track),
+          scoped_refptr<MediaStreamTrackInterface>(local_video_track),
           video_sender_info.local_stats[0].ssrc,
           video_sender_info.local_stats[0].ssrc + 10, local_stream_ids);
       EXPECT_CALL(*rtp_sender, SetMediaChannel(_)).WillRepeatedly(Return());
@@ -588,11 +584,10 @@
                     MediaStreamTrackInterface::kVideoKind);
 
       video_media_info.receivers.push_back(video_receiver_info);
-      rtc::scoped_refptr<MockRtpReceiverInternal> rtp_receiver =
-          CreateMockReceiver(
-              rtc::scoped_refptr<MediaStreamTrackInterface>(remote_video_track),
-              video_receiver_info.local_stats[0].ssrc,
-              video_receiver_info.local_stats[0].ssrc + 10);
+      scoped_refptr<MockRtpReceiverInternal> rtp_receiver = CreateMockReceiver(
+          scoped_refptr<MediaStreamTrackInterface>(remote_video_track),
+          video_receiver_info.local_stats[0].ssrc,
+          video_receiver_info.local_stats[0].ssrc + 10);
       EXPECT_CALL(*rtp_receiver, streams())
           .WillRepeatedly(Return(remote_streams));
       EXPECT_CALL(*rtp_receiver, SetMediaChannel(_)).WillRepeatedly(Return());
@@ -604,8 +599,8 @@
   }
 
  private:
-  rtc::scoped_refptr<const RTCStatsReport> WaitForReport(
-      rtc::scoped_refptr<RTCStatsObtainer> callback) {
+  scoped_refptr<const RTCStatsReport> WaitForReport(
+      scoped_refptr<RTCStatsObtainer> callback) {
     EXPECT_THAT(
         WaitUntil(
             [&] { return callback->report() != nullptr; }, ::testing::IsTrue(),
@@ -623,20 +618,20 @@
     return callback->report();
   }
 
-  rtc::scoped_refptr<FakePeerConnectionForStats> pc_;
-  rtc::scoped_refptr<RTCStatsCollector> stats_collector_;
+  scoped_refptr<FakePeerConnectionForStats> pc_;
+  scoped_refptr<RTCStatsCollector> stats_collector_;
 };
 
 class RTCStatsCollectorTest : public ::testing::Test {
  public:
   RTCStatsCollectorTest()
-      : pc_(rtc::make_ref_counted<FakePeerConnectionForStats>()),
+      : pc_(make_ref_counted<FakePeerConnectionForStats>()),
         stats_(new RTCStatsCollectorWrapper(pc_, CreateEnvironment())),
         data_channel_controller_(
             new FakeDataChannelController(pc_->network_thread())) {}
 
   void ExpectReportContainsCertificateInfo(
-      const rtc::scoped_refptr<const RTCStatsReport>& report,
+      const scoped_refptr<const RTCStatsReport>& report,
       const CertificateInfo& certinfo) {
     for (size_t i = 0; i < certinfo.fingerprints.size(); ++i) {
       RTCCertificateStats expected_certificate_stats(
@@ -656,7 +651,7 @@
   }
 
   const RTCCertificateStats* GetCertificateStatsFromFingerprint(
-      const rtc::scoped_refptr<const RTCStatsReport>& report,
+      const scoped_refptr<const RTCStatsReport>& report,
       const std::string& fingerprint) {
     auto certificates = report->GetStatsOfType<RTCCertificateStats>();
     for (const auto* certificate : certificates) {
@@ -668,10 +663,10 @@
   }
 
   struct ExampleStatsGraph {
-    rtc::scoped_refptr<RtpSenderInternal> sender;
-    rtc::scoped_refptr<RtpReceiverInternal> receiver;
+    scoped_refptr<RtpSenderInternal> sender;
+    scoped_refptr<RtpReceiverInternal> receiver;
 
-    rtc::scoped_refptr<const RTCStatsReport> full_report;
+    scoped_refptr<const RTCStatsReport> full_report;
     std::string send_codec_id;
     std::string recv_codec_id;
     std::string outbound_rtp_id;
@@ -879,13 +874,13 @@
  protected:
   ScopedFakeClock fake_clock_;
   AutoThread main_thread_;
-  rtc::scoped_refptr<FakePeerConnectionForStats> pc_;
+  scoped_refptr<FakePeerConnectionForStats> pc_;
   std::unique_ptr<RTCStatsCollectorWrapper> stats_;
   std::unique_ptr<FakeDataChannelController> data_channel_controller_;
 };
 
 TEST_F(RTCStatsCollectorTest, SingleCallback) {
-  rtc::scoped_refptr<const RTCStatsReport> result;
+  scoped_refptr<const RTCStatsReport> result;
   stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&result));
   EXPECT_THAT(
       WaitUntil(
@@ -895,7 +890,7 @@
 }
 
 TEST_F(RTCStatsCollectorTest, MultipleCallbacks) {
-  rtc::scoped_refptr<const RTCStatsReport> a, b, c;
+  scoped_refptr<const RTCStatsReport> a, b, c;
   stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&a));
   stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&b));
   stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&c));
@@ -921,22 +916,22 @@
 
 TEST_F(RTCStatsCollectorTest, CachedStatsReports) {
   // Caching should ensure `a` and `b` are the same report.
-  rtc::scoped_refptr<const RTCStatsReport> a = stats_->GetStatsReport();
-  rtc::scoped_refptr<const RTCStatsReport> b = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> a = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> b = stats_->GetStatsReport();
   EXPECT_EQ(a.get(), b.get());
   // Invalidate cache by clearing it.
   stats_->stats_collector()->ClearCachedStatsReport();
-  rtc::scoped_refptr<const RTCStatsReport> c = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> c = stats_->GetStatsReport();
   EXPECT_NE(b.get(), c.get());
   // Invalidate cache by advancing time.
   fake_clock_.AdvanceTime(TimeDelta::Millis(51));
-  rtc::scoped_refptr<const RTCStatsReport> d = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> d = stats_->GetStatsReport();
   EXPECT_TRUE(d);
   EXPECT_NE(c.get(), d.get());
 }
 
 TEST_F(RTCStatsCollectorTest, MultipleCallbacksWithInvalidatedCacheInBetween) {
-  rtc::scoped_refptr<const RTCStatsReport> a, b, c;
+  scoped_refptr<const RTCStatsReport> a, b, c;
   stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&a));
   stats_->stats_collector()->GetStatsReport(RTCStatsObtainer::Create(&b));
   // Cache is invalidated after 50 ms.
@@ -965,7 +960,7 @@
 
 TEST_F(RTCStatsCollectorTest, ToJsonProducesParseableJson) {
   ExampleStatsGraph graph = SetupExampleStatsGraphForSelectorTests();
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   std::string json_format = report->ToJson();
 
   Json::CharReaderBuilder builder;
@@ -996,7 +991,7 @@
       kTransportName,
       remote_certinfo->certificate->GetSSLCertificateChain().Clone());
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   ExpectReportContainsCertificateInfo(report, *local_certinfo);
   ExpectReportContainsCertificateInfo(report, *remote_certinfo);
@@ -1033,7 +1028,7 @@
   pc_->AddVideoChannel("Mid4", "Transport2", mid4_info);
 
   // This should not crash (https://crbug.com/1361612).
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   auto inbound_rtps = report->GetStatsOfType<RTCInboundRtpStreamStats>();
   auto outbound_rtps = report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   EXPECT_EQ(inbound_rtps.size(), 4u);
@@ -1147,7 +1142,7 @@
   auto video_channels =
       pc_->AddVideoChannel("VideoMid", "TransportName", video_media_info);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   RTCCodecStats expected_inbound_audio_codec(
       "CITTransportName1_1_minptime=10;useinbandfec=1", report->timestamp());
@@ -1275,7 +1270,7 @@
 
   // There should be no duplicate codecs because all codec references are on the
   // same transport.
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   auto codec_stats = report->GetStatsOfType<RTCCodecStats>();
   EXPECT_EQ(codec_stats.size(), 2u);
 
@@ -1328,7 +1323,7 @@
 
   // Despite having the same PT we should see two codec stats because their FMTP
   // lines are different.
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   auto codec_stats = report->GetStatsOfType<RTCCodecStats>();
   EXPECT_EQ(codec_stats.size(), 2u);
 
@@ -1397,7 +1392,7 @@
       kVideoTransport,
       video_remote_certinfo->certificate->GetSSLCertificateChain().Clone());
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   ExpectReportContainsCertificateInfo(report, *audio_local_certinfo);
   ExpectReportContainsCertificateInfo(report, *audio_remote_certinfo);
   ExpectReportContainsCertificateInfo(report, *video_local_certinfo);
@@ -1422,7 +1417,7 @@
       kTransportName,
       remote_certinfo->certificate->GetSSLCertificateChain().Clone());
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   ExpectReportContainsCertificateInfo(report, *local_certinfo);
   ExpectReportContainsCertificateInfo(report, *remote_certinfo);
 }
@@ -1445,8 +1440,7 @@
   ASSERT_EQ(initial_local_certinfo->fingerprints.size(), 2u);
   ASSERT_EQ(initial_remote_certinfo->fingerprints.size(), 2u);
 
-  rtc::scoped_refptr<const RTCStatsReport> first_report =
-      stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> first_report = stats_->GetStatsReport();
   const auto* first_local_cert0 = GetCertificateStatsFromFingerprint(
       first_report, initial_local_certinfo->fingerprints[0]);
   const auto* first_local_cert1 = GetCertificateStatsFromFingerprint(
@@ -1485,8 +1479,7 @@
   // Advance time to ensure a fresh stats report, but don't clear the
   // certificate stats cache.
   fake_clock.AdvanceTime(TimeDelta::Seconds(1));
-  rtc::scoped_refptr<const RTCStatsReport> second_report =
-      stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> second_report = stats_->GetStatsReport();
   // We expect to see the same certificates as before due to not clearing the
   // certificate cache.
   const auto* second_local_cert0 =
@@ -1527,8 +1520,7 @@
 
   // Clear the cache, including the cached certificates.
   stats_->stats_collector()->ClearCachedStatsReport();
-  rtc::scoped_refptr<const RTCStatsReport> third_report =
-      stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> third_report = stats_->GetStatsReport();
   // Now the old certificates stats should be deleted.
   EXPECT_FALSE(third_report->Get(first_local_cert0->id()));
   EXPECT_FALSE(third_report->Get(first_local_cert1->id()));
@@ -1550,14 +1542,14 @@
   // This is not a safe assumption, but in order to make it work for
   // the test, we reset the ID allocator at test start.
   SctpDataChannel::ResetInternalIdAllocatorForTesting(-1);
-  pc_->AddSctpDataChannel(rtc::make_ref_counted<MockSctpDataChannel>(
+  pc_->AddSctpDataChannel(make_ref_counted<MockSctpDataChannel>(
       data_channel_controller_->weak_ptr(), /*id=*/-1,
       DataChannelInterface::kConnecting));
-  pc_->AddSctpDataChannel(rtc::make_ref_counted<MockSctpDataChannel>(
+  pc_->AddSctpDataChannel(make_ref_counted<MockSctpDataChannel>(
       data_channel_controller_->weak_ptr(), /*id=*/-1,
       DataChannelInterface::kConnecting));
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   RTCDataChannelStats expected_data_channel0("D0", Timestamp::Zero());
   // Default values from MockDataChannel.
   expected_data_channel0.label = "MockSctpDataChannel";
@@ -1579,7 +1571,7 @@
   // This is not a safe assumption, but in order to make it work for
   // the test, we reset the ID allocator at test start.
   SctpDataChannel::ResetInternalIdAllocatorForTesting(-1);
-  pc_->AddSctpDataChannel(rtc::make_ref_counted<MockSctpDataChannel>(
+  pc_->AddSctpDataChannel(make_ref_counted<MockSctpDataChannel>(
       data_channel_controller_->weak_ptr(), 0, "MockSctpDataChannel0",
       DataChannelInterface::kConnecting, "proto1", 1, 2, 3, 4));
   RTCDataChannelStats expected_data_channel0("D0", Timestamp::Zero());
@@ -1592,7 +1584,7 @@
   expected_data_channel0.messages_received = 3;
   expected_data_channel0.bytes_received = 4;
 
-  pc_->AddSctpDataChannel(rtc::make_ref_counted<MockSctpDataChannel>(
+  pc_->AddSctpDataChannel(make_ref_counted<MockSctpDataChannel>(
       data_channel_controller_->weak_ptr(), 1, "MockSctpDataChannel1",
       DataChannelInterface::kOpen, "proto2", 5, 6, 7, 8));
   RTCDataChannelStats expected_data_channel1("D1", Timestamp::Zero());
@@ -1605,7 +1597,7 @@
   expected_data_channel1.messages_received = 7;
   expected_data_channel1.bytes_received = 8;
 
-  pc_->AddSctpDataChannel(rtc::make_ref_counted<MockSctpDataChannel>(
+  pc_->AddSctpDataChannel(make_ref_counted<MockSctpDataChannel>(
       data_channel_controller_->weak_ptr(), 2, "MockSctpDataChannel2",
       DataChannelInterface::kClosing, "proto1", 9, 10, 11, 12));
   RTCDataChannelStats expected_data_channel2("D2", Timestamp::Zero());
@@ -1618,7 +1610,7 @@
   expected_data_channel2.messages_received = 11;
   expected_data_channel2.bytes_received = 12;
 
-  pc_->AddSctpDataChannel(rtc::make_ref_counted<MockSctpDataChannel>(
+  pc_->AddSctpDataChannel(make_ref_counted<MockSctpDataChannel>(
       data_channel_controller_->weak_ptr(), 3, "MockSctpDataChannel3",
       DataChannelInterface::kClosed, "proto3", 13, 14, 15, 16));
   RTCDataChannelStats expected_data_channel3("D3", Timestamp::Zero());
@@ -1631,7 +1623,7 @@
   expected_data_channel3.messages_received = 15;
   expected_data_channel3.bytes_received = 16;
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   ASSERT_TRUE(report->Get(expected_data_channel0.id()));
   EXPECT_EQ(
@@ -1860,7 +1852,7 @@
   pc_->AddVideoChannel("video", "b");
   pc_->SetTransportStats("b", b_transport_channel_stats);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   ASSERT_TRUE(report->Get(expected_a_local_host.id()));
   EXPECT_EQ(expected_a_local_host, report->Get(expected_a_local_host.id())
@@ -1946,7 +1938,7 @@
   pc_->AddVideoChannel("video", kTransportName);
   pc_->SetTransportStats(kTransportName, transport_channel_stats);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   RTCIceCandidatePairStats expected_pair(
       "CP" + local_candidate->id() + "_" + remote_candidate->id(),
@@ -2081,7 +2073,7 @@
 
 TEST_F(RTCStatsCollectorTest, CollectRTCPeerConnectionStats) {
   {
-    rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+    scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
     RTCPeerConnectionStats expected("P", report->timestamp());
     expected.data_channels_opened = 0;
     expected.data_channels_closed = 0;
@@ -2090,10 +2082,10 @@
   }
 
   FakeDataChannelController controller(pc_->network_thread());
-  rtc::scoped_refptr<SctpDataChannel> dummy_channel_a = SctpDataChannel::Create(
+  scoped_refptr<SctpDataChannel> dummy_channel_a = SctpDataChannel::Create(
       controller.weak_ptr(), "DummyChannelA", false, InternalDataChannelInit(),
       Thread::Current(), Thread::Current());
-  rtc::scoped_refptr<SctpDataChannel> dummy_channel_b = SctpDataChannel::Create(
+  scoped_refptr<SctpDataChannel> dummy_channel_b = SctpDataChannel::Create(
       controller.weak_ptr(), "DummyChannelB", false, InternalDataChannelInit(),
       Thread::Current(), Thread::Current());
 
@@ -2104,8 +2096,7 @@
       dummy_channel_b->internal_id(), DataChannelInterface::DataState::kClosed);
 
   {
-    rtc::scoped_refptr<const RTCStatsReport> report =
-        stats_->GetFreshStatsReport();
+    scoped_refptr<const RTCStatsReport> report = stats_->GetFreshStatsReport();
     RTCPeerConnectionStats expected("P", report->timestamp());
     expected.data_channels_opened = 1;
     expected.data_channels_closed = 0;
@@ -2119,8 +2110,7 @@
       dummy_channel_b->internal_id(), DataChannelInterface::DataState::kClosed);
 
   {
-    rtc::scoped_refptr<const RTCStatsReport> report =
-        stats_->GetFreshStatsReport();
+    scoped_refptr<const RTCStatsReport> report = stats_->GetFreshStatsReport();
     RTCPeerConnectionStats expected("P", report->timestamp());
     expected.data_channels_opened = 2;
     expected.data_channels_closed = 1;
@@ -2134,8 +2124,7 @@
       dummy_channel_b->internal_id(), DataChannelInterface::DataState::kOpen);
 
   {
-    rtc::scoped_refptr<const RTCStatsReport> report =
-        stats_->GetFreshStatsReport();
+    scoped_refptr<const RTCStatsReport> report = stats_->GetFreshStatsReport();
     RTCPeerConnectionStats expected("P", report->timestamp());
     expected.data_channels_opened = 3;
     expected.data_channels_closed = 1;
@@ -2149,8 +2138,7 @@
       dummy_channel_b->internal_id(), DataChannelInterface::DataState::kClosed);
 
   {
-    rtc::scoped_refptr<const RTCStatsReport> report =
-        stats_->GetFreshStatsReport();
+    scoped_refptr<const RTCStatsReport> report = stats_->GetFreshStatsReport();
     RTCPeerConnectionStats expected("P", report->timestamp());
     expected.data_channels_opened = 3;
     expected.data_channels_closed = 3;
@@ -2214,7 +2202,7 @@
   pc_->GetTransceiversInternal()[0]->internal()->set_current_direction(
       RtpTransceiverDirection::kSendRecv);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   RTCInboundRtpStreamStats expected_audio("ITTransportName1A1",
                                           report->timestamp());
@@ -2295,7 +2283,7 @@
     // We do not expect a playout id when only sending.
     pc_->GetTransceiversInternal()[0]->internal()->set_current_direction(
         RtpTransceiverDirection::kSendOnly);
-    rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+    scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
     ASSERT_TRUE(report->Get("ITTransportName1A1"));
     auto stats =
         report->Get("ITTransportName1A1")->cast_to<RTCInboundRtpStreamStats>();
@@ -2305,8 +2293,7 @@
     // We do expect a playout id when receiving.
     pc_->GetTransceiversInternal()[0]->internal()->set_current_direction(
         RtpTransceiverDirection::kRecvOnly);
-    rtc::scoped_refptr<const RTCStatsReport> report =
-        stats_->GetFreshStatsReport();
+    scoped_refptr<const RTCStatsReport> report = stats_->GetFreshStatsReport();
     ASSERT_TRUE(report->Get("ITTransportName1A1"));
     auto stats =
         report->Get("ITTransportName1A1")->cast_to<RTCInboundRtpStreamStats>();
@@ -2385,7 +2372,7 @@
   stats_->SetupRemoteTrackAndReceiver(
       webrtc::MediaType::VIDEO, "RemoteVideoTrackID", "RemoteStreamId", 1);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   RTCInboundRtpStreamStats expected_video("ITTransportName1V1",
                                           report->timestamp());
@@ -2486,7 +2473,7 @@
   stats_->SetupRemoteTrackAndReceiver(
       webrtc::MediaType::AUDIO, "RemoteAudioTrackID", "RemoteStreamId", 1);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   auto stats_of_track_type = report->GetStatsOfType<RTCAudioPlayoutStats>();
   ASSERT_EQ(1U, stats_of_track_type.size());
 
@@ -2530,7 +2517,7 @@
   stats_->SetupRemoteTrackAndReceiver(
       webrtc::MediaType::VIDEO, "RemoteVideoTrackID", "RemoteStreamId", 1);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   auto inbound_rtps = report->GetStatsOfType<RTCInboundRtpStreamStats>();
   ASSERT_EQ(inbound_rtps.size(), 1u);
   ASSERT_TRUE(inbound_rtps[0]->goog_timing_frame_info.has_value());
@@ -2568,7 +2555,7 @@
                                    "LocalAudioTrackID", 1, true,
                                    /*attachment_id=*/50);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   RTCOutboundRtpStreamStats expected_audio("OTTransportName1A1",
                                            report->timestamp());
@@ -2664,7 +2651,7 @@
                                    "LocalVideoTrackID", 1, true,
                                    /*attachment_id=*/50);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   auto stats_of_my_type = report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   ASSERT_EQ(2U, stats_of_my_type.size());
@@ -2789,7 +2776,7 @@
   pc_->SetTransportStats(kTransportName, {rtp_transport_channel_stats});
 
   // Get stats without RTCP, an active connection or certificates.
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   RTCTransportStats expected_rtp_transport(
       "Ttransport" + absl::StrCat(ICE_CANDIDATE_COMPONENT_RTP),
@@ -2948,7 +2935,7 @@
   rtp_transport_channel_stats.ssl_version_bytes = 0x0203;
   rtp_transport_channel_stats.dtls_role = SSL_CLIENT;
   rtp_transport_channel_stats.ice_transport_stats.ice_role =
-      cricket::ICEROLE_CONTROLLING;
+      ICEROLE_CONTROLLING;
   rtp_transport_channel_stats.ice_transport_stats.ice_local_username_fragment =
       "thelocalufrag";
   rtp_transport_channel_stats.ice_transport_stats.ice_state =
@@ -2959,7 +2946,7 @@
   pc_->SetTransportStats(kTransportName, {rtp_transport_channel_stats});
 
   // Get stats
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   RTCTransportStats expected_rtp_transport(
       "Ttransport" + absl::StrCat(ICE_CANDIDATE_COMPONENT_RTP),
@@ -3016,7 +3003,7 @@
                                    "LocalAudioTrackID", 1, false,
                                    /*attachment_id=*/50);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   RTCOutboundRtpStreamStats expected_audio("OTTransportName1A1",
                                            report->timestamp());
@@ -3062,7 +3049,7 @@
                                    "LocalAudioTrackID", kSsrc, false,
                                    kAttachmentId);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   RTCAudioSourceStats expected_audio("SA42", report->timestamp());
   expected_audio.track_identifier = "LocalAudioTrackID";
@@ -3101,14 +3088,14 @@
                                                            kVideoSourceHeight);
   auto video_track = FakeVideoTrackForStats::Create(
       "LocalVideoTrackID", MediaStreamTrackInterface::kLive, video_source);
-  rtc::scoped_refptr<MockRtpSenderInternal> sender = CreateMockSender(
+  scoped_refptr<MockRtpSenderInternal> sender = CreateMockSender(
       webrtc::MediaType::VIDEO, video_track, kSsrc, kAttachmentId, {});
   EXPECT_CALL(*sender, Stop());
   EXPECT_CALL(*sender, SetMediaChannel(_));
   EXPECT_CALL(*sender, SetSendCodecs(_));
   pc_->AddSender(sender);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   RTCVideoSourceStats expected_video("SV42", report->timestamp());
   expected_video.track_identifier = "LocalVideoTrackID";
@@ -3146,14 +3133,14 @@
                                                            kVideoSourceHeight);
   auto video_track = FakeVideoTrackForStats::Create(
       "LocalVideoTrackID", MediaStreamTrackInterface::kLive, video_source);
-  rtc::scoped_refptr<MockRtpSenderInternal> sender = CreateMockSender(
+  scoped_refptr<MockRtpSenderInternal> sender = CreateMockSender(
       webrtc::MediaType::VIDEO, video_track, kNoSsrc, kAttachmentId, {});
   EXPECT_CALL(*sender, Stop());
   EXPECT_CALL(*sender, SetMediaChannel(_));
   EXPECT_CALL(*sender, SetSendCodecs(_));
   pc_->AddSender(sender);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   ASSERT_TRUE(report->Get("SV42"));
   auto video_stats = report->Get("SV42")->cast_to<RTCVideoSourceStats>();
   EXPECT_FALSE(video_stats.frames_per_second.has_value());
@@ -3177,14 +3164,14 @@
   auto video_track = FakeVideoTrackForStats::Create(
       "LocalVideoTrackID", MediaStreamTrackInterface::kLive,
       /*source=*/nullptr);
-  rtc::scoped_refptr<MockRtpSenderInternal> sender = CreateMockSender(
+  scoped_refptr<MockRtpSenderInternal> sender = CreateMockSender(
       webrtc::MediaType::VIDEO, video_track, kSsrc, kAttachmentId, {});
   EXPECT_CALL(*sender, Stop());
   EXPECT_CALL(*sender, SetMediaChannel(_));
   EXPECT_CALL(*sender, SetSendCodecs(_));
   pc_->AddSender(sender);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   ASSERT_TRUE(report->Get("SV42"));
   auto video_stats = report->Get("SV42")->cast_to<RTCVideoSourceStats>();
   EXPECT_FALSE(video_stats.width.has_value());
@@ -3201,14 +3188,14 @@
   voice_media_info.senders[0].local_stats.push_back(SsrcSenderInfo());
   voice_media_info.senders[0].local_stats[0].ssrc = kSsrc;
   pc_->AddVoiceChannel("AudioMid", "TransportName", voice_media_info);
-  rtc::scoped_refptr<MockRtpSenderInternal> sender = CreateMockSender(
+  scoped_refptr<MockRtpSenderInternal> sender = CreateMockSender(
       webrtc::MediaType::AUDIO, /*track=*/nullptr, kSsrc, kAttachmentId, {});
   EXPECT_CALL(*sender, Stop());
   EXPECT_CALL(*sender, SetMediaChannel(_));
   EXPECT_CALL(*sender, SetSendCodecs(_));
   pc_->AddSender(sender);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   EXPECT_FALSE(report->Get("SA42"));
 }
 
@@ -3332,7 +3319,7 @@
   AddSenderInfoAndMediaChannel("TransportName", report_block_datas,
                                std::nullopt);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   for (auto ssrc : ssrcs) {
     std::string stream_id = "" + std::to_string(ssrc);
     RTCRemoteInboundRtpStreamStats expected_remote_inbound_rtp(
@@ -3385,7 +3372,7 @@
   AddSenderInfoAndMediaChannel("TransportName", {report_block_data},
                                std::nullopt);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   std::string remote_inbound_rtp_id = "RI" + MediaTypeCharStr() + "12";
   ASSERT_TRUE(report->Get(remote_inbound_rtp_id));
@@ -3417,7 +3404,7 @@
   // Advance time, it should be OK to have fresher reports than report blocks.
   fake_clock_.AdvanceTime(TimeDelta::Micros(1234));
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   std::string remote_inbound_rtp_id = "RI" + MediaTypeCharStr() + "12";
   ASSERT_TRUE(report->Get(remote_inbound_rtp_id));
@@ -3453,7 +3440,7 @@
 
   AddSenderInfoAndMediaChannel("TransportName", {report_block_data}, codec);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   std::string remote_inbound_rtp_id = "RI" + MediaTypeCharStr() + "12";
   ASSERT_TRUE(report->Get(remote_inbound_rtp_id));
@@ -3494,7 +3481,7 @@
   AddSenderInfoAndMediaChannel("TransportName", {report_block_data},
                                std::nullopt);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   std::string remote_inbound_rtp_id = "RI" + MediaTypeCharStr() + "12";
   ASSERT_TRUE(report->Get(remote_inbound_rtp_id));
@@ -3521,7 +3508,7 @@
   EXPECT_FALSE(graph.full_report->Get(graph.remote_outbound_rtp_id));
   // Also check that no other remote outbound report is created (in case the
   // expected ID is incorrect).
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   ASSERT_NE(report->begin(), report->end())
       << "No reports have been generated.";
   for (const auto& stats : *report) {
@@ -3560,30 +3547,30 @@
   video_media_info.senders[0].framerate_input = 29.0;
   pc_->AddVideoChannel("VideoMid", "TransportName", video_media_info);
 
-  rtc::scoped_refptr<MockRtpSenderInternal> sender = CreateMockSender(
+  scoped_refptr<MockRtpSenderInternal> sender = CreateMockSender(
       webrtc::MediaType::VIDEO, /*track=*/nullptr, kSsrc, kAttachmentId, {});
   EXPECT_CALL(*sender, Stop());
   EXPECT_CALL(*sender, SetMediaChannel(_));
   EXPECT_CALL(*sender, SetSendCodecs(_));
   pc_->AddSender(sender);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   EXPECT_FALSE(report->Get("SV42"));
 }
 
 // Test collecting echo return loss stats from the audio processor attached to
 // the track, rather than the voice sender info.
 TEST_F(RTCStatsCollectorTest, CollectEchoReturnLossFromTrackAudioProcessor) {
-  rtc::scoped_refptr<MediaStream> local_stream =
+  scoped_refptr<MediaStream> local_stream =
       MediaStream::Create("LocalStreamId");
   pc_->mutable_local_streams()->AddStream(local_stream);
 
   // Local audio track
-  rtc::scoped_refptr<MediaStreamTrackInterface> local_audio_track =
+  scoped_refptr<MediaStreamTrackInterface> local_audio_track =
       CreateFakeTrack(webrtc::MediaType::AUDIO, "LocalAudioTrackID",
                       MediaStreamTrackInterface::kEnded,
                       /*create_fake_audio_processor=*/true);
-  local_stream->AddTrack(rtc::scoped_refptr<AudioTrackInterface>(
+  local_stream->AddTrack(scoped_refptr<AudioTrackInterface>(
       static_cast<AudioTrackInterface*>(local_audio_track.get())));
 
   VoiceSenderInfo voice_sender_info_ssrc1;
@@ -3594,7 +3581,7 @@
       {std::make_pair(local_audio_track.get(), voice_sender_info_ssrc1)}, {},
       {}, {}, {local_stream->id()}, {});
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   RTCAudioSourceStats expected_audio("SA11", report->timestamp());
   expected_audio.track_identifier = "LocalAudioTrackID";
@@ -3621,7 +3608,7 @@
   //                |        |
   //                v        v
   //       codec (send)     transport
-  rtc::scoped_refptr<const RTCStatsReport> sender_report =
+  scoped_refptr<const RTCStatsReport> sender_report =
       stats_->GetStatsReportWithSenderSelector(graph.sender);
   EXPECT_TRUE(sender_report);
   EXPECT_EQ(sender_report->timestamp(), graph.full_report->timestamp());
@@ -3645,7 +3632,7 @@
   //                               |       |
   //                               v       v
   //                        transport     codec (recv)
-  rtc::scoped_refptr<const RTCStatsReport> receiver_report =
+  scoped_refptr<const RTCStatsReport> receiver_report =
       stats_->GetStatsReportWithReceiverSelector(graph.receiver);
   EXPECT_TRUE(receiver_report);
   EXPECT_EQ(receiver_report->size(), 3u);
@@ -3661,7 +3648,7 @@
 
 TEST_F(RTCStatsCollectorTest, GetStatsWithNullSenderSelector) {
   ExampleStatsGraph graph = SetupExampleStatsGraphForSelectorTests();
-  rtc::scoped_refptr<const RTCStatsReport> empty_report =
+  scoped_refptr<const RTCStatsReport> empty_report =
       stats_->GetStatsReportWithSenderSelector(nullptr);
   EXPECT_TRUE(empty_report);
   EXPECT_EQ(empty_report->timestamp(), graph.full_report->timestamp());
@@ -3670,7 +3657,7 @@
 
 TEST_F(RTCStatsCollectorTest, GetStatsWithNullReceiverSelector) {
   ExampleStatsGraph graph = SetupExampleStatsGraphForSelectorTests();
-  rtc::scoped_refptr<const RTCStatsReport> empty_report =
+  scoped_refptr<const RTCStatsReport> empty_report =
       stats_->GetStatsReportWithReceiverSelector(nullptr);
   EXPECT_TRUE(empty_report);
   EXPECT_EQ(empty_report->timestamp(), graph.full_report->timestamp());
@@ -3680,15 +3667,15 @@
 // Before SetLocalDescription() senders don't have an SSRC.
 // To simulate this case we create a mock sender with SSRC=0.
 TEST_F(RTCStatsCollectorTest, RtpIsMissingWhileSsrcIsZero) {
-  rtc::scoped_refptr<MediaStreamTrackInterface> track = CreateFakeTrack(
+  scoped_refptr<MediaStreamTrackInterface> track = CreateFakeTrack(
       webrtc::MediaType::AUDIO, "audioTrack", MediaStreamTrackInterface::kLive);
-  rtc::scoped_refptr<MockRtpSenderInternal> sender =
+  scoped_refptr<MockRtpSenderInternal> sender =
       CreateMockSender(webrtc::MediaType::AUDIO, track, 0, 49, {});
   EXPECT_CALL(*sender, Stop());
   EXPECT_CALL(*sender, SetSendCodecs(_));
   pc_->AddSender(sender);
 
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
 
   auto outbound_rtps = report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   EXPECT_TRUE(outbound_rtps.empty());
@@ -3697,16 +3684,16 @@
 // We may also be in a case where the SSRC has been assigned but no
 // `voice_sender_info` stats exist yet.
 TEST_F(RTCStatsCollectorTest, DoNotCrashIfSsrcIsKnownButInfosAreStillMissing) {
-  rtc::scoped_refptr<MediaStreamTrackInterface> track = CreateFakeTrack(
+  scoped_refptr<MediaStreamTrackInterface> track = CreateFakeTrack(
       webrtc::MediaType::AUDIO, "audioTrack", MediaStreamTrackInterface::kLive);
-  rtc::scoped_refptr<MockRtpSenderInternal> sender =
+  scoped_refptr<MockRtpSenderInternal> sender =
       CreateMockSender(webrtc::MediaType::AUDIO, track, 4711, 49, {});
   EXPECT_CALL(*sender, Stop());
   EXPECT_CALL(*sender, SetSendCodecs(_));
   pc_->AddSender(sender);
 
   // We do not generate any matching voice_sender_info stats.
-  rtc::scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
+  scoped_refptr<const RTCStatsReport> report = stats_->GetStatsReport();
   auto outbound_rtps = report->GetStatsOfType<RTCOutboundRtpStreamStats>();
   EXPECT_TRUE(outbound_rtps.empty());
 }
@@ -3717,7 +3704,7 @@
   explicit RecursiveCallback(RTCStatsCollectorWrapper* stats) : stats_(stats) {}
 
   void OnStatsDelivered(
-      const rtc::scoped_refptr<const RTCStatsReport>& report) override {
+      const scoped_refptr<const RTCStatsReport>& report) override {
     stats_->GetStatsReport();
     called_ = true;
   }
@@ -3732,8 +3719,8 @@
 // Test that nothing bad happens if a callback causes GetStatsReport to be
 // called again recursively. Regression test for crbug.com/webrtc/8973.
 TEST_F(RTCStatsCollectorTest, DoNotCrashWhenGetStatsCalledDuringCallback) {
-  auto callback1 = rtc::make_ref_counted<RecursiveCallback>(stats_.get());
-  auto callback2 = rtc::make_ref_counted<RecursiveCallback>(stats_.get());
+  auto callback1 = make_ref_counted<RecursiveCallback>(stats_.get());
+  auto callback2 = make_ref_counted<RecursiveCallback>(stats_.get());
   stats_->stats_collector()->GetStatsReport(callback1);
   stats_->stats_collector()->GetStatsReport(callback2);
   EXPECT_THAT(
@@ -3768,13 +3755,13 @@
 class FakeRTCStatsCollector : public RTCStatsCollector,
                               public RTCStatsCollectorCallback {
  public:
-  static rtc::scoped_refptr<FakeRTCStatsCollector> Create(
+  static scoped_refptr<FakeRTCStatsCollector> Create(
       PeerConnectionInternal* pc,
       const Environment& env,
       int64_t cache_lifetime_us) {
-    return rtc::scoped_refptr<FakeRTCStatsCollector>(
-        new rtc::RefCountedObject<FakeRTCStatsCollector>(pc, env,
-                                                         cache_lifetime_us));
+    return scoped_refptr<FakeRTCStatsCollector>(
+        new RefCountedObject<FakeRTCStatsCollector>(pc, env,
+                                                    cache_lifetime_us));
   }
 
   // Since FakeRTCStatsCollector inherits twice from RefCountInterface, once via
@@ -3789,14 +3776,14 @@
 
   // RTCStatsCollectorCallback implementation.
   void OnStatsDelivered(
-      const rtc::scoped_refptr<const RTCStatsReport>& report) override {
+      const scoped_refptr<const RTCStatsReport>& report) override {
     EXPECT_TRUE(signaling_thread_->IsCurrent());
     MutexLock lock(&lock_);
     delivered_report_ = report;
   }
 
   void VerifyThreadUsageAndResultsMerging() {
-    GetStatsReport(rtc::scoped_refptr<RTCStatsCollectorCallback>(this));
+    GetStatsReport(scoped_refptr<RTCStatsCollectorCallback>(this));
     EXPECT_THAT(
         WaitUntil(
             [&] { return HasVerifiedResults(); }, ::testing::IsTrue(),
@@ -3865,15 +3852,15 @@
   Thread* const network_thread_;
 
   Mutex lock_;
-  rtc::scoped_refptr<const RTCStatsReport> delivered_report_;
+  scoped_refptr<const RTCStatsReport> delivered_report_;
   int produced_on_signaling_thread_ = 0;
   int produced_on_network_thread_ = 0;
 };
 
 TEST(RTCStatsCollectorTestWithFakeCollector, ThreadUsageAndResultsMerging) {
   AutoThread main_thread_;
-  auto pc = rtc::make_ref_counted<FakePeerConnectionForStats>();
-  rtc::scoped_refptr<FakeRTCStatsCollector> stats_collector(
+  auto pc = make_ref_counted<FakePeerConnectionForStats>();
+  scoped_refptr<FakeRTCStatsCollector> stats_collector(
       FakeRTCStatsCollector::Create(pc.get(), CreateEnvironment(),
                                     50 * kNumMicrosecsPerMillisec));
   stats_collector->VerifyThreadUsageAndResultsMerging();
diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc
index 8889ed0..7562f80 100644
--- a/pc/rtc_stats_integrationtest.cc
+++ b/pc/rtc_stats_integrationtest.cc
@@ -60,10 +60,10 @@
     RTC_CHECK(network_thread_->Start());
     RTC_CHECK(worker_thread_->Start());
 
-    caller_ = rtc::make_ref_counted<PeerConnectionTestWrapper>(
+    caller_ = make_ref_counted<PeerConnectionTestWrapper>(
         "caller", &virtual_socket_server_, network_thread_.get(),
         worker_thread_.get());
-    callee_ = rtc::make_ref_counted<PeerConnectionTestWrapper>(
+    callee_ = make_ref_counted<PeerConnectionTestWrapper>(
         "callee", &virtual_socket_server_, network_thread_.get(),
         worker_thread_.get());
   }
@@ -96,35 +96,34 @@
     callee_->WaitForCallEstablished();
   }
 
-  rtc::scoped_refptr<const RTCStatsReport> GetStatsFromCaller() {
+  scoped_refptr<const RTCStatsReport> GetStatsFromCaller() {
     return GetStats(caller_->pc());
   }
-  rtc::scoped_refptr<const RTCStatsReport> GetStatsFromCaller(
-      rtc::scoped_refptr<RtpSenderInterface> selector) {
+  scoped_refptr<const RTCStatsReport> GetStatsFromCaller(
+      scoped_refptr<RtpSenderInterface> selector) {
     return GetStats(caller_->pc(), selector);
   }
-  rtc::scoped_refptr<const RTCStatsReport> GetStatsFromCaller(
-      rtc::scoped_refptr<RtpReceiverInterface> selector) {
+  scoped_refptr<const RTCStatsReport> GetStatsFromCaller(
+      scoped_refptr<RtpReceiverInterface> selector) {
     return GetStats(caller_->pc(), selector);
   }
 
-  rtc::scoped_refptr<const RTCStatsReport> GetStatsFromCallee() {
+  scoped_refptr<const RTCStatsReport> GetStatsFromCallee() {
     return GetStats(callee_->pc());
   }
-  rtc::scoped_refptr<const RTCStatsReport> GetStatsFromCallee(
-      rtc::scoped_refptr<RtpSenderInterface> selector) {
+  scoped_refptr<const RTCStatsReport> GetStatsFromCallee(
+      scoped_refptr<RtpSenderInterface> selector) {
     return GetStats(callee_->pc(), selector);
   }
-  rtc::scoped_refptr<const RTCStatsReport> GetStatsFromCallee(
-      rtc::scoped_refptr<RtpReceiverInterface> selector) {
+  scoped_refptr<const RTCStatsReport> GetStatsFromCallee(
+      scoped_refptr<RtpReceiverInterface> selector) {
     return GetStats(callee_->pc(), selector);
   }
 
  protected:
-  static rtc::scoped_refptr<const RTCStatsReport> GetStats(
+  static scoped_refptr<const RTCStatsReport> GetStats(
       PeerConnectionInterface* pc) {
-    rtc::scoped_refptr<RTCStatsObtainer> stats_obtainer =
-        RTCStatsObtainer::Create();
+    scoped_refptr<RTCStatsObtainer> stats_obtainer = RTCStatsObtainer::Create();
     pc->GetStats(stats_obtainer.get());
     EXPECT_THAT(
         WaitUntil([&] { return stats_obtainer->report() != nullptr; },
@@ -135,11 +134,10 @@
   }
 
   template <typename T>
-  static rtc::scoped_refptr<const RTCStatsReport> GetStats(
+  static scoped_refptr<const RTCStatsReport> GetStats(
       PeerConnectionInterface* pc,
-      rtc::scoped_refptr<T> selector) {
-    rtc::scoped_refptr<RTCStatsObtainer> stats_obtainer =
-        RTCStatsObtainer::Create();
+      scoped_refptr<T> selector) {
+    scoped_refptr<RTCStatsObtainer> stats_obtainer = RTCStatsObtainer::Create();
     pc->GetStats(selector, stats_obtainer);
     EXPECT_THAT(
         WaitUntil([&] { return stats_obtainer->report() != nullptr; },
@@ -154,8 +152,8 @@
   VirtualSocketServer virtual_socket_server_;
   std::unique_ptr<Thread> network_thread_;
   std::unique_ptr<Thread> worker_thread_;
-  rtc::scoped_refptr<PeerConnectionTestWrapper> caller_;
-  rtc::scoped_refptr<PeerConnectionTestWrapper> callee_;
+  scoped_refptr<PeerConnectionTestWrapper> caller_;
+  scoped_refptr<PeerConnectionTestWrapper> callee_;
 };
 
 class RTCStatsVerifier {
@@ -286,7 +284,7 @@
     MarkAttributeTested(field, valid_reference);
   }
 
-  rtc::scoped_refptr<const RTCStatsReport> report_;
+  scoped_refptr<const RTCStatsReport> report_;
   const RTCStats* stats_;
   std::set<const char*> untested_attribute_names_;
   bool all_tests_successful_;
@@ -1014,21 +1012,21 @@
   }
 
  private:
-  rtc::scoped_refptr<const RTCStatsReport> report_;
+  scoped_refptr<const RTCStatsReport> report_;
 };
 
 #ifdef WEBRTC_HAVE_SCTP
 TEST_F(RTCStatsIntegrationTest, GetStatsFromCaller) {
   StartCall();
 
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCaller();
+  scoped_refptr<const RTCStatsReport> report = GetStatsFromCaller();
   RTCStatsReportVerifier(report.get()).VerifyReport({});
 }
 
 TEST_F(RTCStatsIntegrationTest, GetStatsFromCallee) {
   StartCall();
 
-  rtc::scoped_refptr<const RTCStatsReport> report;
+  scoped_refptr<const RTCStatsReport> report;
   // Wait for round trip time measurements to be defined.
   constexpr int kMaxWaitMs = 10000;
   auto GetStatsReportAndReturnTrueIfRttIsDefined = [&report, this] {
@@ -1053,7 +1051,7 @@
 TEST_F(RTCStatsIntegrationTest, GetStatsWithSenderSelector) {
   StartCall();
   ASSERT_FALSE(caller_->pc()->GetSenders().empty());
-  rtc::scoped_refptr<const RTCStatsReport> report =
+  scoped_refptr<const RTCStatsReport> report =
       GetStatsFromCaller(caller_->pc()->GetSenders()[0]);
   std::vector<const char*> allowed_missing_stats = {
       // TODO(hbos): Include RTC[Audio/Video]ReceiverStats when implemented.
@@ -1071,7 +1069,7 @@
   StartCall();
 
   ASSERT_FALSE(caller_->pc()->GetReceivers().empty());
-  rtc::scoped_refptr<const RTCStatsReport> report =
+  scoped_refptr<const RTCStatsReport> report =
       GetStatsFromCaller(caller_->pc()->GetReceivers()[0]);
   std::vector<const char*> allowed_missing_stats = {
       // TODO(hbos): Include RTC[Audio/Video]SenderStats when implemented.
@@ -1091,7 +1089,7 @@
   ASSERT_FALSE(callee_->pc()->GetSenders().empty());
   // The selector is invalid for the caller because it belongs to the callee.
   auto invalid_selector = callee_->pc()->GetSenders()[0];
-  rtc::scoped_refptr<const RTCStatsReport> report =
+  scoped_refptr<const RTCStatsReport> report =
       GetStatsFromCaller(invalid_selector);
   EXPECT_FALSE(report->size());
 }
@@ -1102,7 +1100,7 @@
   ASSERT_FALSE(callee_->pc()->GetReceivers().empty());
   // The selector is invalid for the caller because it belongs to the callee.
   auto invalid_selector = callee_->pc()->GetReceivers()[0];
-  rtc::scoped_refptr<const RTCStatsReport> report =
+  scoped_refptr<const RTCStatsReport> report =
       GetStatsFromCaller(invalid_selector);
   EXPECT_FALSE(report->size());
 }
@@ -1114,8 +1112,7 @@
        DISABLED_GetStatsWhileDestroyingPeerConnection) {
   StartCall();
 
-  rtc::scoped_refptr<RTCStatsObtainer> stats_obtainer =
-      RTCStatsObtainer::Create();
+  scoped_refptr<RTCStatsObtainer> stats_obtainer = RTCStatsObtainer::Create();
   caller_->pc()->GetStats(stats_obtainer.get());
   // This will destroy the peer connection.
   caller_ = nullptr;
@@ -1127,8 +1124,7 @@
 TEST_F(RTCStatsIntegrationTest, GetsStatsWhileClosingPeerConnection) {
   StartCall();
 
-  rtc::scoped_refptr<RTCStatsObtainer> stats_obtainer =
-      RTCStatsObtainer::Create();
+  scoped_refptr<RTCStatsObtainer> stats_obtainer = RTCStatsObtainer::Create();
   caller_->pc()->GetStats(stats_obtainer.get());
   caller_->pc()->Close();
 
@@ -1145,7 +1141,7 @@
 TEST_F(RTCStatsIntegrationTest, GetStatsReferencedIds) {
   StartCall();
 
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee();
+  scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee();
   for (const RTCStats& stats : *report) {
     // Find all references by looking at all string attributes with the "Id" or
     // "Ids" suffix.
@@ -1180,7 +1176,7 @@
 TEST_F(RTCStatsIntegrationTest, GetStatsContainsNoDuplicateAttributes) {
   StartCall();
 
-  rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee();
+  scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee();
   for (const RTCStats& stats : *report) {
     std::set<std::string> attribute_names;
     for (const auto& attribute : stats.Attributes()) {
diff --git a/pc/rtc_stats_traversal.cc b/pc/rtc_stats_traversal.cc
index de2475b..a28d606 100644
--- a/pc/rtc_stats_traversal.cc
+++ b/pc/rtc_stats_traversal.cc
@@ -54,10 +54,10 @@
 
 }  // namespace
 
-rtc::scoped_refptr<RTCStatsReport> TakeReferencedStats(
-    rtc::scoped_refptr<RTCStatsReport> report,
+scoped_refptr<RTCStatsReport> TakeReferencedStats(
+    scoped_refptr<RTCStatsReport> report,
     const std::vector<std::string>& ids) {
-  rtc::scoped_refptr<RTCStatsReport> result =
+  scoped_refptr<RTCStatsReport> result =
       RTCStatsReport::Create(report->timestamp());
   for (const auto& id : ids) {
     TraverseAndTakeVisitedStats(report.get(), result.get(), id);
diff --git a/pc/rtc_stats_traversal.h b/pc/rtc_stats_traversal.h
index ec4d51c..9316140 100644
--- a/pc/rtc_stats_traversal.h
+++ b/pc/rtc_stats_traversal.h
@@ -25,8 +25,8 @@
 // `ids`, returning them as a new stats report.
 // This is meant to be used to implement the stats selection algorithm.
 // https://w3c.github.io/webrtc-pc/#dfn-stats-selection-algorithm
-rtc::scoped_refptr<RTCStatsReport> TakeReferencedStats(
-    rtc::scoped_refptr<RTCStatsReport> report,
+scoped_refptr<RTCStatsReport> TakeReferencedStats(
+    scoped_refptr<RTCStatsReport> report,
     const std::vector<std::string>& ids);
 
 // Gets pointers to the string values of any members in `stats` that are used as
diff --git a/pc/rtc_stats_traversal_unittest.cc b/pc/rtc_stats_traversal_unittest.cc
index c8f106f..2964ead 100644
--- a/pc/rtc_stats_traversal_unittest.cc
+++ b/pc/rtc_stats_traversal_unittest.cc
@@ -74,8 +74,8 @@
   }
 
  protected:
-  rtc::scoped_refptr<RTCStatsReport> initial_report_;
-  rtc::scoped_refptr<RTCStatsReport> result_;
+  scoped_refptr<RTCStatsReport> initial_report_;
+  scoped_refptr<RTCStatsReport> result_;
   // Raw pointers to stats owned by the reports.
   RTCTransportStats* transport_;
   RTCIceCandidatePairStats* candidate_pair_;
diff --git a/pc/rtcp_mux_filter_unittest.cc b/pc/rtcp_mux_filter_unittest.cc
index 14586ab..d314b16 100644
--- a/pc/rtcp_mux_filter_unittest.cc
+++ b/pc/rtcp_mux_filter_unittest.cc
@@ -20,12 +20,12 @@
   EXPECT_FALSE(filter.IsProvisionallyActive());
   EXPECT_FALSE(filter.IsFullyActive());
   // After sent offer, demux should not be active.
-  filter.SetOffer(true, cricket::CS_LOCAL);
+  filter.SetOffer(true, webrtc::CS_LOCAL);
   EXPECT_FALSE(filter.IsActive());
   EXPECT_FALSE(filter.IsProvisionallyActive());
   EXPECT_FALSE(filter.IsFullyActive());
   // Remote accepted, filter is now active.
-  filter.SetAnswer(true, cricket::CS_REMOTE);
+  filter.SetAnswer(true, webrtc::CS_REMOTE);
   EXPECT_TRUE(filter.IsActive());
   EXPECT_FALSE(filter.IsProvisionallyActive());
   EXPECT_TRUE(filter.IsFullyActive());
@@ -34,21 +34,21 @@
 // Test that we can receive provisional answer and final answer.
 TEST(RtcpMuxFilterTest, ReceivePrAnswer) {
   webrtc::RtcpMuxFilter filter;
-  filter.SetOffer(true, cricket::CS_LOCAL);
+  filter.SetOffer(true, webrtc::CS_LOCAL);
   // Received provisional answer with mux enabled.
-  EXPECT_TRUE(filter.SetProvisionalAnswer(true, cricket::CS_REMOTE));
+  EXPECT_TRUE(filter.SetProvisionalAnswer(true, webrtc::CS_REMOTE));
   // We are now provisionally active since both sender and receiver support mux.
   EXPECT_TRUE(filter.IsActive());
   EXPECT_TRUE(filter.IsProvisionallyActive());
   EXPECT_FALSE(filter.IsFullyActive());
   // Received provisional answer with mux disabled.
-  EXPECT_TRUE(filter.SetProvisionalAnswer(false, cricket::CS_REMOTE));
+  EXPECT_TRUE(filter.SetProvisionalAnswer(false, webrtc::CS_REMOTE));
   // We are now inactive since the receiver doesn't support mux.
   EXPECT_FALSE(filter.IsActive());
   EXPECT_FALSE(filter.IsProvisionallyActive());
   EXPECT_FALSE(filter.IsFullyActive());
   // Received final answer with mux enabled.
-  EXPECT_TRUE(filter.SetAnswer(true, cricket::CS_REMOTE));
+  EXPECT_TRUE(filter.SetAnswer(true, webrtc::CS_REMOTE));
   EXPECT_TRUE(filter.IsActive());
   EXPECT_FALSE(filter.IsProvisionallyActive());
   EXPECT_TRUE(filter.IsFullyActive());
@@ -61,12 +61,12 @@
   EXPECT_FALSE(filter.IsProvisionallyActive());
   EXPECT_FALSE(filter.IsFullyActive());
   // After received offer, demux should not be active
-  filter.SetOffer(true, cricket::CS_REMOTE);
+  filter.SetOffer(true, webrtc::CS_REMOTE);
   EXPECT_FALSE(filter.IsActive());
   EXPECT_FALSE(filter.IsProvisionallyActive());
   EXPECT_FALSE(filter.IsFullyActive());
   // We accept, filter is now active
-  filter.SetAnswer(true, cricket::CS_LOCAL);
+  filter.SetAnswer(true, webrtc::CS_LOCAL);
   EXPECT_TRUE(filter.IsActive());
   EXPECT_FALSE(filter.IsProvisionallyActive());
   EXPECT_TRUE(filter.IsFullyActive());
@@ -75,19 +75,19 @@
 // Test that we can send provisional answer and final answer.
 TEST(RtcpMuxFilterTest, SendPrAnswer) {
   webrtc::RtcpMuxFilter filter;
-  filter.SetOffer(true, cricket::CS_REMOTE);
+  filter.SetOffer(true, webrtc::CS_REMOTE);
   // Send provisional answer with mux enabled.
-  EXPECT_TRUE(filter.SetProvisionalAnswer(true, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetProvisionalAnswer(true, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
   EXPECT_TRUE(filter.IsProvisionallyActive());
   EXPECT_FALSE(filter.IsFullyActive());
   // Received provisional answer with mux disabled.
-  EXPECT_TRUE(filter.SetProvisionalAnswer(false, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetProvisionalAnswer(false, webrtc::CS_LOCAL));
   EXPECT_FALSE(filter.IsActive());
   EXPECT_FALSE(filter.IsProvisionallyActive());
   EXPECT_FALSE(filter.IsFullyActive());
   // Send final answer with mux enabled.
-  EXPECT_TRUE(filter.SetAnswer(true, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetAnswer(true, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
   EXPECT_FALSE(filter.IsProvisionallyActive());
   EXPECT_TRUE(filter.IsFullyActive());
@@ -99,16 +99,16 @@
 TEST(RtcpMuxFilterTest, EnableFilterDuringUpdate) {
   webrtc::RtcpMuxFilter filter;
   EXPECT_FALSE(filter.IsActive());
-  EXPECT_TRUE(filter.SetOffer(false, cricket::CS_REMOTE));
-  EXPECT_TRUE(filter.SetAnswer(false, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetOffer(false, webrtc::CS_REMOTE));
+  EXPECT_TRUE(filter.SetAnswer(false, webrtc::CS_LOCAL));
   EXPECT_FALSE(filter.IsActive());
 
-  EXPECT_TRUE(filter.SetOffer(true, cricket::CS_REMOTE));
-  EXPECT_TRUE(filter.SetAnswer(true, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetOffer(true, webrtc::CS_REMOTE));
+  EXPECT_TRUE(filter.SetAnswer(true, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
 
-  EXPECT_FALSE(filter.SetOffer(false, cricket::CS_REMOTE));
-  EXPECT_FALSE(filter.SetAnswer(false, cricket::CS_LOCAL));
+  EXPECT_FALSE(filter.SetOffer(false, webrtc::CS_REMOTE));
+  EXPECT_FALSE(filter.SetAnswer(false, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
 }
 
@@ -116,15 +116,15 @@
 TEST(RtcpMuxFilterTest, SetOfferTwice) {
   webrtc::RtcpMuxFilter filter;
 
-  EXPECT_TRUE(filter.SetOffer(true, cricket::CS_REMOTE));
-  EXPECT_TRUE(filter.SetOffer(true, cricket::CS_REMOTE));
-  EXPECT_TRUE(filter.SetAnswer(true, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetOffer(true, webrtc::CS_REMOTE));
+  EXPECT_TRUE(filter.SetOffer(true, webrtc::CS_REMOTE));
+  EXPECT_TRUE(filter.SetAnswer(true, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
 
   webrtc::RtcpMuxFilter filter2;
-  EXPECT_TRUE(filter2.SetOffer(false, cricket::CS_LOCAL));
-  EXPECT_TRUE(filter2.SetOffer(false, cricket::CS_LOCAL));
-  EXPECT_TRUE(filter2.SetAnswer(false, cricket::CS_REMOTE));
+  EXPECT_TRUE(filter2.SetOffer(false, webrtc::CS_LOCAL));
+  EXPECT_TRUE(filter2.SetOffer(false, webrtc::CS_LOCAL));
+  EXPECT_TRUE(filter2.SetAnswer(false, webrtc::CS_REMOTE));
   EXPECT_FALSE(filter2.IsActive());
 }
 
@@ -132,12 +132,12 @@
 TEST(RtcpMuxFilterTest, EnableFilterTwiceDuringUpdate) {
   webrtc::RtcpMuxFilter filter;
 
-  EXPECT_TRUE(filter.SetOffer(true, cricket::CS_REMOTE));
-  EXPECT_TRUE(filter.SetAnswer(true, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetOffer(true, webrtc::CS_REMOTE));
+  EXPECT_TRUE(filter.SetAnswer(true, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
 
-  EXPECT_TRUE(filter.SetOffer(true, cricket::CS_REMOTE));
-  EXPECT_TRUE(filter.SetAnswer(true, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetOffer(true, webrtc::CS_REMOTE));
+  EXPECT_TRUE(filter.SetAnswer(true, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
 }
 
@@ -145,12 +145,12 @@
 TEST(RtcpMuxFilterTest, KeepFilterDisabledDuringUpdate) {
   webrtc::RtcpMuxFilter filter;
 
-  EXPECT_TRUE(filter.SetOffer(false, cricket::CS_REMOTE));
-  EXPECT_TRUE(filter.SetAnswer(false, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetOffer(false, webrtc::CS_REMOTE));
+  EXPECT_TRUE(filter.SetAnswer(false, webrtc::CS_LOCAL));
   EXPECT_FALSE(filter.IsActive());
 
-  EXPECT_TRUE(filter.SetOffer(false, cricket::CS_REMOTE));
-  EXPECT_TRUE(filter.SetAnswer(false, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetOffer(false, webrtc::CS_REMOTE));
+  EXPECT_TRUE(filter.SetAnswer(false, webrtc::CS_LOCAL));
   EXPECT_FALSE(filter.IsActive());
 }
 
@@ -161,33 +161,33 @@
   filter.SetActive();
   EXPECT_TRUE(filter.IsActive());
 
-  EXPECT_FALSE(filter.SetOffer(false, cricket::CS_LOCAL));
+  EXPECT_FALSE(filter.SetOffer(false, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
-  EXPECT_TRUE(filter.SetOffer(true, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetOffer(true, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
 
-  EXPECT_FALSE(filter.SetProvisionalAnswer(false, cricket::CS_REMOTE));
+  EXPECT_FALSE(filter.SetProvisionalAnswer(false, webrtc::CS_REMOTE));
   EXPECT_TRUE(filter.IsActive());
-  EXPECT_TRUE(filter.SetProvisionalAnswer(true, cricket::CS_REMOTE));
+  EXPECT_TRUE(filter.SetProvisionalAnswer(true, webrtc::CS_REMOTE));
   EXPECT_TRUE(filter.IsActive());
 
-  EXPECT_FALSE(filter.SetAnswer(false, cricket::CS_REMOTE));
+  EXPECT_FALSE(filter.SetAnswer(false, webrtc::CS_REMOTE));
   EXPECT_TRUE(filter.IsActive());
-  EXPECT_TRUE(filter.SetAnswer(true, cricket::CS_REMOTE));
+  EXPECT_TRUE(filter.SetAnswer(true, webrtc::CS_REMOTE));
   EXPECT_TRUE(filter.IsActive());
 
-  EXPECT_FALSE(filter.SetOffer(false, cricket::CS_REMOTE));
+  EXPECT_FALSE(filter.SetOffer(false, webrtc::CS_REMOTE));
   EXPECT_TRUE(filter.IsActive());
-  EXPECT_TRUE(filter.SetOffer(true, cricket::CS_REMOTE));
+  EXPECT_TRUE(filter.SetOffer(true, webrtc::CS_REMOTE));
   EXPECT_TRUE(filter.IsActive());
 
-  EXPECT_FALSE(filter.SetProvisionalAnswer(false, cricket::CS_LOCAL));
+  EXPECT_FALSE(filter.SetProvisionalAnswer(false, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
-  EXPECT_TRUE(filter.SetProvisionalAnswer(true, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetProvisionalAnswer(true, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
 
-  EXPECT_FALSE(filter.SetAnswer(false, cricket::CS_LOCAL));
+  EXPECT_FALSE(filter.SetAnswer(false, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
-  EXPECT_TRUE(filter.SetAnswer(true, cricket::CS_LOCAL));
+  EXPECT_TRUE(filter.SetAnswer(true, webrtc::CS_LOCAL));
   EXPECT_TRUE(filter.IsActive());
 }
diff --git a/pc/rtp_parameters_conversion.cc b/pc/rtp_parameters_conversion.cc
index 72b03b2..75a69bc 100644
--- a/pc/rtp_parameters_conversion.cc
+++ b/pc/rtp_parameters_conversion.cc
@@ -105,7 +105,7 @@
 
 RtpCapabilities ToRtpCapabilities(
     const std::vector<Codec>& cricket_codecs,
-    const cricket::RtpHeaderExtensions& cricket_extensions) {
+    const RtpHeaderExtensions& cricket_extensions) {
   RtpCapabilities capabilities;
   bool have_red = false;
   bool have_ulpfec = false;
diff --git a/pc/rtp_parameters_conversion.h b/pc/rtp_parameters_conversion.h
index 1247b01..e32bc2e 100644
--- a/pc/rtp_parameters_conversion.h
+++ b/pc/rtp_parameters_conversion.h
@@ -23,7 +23,7 @@
 namespace webrtc {
 
 //*****************************************************************************
-// Functions for converting from old cricket:: structures to new webrtc::
+// Functions for converting from old webrtc:: structures to new webrtc::
 // structures. These are permissive with regards to
 // input validation; it's assumed that any necessary validation already
 // occurred.
@@ -41,7 +41,7 @@
 
 RtpCapabilities ToRtpCapabilities(
     const std::vector<Codec>& cricket_codecs,
-    const cricket::RtpHeaderExtensions& cricket_extensions);
+    const RtpHeaderExtensions& cricket_extensions);
 
 }  // namespace webrtc
 
diff --git a/pc/rtp_parameters_conversion_unittest.cc b/pc/rtp_parameters_conversion_unittest.cc
index 112d12e..407c535 100644
--- a/pc/rtp_parameters_conversion_unittest.cc
+++ b/pc/rtp_parameters_conversion_unittest.cc
@@ -165,15 +165,14 @@
   EXPECT_EQ(3, capabilities.header_extensions[1].preferred_id);
   EXPECT_EQ(0u, capabilities.fec.size());
 
-  capabilities = ToRtpCapabilities({vp8, red, red2, ulpfec, rtx},
-                                   cricket::RtpHeaderExtensions());
+  capabilities =
+      ToRtpCapabilities({vp8, red, red2, ulpfec, rtx}, RtpHeaderExtensions());
   EXPECT_EQ(4u, capabilities.codecs.size());
   EXPECT_THAT(
       capabilities.fec,
       UnorderedElementsAre(FecMechanism::RED, FecMechanism::RED_AND_ULPFEC));
 
-  capabilities =
-      ToRtpCapabilities({vp8, red, flexfec}, cricket::RtpHeaderExtensions());
+  capabilities = ToRtpCapabilities({vp8, red, flexfec}, RtpHeaderExtensions());
   EXPECT_EQ(3u, capabilities.codecs.size());
   EXPECT_THAT(capabilities.fec,
               UnorderedElementsAre(FecMechanism::RED, FecMechanism::FLEXFEC));
diff --git a/pc/rtp_receiver.cc b/pc/rtp_receiver.cc
index 28187f2..e09c893 100644
--- a/pc/rtp_receiver.cc
+++ b/pc/rtp_receiver.cc
@@ -34,10 +34,9 @@
   return ++g_unique_id;
 }
 
-std::vector<rtc::scoped_refptr<MediaStreamInterface>>
+std::vector<scoped_refptr<MediaStreamInterface>>
 RtpReceiverInternal::CreateStreamsFromIds(std::vector<std::string> stream_ids) {
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams(
-      stream_ids.size());
+  std::vector<scoped_refptr<MediaStreamInterface>> streams(stream_ids.size());
   for (size_t i = 0; i < stream_ids.size(); ++i) {
     streams[i] = MediaStreamProxy::Create(
         Thread::Current(), MediaStream::Create(std::move(stream_ids[i])));
diff --git a/pc/rtp_receiver.h b/pc/rtp_receiver.h
index 9b145f0..db3ba3e 100644
--- a/pc/rtp_receiver.h
+++ b/pc/rtp_receiver.h
@@ -10,7 +10,7 @@
 
 // This file contains classes that implement RtpReceiverInterface.
 // An RtpReceiver associates a MediaStreamTrackInterface with an underlying
-// transport (provided by cricket::VoiceChannel/cricket::VideoChannel)
+// transport (provided by webrtc::VoiceChannel/webrtc::VideoChannel)
 
 #ifndef PC_RTP_RECEIVER_H_
 #define PC_RTP_RECEIVER_H_
@@ -55,7 +55,7 @@
   virtual void SetupUnsignaledMediaChannel() = 0;
 
   virtual void set_transport(
-      rtc::scoped_refptr<DtlsTransportInterface> dtls_transport) = 0;
+      scoped_refptr<DtlsTransportInterface> dtls_transport) = 0;
   // This SSRC is used as an identifier for the receiver between the API layer
   // and the WebRtcVideoEngine, WebRtcVoiceEngine layer.
   virtual std::optional<uint32_t> ssrc() const = 0;
@@ -72,7 +72,7 @@
   // set_stream_ids() as soon as downstream projects are no longer dependent on
   // stream objects.
   virtual void SetStreams(
-      const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams) = 0;
+      const std::vector<scoped_refptr<MediaStreamInterface>>& streams) = 0;
 
   // Returns an ID that changes if the attached track changes, but
   // otherwise remains constant. Used to generate IDs for stats.
@@ -82,8 +82,8 @@
  protected:
   static int GenerateUniqueId();
 
-  static std::vector<rtc::scoped_refptr<MediaStreamInterface>>
-  CreateStreamsFromIds(std::vector<std::string> stream_ids);
+  static std::vector<scoped_refptr<MediaStreamInterface>> CreateStreamsFromIds(
+      std::vector<std::string> stream_ids);
 };
 
 }  // namespace webrtc
diff --git a/pc/rtp_receiver_proxy.h b/pc/rtp_receiver_proxy.h
index 55c8d9a..223b307 100644
--- a/pc/rtp_receiver_proxy.h
+++ b/pc/rtp_receiver_proxy.h
@@ -33,11 +33,10 @@
 // an implementation detail.
 BEGIN_PROXY_MAP(RtpReceiver)
 PROXY_PRIMARY_THREAD_DESTRUCTOR()
-BYPASS_PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track)
-PROXY_CONSTMETHOD0(rtc::scoped_refptr<DtlsTransportInterface>, dtls_transport)
+BYPASS_PROXY_CONSTMETHOD0(scoped_refptr<MediaStreamTrackInterface>, track)
+PROXY_CONSTMETHOD0(scoped_refptr<DtlsTransportInterface>, dtls_transport)
 PROXY_CONSTMETHOD0(std::vector<std::string>, stream_ids)
-PROXY_CONSTMETHOD0(std::vector<rtc::scoped_refptr<MediaStreamInterface>>,
-                   streams)
+PROXY_CONSTMETHOD0(std::vector<scoped_refptr<MediaStreamInterface>>, streams)
 BYPASS_PROXY_CONSTMETHOD0(webrtc::MediaType, media_type)
 BYPASS_PROXY_CONSTMETHOD0(std::string, id)
 PROXY_SECONDARY_CONSTMETHOD0(RtpParameters, GetParameters)
@@ -49,13 +48,13 @@
 // TODO(bugs.webrtc.org/12772): Remove.
 PROXY_SECONDARY_METHOD1(void,
                         SetFrameDecryptor,
-                        rtc::scoped_refptr<FrameDecryptorInterface>)
+                        scoped_refptr<FrameDecryptorInterface>)
 // TODO(bugs.webrtc.org/12772): Remove.
-PROXY_SECONDARY_CONSTMETHOD0(rtc::scoped_refptr<FrameDecryptorInterface>,
+PROXY_SECONDARY_CONSTMETHOD0(scoped_refptr<FrameDecryptorInterface>,
                              GetFrameDecryptor)
 PROXY_SECONDARY_METHOD1(void,
                         SetFrameTransformer,
-                        rtc::scoped_refptr<FrameTransformerInterface>)
+                        scoped_refptr<FrameTransformerInterface>)
 END_PROXY_MAP(RtpReceiver)
 
 }  // namespace webrtc
diff --git a/pc/rtp_sender.cc b/pc/rtp_sender.cc
index 22e4c23..31bbba0 100644
--- a/pc/rtp_sender.cc
+++ b/pc/rtp_sender.cc
@@ -184,7 +184,7 @@
 }
 
 void RtpSenderBase::SetFrameEncryptor(
-    rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor) {
+    scoped_refptr<FrameEncryptorInterface> frame_encryptor) {
   RTC_DCHECK_RUN_ON(signaling_thread_);
   frame_encryptor_ = std::move(frame_encryptor);
   // Special Case: Set the frame encryptor to any value on any existing channel.
@@ -482,7 +482,7 @@
   // Attach to new track.
   bool prev_can_send_track = can_send_track();
   // Keep a reference to the old track to keep it alive until we call SetSend.
-  rtc::scoped_refptr<MediaStreamTrackInterface> old_track = track_;
+  scoped_refptr<MediaStreamTrackInterface> old_track = track_;
   track_ = track;
   if (track_) {
     track_->RegisterObserver(this);
@@ -629,7 +629,7 @@
 }
 
 void RtpSenderBase::SetFrameTransformer(
-    rtc::scoped_refptr<FrameTransformerInterface> frame_transformer) {
+    scoped_refptr<FrameTransformerInterface> frame_transformer) {
   RTC_DCHECK_RUN_ON(signaling_thread_);
   frame_transformer_ = std::move(frame_transformer);
   if (media_channel_ && ssrc_ && !stopped_) {
@@ -671,14 +671,14 @@
   sink_ = sink;
 }
 
-rtc::scoped_refptr<AudioRtpSender> AudioRtpSender::Create(
+scoped_refptr<AudioRtpSender> AudioRtpSender::Create(
     const webrtc::Environment& env,
     Thread* worker_thread,
     const std::string& id,
     LegacyStatsCollectorInterface* stats,
     SetStreamsObserver* set_streams_observer) {
-  return rtc::make_ref_counted<AudioRtpSender>(env, worker_thread, id, stats,
-                                               set_streams_observer);
+  return make_ref_counted<AudioRtpSender>(env, worker_thread, id, stats,
+                                          set_streams_observer);
 }
 
 AudioRtpSender::AudioRtpSender(const webrtc::Environment& env,
@@ -765,7 +765,7 @@
   }
 }
 
-rtc::scoped_refptr<DtmfSenderInterface> AudioRtpSender::GetDtmfSender() const {
+scoped_refptr<DtmfSenderInterface> AudioRtpSender::GetDtmfSender() const {
   RTC_DCHECK_RUN_ON(signaling_thread_);
   return dtmf_sender_proxy_;
 }
@@ -826,13 +826,13 @@
   }
 }
 
-rtc::scoped_refptr<VideoRtpSender> VideoRtpSender::Create(
+scoped_refptr<VideoRtpSender> VideoRtpSender::Create(
     const Environment& env,
     Thread* worker_thread,
     const std::string& id,
     SetStreamsObserver* set_streams_observer) {
-  return rtc::make_ref_counted<VideoRtpSender>(env, worker_thread, id,
-                                               set_streams_observer);
+  return make_ref_counted<VideoRtpSender>(env, worker_thread, id,
+                                          set_streams_observer);
 }
 
 VideoRtpSender::VideoRtpSender(const Environment& env,
@@ -864,7 +864,7 @@
   cached_track_content_hint_ = video_track()->content_hint();
 }
 
-rtc::scoped_refptr<DtmfSenderInterface> VideoRtpSender::GetDtmfSender() const {
+scoped_refptr<DtmfSenderInterface> VideoRtpSender::GetDtmfSender() const {
   RTC_DCHECK_RUN_ON(signaling_thread_);
   RTC_DLOG(LS_ERROR) << "Tried to get DTMF sender from video sender.";
   return nullptr;
diff --git a/pc/rtp_sender.h b/pc/rtp_sender.h
index 2d61741..ef7310f 100644
--- a/pc/rtp_sender.h
+++ b/pc/rtp_sender.h
@@ -68,7 +68,7 @@
   virtual void set_init_send_encodings(
       const std::vector<RtpEncodingParameters>& init_send_encodings) = 0;
   virtual void set_transport(
-      rtc::scoped_refptr<DtlsTransportInterface> dtls_transport) = 0;
+      scoped_refptr<DtlsTransportInterface> dtls_transport) = 0;
 
   virtual void Stop() = 0;
 
@@ -125,7 +125,7 @@
   void SetMediaChannel(MediaSendChannelInterface* media_channel) override;
 
   bool SetTrack(MediaStreamTrackInterface* track) override;
-  rtc::scoped_refptr<MediaStreamTrackInterface> track() const override {
+  scoped_refptr<MediaStreamTrackInterface> track() const override {
     // This method is currently called from the worker thread by
     // RTCStatsCollector::PrepareTransceiverStatsInfosAndCallStats_s_w_n.
     // RTC_DCHECK_RUN_ON(signaling_thread_);
@@ -182,19 +182,18 @@
   }
 
   void set_transport(
-      rtc::scoped_refptr<DtlsTransportInterface> dtls_transport) override {
+      scoped_refptr<DtlsTransportInterface> dtls_transport) override {
     dtls_transport_ = dtls_transport;
   }
-  rtc::scoped_refptr<DtlsTransportInterface> dtls_transport() const override {
+  scoped_refptr<DtlsTransportInterface> dtls_transport() const override {
     RTC_DCHECK_RUN_ON(signaling_thread_);
     return dtls_transport_;
   }
 
   void SetFrameEncryptor(
-      rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor) override;
+      scoped_refptr<FrameEncryptorInterface> frame_encryptor) override;
 
-  rtc::scoped_refptr<FrameEncryptorInterface> GetFrameEncryptor()
-      const override {
+  scoped_refptr<FrameEncryptorInterface> GetFrameEncryptor() const override {
     return frame_encryptor_;
   }
 
@@ -210,7 +209,7 @@
   RTCError DisableEncodingLayers(const std::vector<std::string>& rid) override;
 
   void SetFrameTransformer(
-      rtc::scoped_refptr<FrameTransformerInterface> frame_transformer) override;
+      scoped_refptr<FrameTransformerInterface> frame_transformer) override;
 
   void SetEncoderSelector(
       std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface>
@@ -276,10 +275,10 @@
   // remove since the upstream code may already be performing several operations
   // on the worker thread.
   MediaSendChannelInterface* media_channel_ = nullptr;
-  rtc::scoped_refptr<MediaStreamTrackInterface> track_;
+  scoped_refptr<MediaStreamTrackInterface> track_;
 
-  rtc::scoped_refptr<DtlsTransportInterface> dtls_transport_;
-  rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor_;
+  scoped_refptr<DtlsTransportInterface> dtls_transport_;
+  scoped_refptr<FrameEncryptorInterface> frame_encryptor_;
   // `last_transaction_id_` is used to verify that `SetParameters` is receiving
   // the parameters object that was last returned from `GetParameters`.
   // As such, it is used for internal verification and is not observable by the
@@ -292,7 +291,7 @@
   RtpSenderObserverInterface* observer_ = nullptr;
   bool sent_first_packet_ = false;
 
-  rtc::scoped_refptr<FrameTransformerInterface> frame_transformer_;
+  scoped_refptr<FrameTransformerInterface> frame_transformer_;
   std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface>
       encoder_selector_;
 
@@ -330,7 +329,7 @@
   // AudioSinkInterface implementation.
   int NumPreferredChannels() const override { return num_preferred_channels_; }
 
-  // cricket::AudioSource implementation.
+  // webrtc::AudioSource implementation.
   void SetSink(AudioSource::Sink* sink) override;
 
   AudioSource::Sink* sink_;
@@ -348,7 +347,7 @@
   // If `set_streams_observer` is not null, it is invoked when SetStreams()
   // is called. `set_streams_observer` is not owned by this object. If not
   // null, it must be valid at least until this sender becomes stopped.
-  static rtc::scoped_refptr<AudioRtpSender> Create(
+  static scoped_refptr<AudioRtpSender> Create(
       const Environment& env,
       Thread* worker_thread,
       const std::string& id,
@@ -370,7 +369,7 @@
     return MediaStreamTrackInterface::kAudioKind;
   }
 
-  rtc::scoped_refptr<DtmfSenderInterface> GetDtmfSender() const override;
+  scoped_refptr<DtmfSenderInterface> GetDtmfSender() const override;
   RTCError GenerateKeyFrame(const std::vector<std::string>& rids) override;
 
  protected:
@@ -393,18 +392,18 @@
   VoiceMediaSendChannelInterface* voice_media_channel() {
     return media_channel_->AsVoiceSendChannel();
   }
-  rtc::scoped_refptr<AudioTrackInterface> audio_track() const {
-    return rtc::scoped_refptr<AudioTrackInterface>(
+  scoped_refptr<AudioTrackInterface> audio_track() const {
+    return scoped_refptr<AudioTrackInterface>(
         static_cast<AudioTrackInterface*>(track_.get()));
   }
 
   LegacyStatsCollectorInterface* legacy_stats_ = nullptr;
-  rtc::scoped_refptr<DtmfSender> dtmf_sender_;
-  rtc::scoped_refptr<DtmfSenderInterface> dtmf_sender_proxy_;
+  scoped_refptr<DtmfSender> dtmf_sender_;
+  scoped_refptr<DtmfSenderInterface> dtmf_sender_proxy_;
   bool cached_track_enabled_ = false;
 
   // Used to pass the data callback from the `track_` to the other end of
-  // cricket::AudioSource.
+  // webrtc::AudioSource.
   std::unique_ptr<LocalAudioSinkAdapter> sink_adapter_;
 };
 
@@ -415,7 +414,7 @@
   // If `set_streams_observer` is not null, it is invoked when SetStreams()
   // is called. `set_streams_observer` is not owned by this object. If not
   // null, it must be valid at least until this sender becomes stopped.
-  static rtc::scoped_refptr<VideoRtpSender> Create(
+  static scoped_refptr<VideoRtpSender> Create(
       const Environment& env,
       Thread* worker_thread,
       const std::string& id,
@@ -432,7 +431,7 @@
     return MediaStreamTrackInterface::kVideoKind;
   }
 
-  rtc::scoped_refptr<DtmfSenderInterface> GetDtmfSender() const override;
+  scoped_refptr<DtmfSenderInterface> GetDtmfSender() const override;
   RTCError GenerateKeyFrame(const std::vector<std::string>& rids) override;
 
  protected:
@@ -451,8 +450,8 @@
   VideoMediaSendChannelInterface* video_media_channel() {
     return media_channel_->AsVideoSendChannel();
   }
-  rtc::scoped_refptr<VideoTrackInterface> video_track() const {
-    return rtc::scoped_refptr<VideoTrackInterface>(
+  scoped_refptr<VideoTrackInterface> video_track() const {
+    return scoped_refptr<VideoTrackInterface>(
         static_cast<VideoTrackInterface*>(track_.get()));
   }
 
diff --git a/pc/rtp_sender_proxy.h b/pc/rtp_sender_proxy.h
index ec63186..ec2f8a9 100644
--- a/pc/rtp_sender_proxy.h
+++ b/pc/rtp_sender_proxy.h
@@ -26,8 +26,8 @@
 BEGIN_PRIMARY_PROXY_MAP(RtpSender)
 PROXY_PRIMARY_THREAD_DESTRUCTOR()
 PROXY_METHOD1(bool, SetTrack, MediaStreamTrackInterface*)
-PROXY_CONSTMETHOD0(rtc::scoped_refptr<MediaStreamTrackInterface>, track)
-PROXY_CONSTMETHOD0(rtc::scoped_refptr<DtlsTransportInterface>, dtls_transport)
+PROXY_CONSTMETHOD0(scoped_refptr<MediaStreamTrackInterface>, track)
+PROXY_CONSTMETHOD0(scoped_refptr<DtlsTransportInterface>, dtls_transport)
 PROXY_CONSTMETHOD0(uint32_t, ssrc)
 BYPASS_PROXY_CONSTMETHOD0(webrtc::MediaType, media_type)
 BYPASS_PROXY_CONSTMETHOD0(std::string, id)
@@ -39,17 +39,14 @@
               SetParametersAsync,
               const RtpParameters&,
               SetParametersCallback)
-PROXY_CONSTMETHOD0(rtc::scoped_refptr<DtmfSenderInterface>, GetDtmfSender)
-PROXY_METHOD1(void,
-              SetFrameEncryptor,
-              rtc::scoped_refptr<FrameEncryptorInterface>)
+PROXY_CONSTMETHOD0(scoped_refptr<DtmfSenderInterface>, GetDtmfSender)
+PROXY_METHOD1(void, SetFrameEncryptor, scoped_refptr<FrameEncryptorInterface>)
 PROXY_METHOD1(void, SetObserver, RtpSenderObserverInterface*)
-PROXY_CONSTMETHOD0(rtc::scoped_refptr<FrameEncryptorInterface>,
-                   GetFrameEncryptor)
+PROXY_CONSTMETHOD0(scoped_refptr<FrameEncryptorInterface>, GetFrameEncryptor)
 PROXY_METHOD1(void, SetStreams, const std::vector<std::string>&)
 PROXY_METHOD1(void,
               SetFrameTransformer,
-              rtc::scoped_refptr<FrameTransformerInterface>)
+              scoped_refptr<FrameTransformerInterface>)
 PROXY_METHOD1(void,
               SetEncoderSelector,
               std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface>)
diff --git a/pc/rtp_sender_receiver_unittest.cc b/pc/rtp_sender_receiver_unittest.cc
index 46c0c4c..4c5722b 100644
--- a/pc/rtp_sender_receiver_unittest.cc
+++ b/pc/rtp_sender_receiver_unittest.cc
@@ -178,7 +178,7 @@
   void AddVideoTrack() { AddVideoTrack(false); }
 
   void AddVideoTrack(bool is_screencast) {
-    rtc::scoped_refptr<VideoTrackSourceInterface> source(
+    scoped_refptr<VideoTrackSourceInterface> source(
         FakeVideoTrackSource::Create(is_screencast));
     video_track_ = VideoTrack::Create(kVideoTrackId, source, Thread::Current());
     EXPECT_TRUE(local_stream_->AddTrack(video_track_));
@@ -186,8 +186,7 @@
 
   void CreateAudioRtpSender() { CreateAudioRtpSender(nullptr); }
 
-  void CreateAudioRtpSender(
-      const rtc::scoped_refptr<LocalAudioSource>& source) {
+  void CreateAudioRtpSender(const scoped_refptr<LocalAudioSource>& source) {
     audio_track_ = AudioTrack::Create(kAudioTrackId, source);
     EXPECT_TRUE(local_stream_->AddTrack(audio_track_));
     std::unique_ptr<MockSetStreamsObserver> set_streams_observer =
@@ -279,8 +278,8 @@
   }
 
   void CreateAudioRtpReceiver(
-      std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams = {}) {
-    audio_rtp_receiver_ = rtc::make_ref_counted<AudioRtpReceiver>(
+      std::vector<scoped_refptr<MediaStreamInterface>> streams = {}) {
+    audio_rtp_receiver_ = make_ref_counted<AudioRtpReceiver>(
         Thread::Current(), kAudioTrackId, streams,
         /*is_unified_plan=*/true);
     audio_rtp_receiver_->SetMediaChannel(voice_media_receive_channel());
@@ -290,8 +289,8 @@
   }
 
   void CreateVideoRtpReceiver(
-      std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams = {}) {
-    video_rtp_receiver_ = rtc::make_ref_counted<VideoRtpReceiver>(
+      std::vector<scoped_refptr<MediaStreamInterface>> streams = {}) {
+    video_rtp_receiver_ = make_ref_counted<VideoRtpReceiver>(
         Thread::Current(), kVideoTrackId, streams);
     video_rtp_receiver_->SetMediaChannel(video_media_receive_channel());
     video_rtp_receiver_->SetupMediaChannel(kVideoSsrc);
@@ -300,7 +299,7 @@
   }
 
   void CreateVideoRtpReceiverWithSimulcast(
-      std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams = {},
+      std::vector<scoped_refptr<MediaStreamInterface>> streams = {},
       int num_layers = kVideoSimulcastLayerCount) {
     std::vector<uint32_t> ssrcs;
     ssrcs.reserve(num_layers);
@@ -310,7 +309,7 @@
     video_media_receive_channel_->AddRecvStream(stream_params);
     uint32_t primary_ssrc = stream_params.first_ssrc();
 
-    video_rtp_receiver_ = rtc::make_ref_counted<VideoRtpReceiver>(
+    video_rtp_receiver_ = make_ref_counted<VideoRtpReceiver>(
         Thread::Current(), kVideoTrackId, streams);
     video_rtp_receiver_->SetMediaChannel(video_media_receive_channel());
     video_rtp_receiver_->SetupMediaChannel(primary_ssrc);
@@ -526,13 +525,13 @@
       voice_media_receive_channel_;
   std::unique_ptr<VideoMediaReceiveChannelInterface>
       video_media_receive_channel_;
-  rtc::scoped_refptr<AudioRtpSender> audio_rtp_sender_;
-  rtc::scoped_refptr<VideoRtpSender> video_rtp_sender_;
-  rtc::scoped_refptr<AudioRtpReceiver> audio_rtp_receiver_;
-  rtc::scoped_refptr<VideoRtpReceiver> video_rtp_receiver_;
-  rtc::scoped_refptr<MediaStreamInterface> local_stream_;
-  rtc::scoped_refptr<VideoTrackInterface> video_track_;
-  rtc::scoped_refptr<AudioTrackInterface> audio_track_;
+  scoped_refptr<AudioRtpSender> audio_rtp_sender_;
+  scoped_refptr<VideoRtpSender> video_rtp_sender_;
+  scoped_refptr<AudioRtpReceiver> audio_rtp_receiver_;
+  scoped_refptr<VideoRtpReceiver> video_rtp_receiver_;
+  scoped_refptr<MediaStreamInterface> local_stream_;
+  scoped_refptr<VideoTrackInterface> video_track_;
+  scoped_refptr<AudioTrackInterface> audio_track_;
 };
 
 // Test that `voice_channel_` is updated when an audio track is associated
@@ -723,7 +722,7 @@
 // doesn't have both a track and SSRC.
 TEST_F(RtpSenderReceiverTest, AudioSenderWithoutTrackAndSsrc) {
   CreateAudioRtpSenderWithNoTrack();
-  rtc::scoped_refptr<AudioTrackInterface> track =
+  scoped_refptr<AudioTrackInterface> track =
       AudioTrack::Create(kAudioTrackId, nullptr);
 
   // Track but no SSRC.
@@ -755,7 +754,7 @@
 // has a track and SSRC, when the SSRC is set first.
 TEST_F(RtpSenderReceiverTest, AudioSenderEarlyWarmupSsrcThenTrack) {
   CreateAudioRtpSenderWithNoTrack();
-  rtc::scoped_refptr<AudioTrackInterface> track =
+  scoped_refptr<AudioTrackInterface> track =
       AudioTrack::Create(kAudioTrackId, nullptr);
   audio_rtp_sender_->SetSsrc(kAudioSsrc);
   audio_rtp_sender_->SetTrack(track.get());
@@ -768,7 +767,7 @@
 // has a track and SSRC, when the SSRC is set last.
 TEST_F(RtpSenderReceiverTest, AudioSenderEarlyWarmupTrackThenSsrc) {
   CreateAudioRtpSenderWithNoTrack();
-  rtc::scoped_refptr<AudioTrackInterface> track =
+  scoped_refptr<AudioTrackInterface> track =
       AudioTrack::Create(kAudioTrackId, nullptr);
   audio_rtp_sender_->SetTrack(track.get());
   audio_rtp_sender_->SetSsrc(kAudioSsrc);
@@ -1788,7 +1787,7 @@
 // Validate that the default FrameEncryptor setting is nullptr.
 TEST_F(RtpSenderReceiverTest, AudioSenderCanSetFrameEncryptor) {
   CreateAudioRtpSender();
-  rtc::scoped_refptr<FrameEncryptorInterface> fake_frame_encryptor(
+  scoped_refptr<FrameEncryptorInterface> fake_frame_encryptor(
       new FakeFrameEncryptor());
   EXPECT_EQ(nullptr, audio_rtp_sender_->GetFrameEncryptor());
   audio_rtp_sender_->SetFrameEncryptor(fake_frame_encryptor);
@@ -1800,7 +1799,7 @@
 // nothing.
 TEST_F(RtpSenderReceiverTest, AudioSenderCannotSetFrameEncryptorAfterStop) {
   CreateAudioRtpSender();
-  rtc::scoped_refptr<FrameEncryptorInterface> fake_frame_encryptor(
+  scoped_refptr<FrameEncryptorInterface> fake_frame_encryptor(
       new FakeFrameEncryptor());
   EXPECT_EQ(nullptr, audio_rtp_sender_->GetFrameEncryptor());
   audio_rtp_sender_->Stop();
@@ -1811,8 +1810,8 @@
 // Validate that the default FrameEncryptor setting is nullptr.
 TEST_F(RtpSenderReceiverTest, AudioReceiverCanSetFrameDecryptor) {
   CreateAudioRtpReceiver();
-  rtc::scoped_refptr<FrameDecryptorInterface> fake_frame_decryptor(
-      rtc::make_ref_counted<FakeFrameDecryptor>());
+  scoped_refptr<FrameDecryptorInterface> fake_frame_decryptor(
+      make_ref_counted<FakeFrameDecryptor>());
   EXPECT_EQ(nullptr, audio_rtp_receiver_->GetFrameDecryptor());
   audio_rtp_receiver_->SetFrameDecryptor(fake_frame_decryptor);
   EXPECT_EQ(fake_frame_decryptor.get(),
@@ -1823,8 +1822,8 @@
 // Validate that the default FrameEncryptor setting is nullptr.
 TEST_F(RtpSenderReceiverTest, AudioReceiverCannotSetFrameDecryptorAfterStop) {
   CreateAudioRtpReceiver();
-  rtc::scoped_refptr<FrameDecryptorInterface> fake_frame_decryptor(
-      rtc::make_ref_counted<FakeFrameDecryptor>());
+  scoped_refptr<FrameDecryptorInterface> fake_frame_decryptor(
+      make_ref_counted<FakeFrameDecryptor>());
   EXPECT_EQ(nullptr, audio_rtp_receiver_->GetFrameDecryptor());
   audio_rtp_receiver_->SetMediaChannel(nullptr);
   audio_rtp_receiver_->SetFrameDecryptor(fake_frame_decryptor);
@@ -1835,7 +1834,7 @@
 // Validate that the default FrameEncryptor setting is nullptr.
 TEST_F(RtpSenderReceiverTest, VideoSenderCanSetFrameEncryptor) {
   CreateVideoRtpSender();
-  rtc::scoped_refptr<FrameEncryptorInterface> fake_frame_encryptor(
+  scoped_refptr<FrameEncryptorInterface> fake_frame_encryptor(
       new FakeFrameEncryptor());
   EXPECT_EQ(nullptr, video_rtp_sender_->GetFrameEncryptor());
   video_rtp_sender_->SetFrameEncryptor(fake_frame_encryptor);
@@ -1847,7 +1846,7 @@
 // nothing.
 TEST_F(RtpSenderReceiverTest, VideoSenderCannotSetFrameEncryptorAfterStop) {
   CreateVideoRtpSender();
-  rtc::scoped_refptr<FrameEncryptorInterface> fake_frame_encryptor(
+  scoped_refptr<FrameEncryptorInterface> fake_frame_encryptor(
       new FakeFrameEncryptor());
   EXPECT_EQ(nullptr, video_rtp_sender_->GetFrameEncryptor());
   video_rtp_sender_->Stop();
@@ -1858,8 +1857,8 @@
 // Validate that the default FrameEncryptor setting is nullptr.
 TEST_F(RtpSenderReceiverTest, VideoReceiverCanSetFrameDecryptor) {
   CreateVideoRtpReceiver();
-  rtc::scoped_refptr<FrameDecryptorInterface> fake_frame_decryptor(
-      rtc::make_ref_counted<FakeFrameDecryptor>());
+  scoped_refptr<FrameDecryptorInterface> fake_frame_decryptor(
+      make_ref_counted<FakeFrameDecryptor>());
   EXPECT_EQ(nullptr, video_rtp_receiver_->GetFrameDecryptor());
   video_rtp_receiver_->SetFrameDecryptor(fake_frame_decryptor);
   EXPECT_EQ(fake_frame_decryptor.get(),
@@ -1870,8 +1869,8 @@
 // Validate that the default FrameEncryptor setting is nullptr.
 TEST_F(RtpSenderReceiverTest, VideoReceiverCannotSetFrameDecryptorAfterStop) {
   CreateVideoRtpReceiver();
-  rtc::scoped_refptr<FrameDecryptorInterface> fake_frame_decryptor(
-      rtc::make_ref_counted<FakeFrameDecryptor>());
+  scoped_refptr<FrameDecryptorInterface> fake_frame_decryptor(
+      make_ref_counted<FakeFrameDecryptor>());
   EXPECT_EQ(nullptr, video_rtp_receiver_->GetFrameDecryptor());
   video_rtp_receiver_->SetMediaChannel(nullptr);
   video_rtp_receiver_->SetFrameDecryptor(fake_frame_decryptor);
diff --git a/pc/rtp_transceiver.cc b/pc/rtp_transceiver.cc
index 55a396c..6dae6e6 100644
--- a/pc/rtp_transceiver.cc
+++ b/pc/rtp_transceiver.cc
@@ -129,9 +129,8 @@
 }
 
 RtpTransceiver::RtpTransceiver(
-    rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender,
-    rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
-        receiver,
+    scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender,
+    scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> receiver,
     ConnectionContext* context,
     CodecLookupHelper* codec_lookup_helper,
     std::vector<RtpHeaderExtensionCapability> header_extensions_to_negotiate,
@@ -395,7 +394,7 @@
 }
 
 void RtpTransceiver::AddSender(
-    rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender) {
+    scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender) {
   RTC_DCHECK_RUN_ON(thread_);
   RTC_DCHECK(!stopped_);
   RTC_DCHECK(!unified_plan_);
@@ -426,8 +425,7 @@
 }
 
 void RtpTransceiver::AddReceiver(
-    rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
-        receiver) {
+    scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> receiver) {
   RTC_DCHECK_RUN_ON(thread_);
   RTC_DCHECK(!stopped_);
   RTC_DCHECK(!unified_plan_);
@@ -458,17 +456,16 @@
   return true;
 }
 
-rtc::scoped_refptr<RtpSenderInternal> RtpTransceiver::sender_internal() const {
+scoped_refptr<RtpSenderInternal> RtpTransceiver::sender_internal() const {
   RTC_DCHECK(unified_plan_);
   RTC_CHECK_EQ(1u, senders_.size());
-  return rtc::scoped_refptr<RtpSenderInternal>(senders_[0]->internal());
+  return scoped_refptr<RtpSenderInternal>(senders_[0]->internal());
 }
 
-rtc::scoped_refptr<RtpReceiverInternal> RtpTransceiver::receiver_internal()
-    const {
+scoped_refptr<RtpReceiverInternal> RtpTransceiver::receiver_internal() const {
   RTC_DCHECK(unified_plan_);
   RTC_CHECK_EQ(1u, receivers_.size());
-  return rtc::scoped_refptr<RtpReceiverInternal>(receivers_[0]->internal());
+  return scoped_refptr<RtpReceiverInternal>(receivers_[0]->internal());
 }
 
 webrtc::MediaType RtpTransceiver::media_type() const {
@@ -491,13 +488,13 @@
   }
 }
 
-rtc::scoped_refptr<RtpSenderInterface> RtpTransceiver::sender() const {
+scoped_refptr<RtpSenderInterface> RtpTransceiver::sender() const {
   RTC_DCHECK(unified_plan_);
   RTC_CHECK_EQ(1u, senders_.size());
   return senders_[0];
 }
 
-rtc::scoped_refptr<RtpReceiverInterface> RtpTransceiver::receiver() const {
+scoped_refptr<RtpReceiverInterface> RtpTransceiver::receiver() const {
   RTC_DCHECK(unified_plan_);
   RTC_CHECK_EQ(1u, receivers_.size());
   return receivers_[0];
@@ -655,7 +652,7 @@
 }
 
 RTCError RtpTransceiver::SetCodecPreferences(
-    rtc::ArrayView<RtpCodecCapability> codec_capabilities) {
+    ArrayView<RtpCodecCapability> codec_capabilities) {
   RTC_DCHECK(unified_plan_);
   // 3. If codecs is an empty list, set transceiver's [[PreferredCodecs]] slot
   // to codecs and abort these steps.
@@ -798,7 +795,7 @@
 }
 
 RTCError RtpTransceiver::SetHeaderExtensionsToNegotiate(
-    rtc::ArrayView<const RtpHeaderExtensionCapability> header_extensions) {
+    ArrayView<const RtpHeaderExtensionCapability> header_extensions) {
   // https://w3c.github.io/webrtc-extensions/#dom-rtcrtptransceiver-setheaderextensionstonegotiate
   if (header_extensions.size() != header_extensions_to_negotiate_.size()) {
     return RTCError(RTCErrorType::INVALID_MODIFICATION,
diff --git a/pc/rtp_transceiver.h b/pc/rtp_transceiver.h
index a076afa..0dde593 100644
--- a/pc/rtp_transceiver.h
+++ b/pc/rtp_transceiver.h
@@ -97,9 +97,8 @@
   // `HeaderExtensionsToNegotiate` is used for initializing the return value of
   // HeaderExtensionsToNegotiate().
   RtpTransceiver(
-      rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender,
-      rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
-          receiver,
+      scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender,
+      scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> receiver,
       ConnectionContext* context,
       CodecLookupHelper* codec_lookup_helper,
       std::vector<RtpHeaderExtensionCapability> HeaderExtensionsToNegotiate,
@@ -163,14 +162,14 @@
   // Adds an RtpSender of the appropriate type to be owned by this transceiver.
   // Must not be null.
   void AddSender(
-      rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender);
+      scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender);
 
   // Removes the given RtpSender. Returns false if the sender is not owned by
   // this transceiver.
   bool RemoveSender(RtpSenderInterface* sender);
 
   // Returns a vector of the senders owned by this transceiver.
-  std::vector<rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
+  std::vector<scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
   senders() const {
     return senders_;
   }
@@ -178,7 +177,7 @@
   // Adds an RtpReceiver of the appropriate type to be owned by this
   // transceiver. Must not be null.
   void AddReceiver(
-      rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
+      scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
           receiver);
 
   // Removes the given RtpReceiver. Returns false if the receiver is not owned
@@ -186,17 +185,16 @@
   bool RemoveReceiver(RtpReceiverInterface* receiver);
 
   // Returns a vector of the receivers owned by this transceiver.
-  std::vector<
-      rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
+  std::vector<scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
   receivers() const {
     return receivers_;
   }
 
   // Returns the backing object for the transceiver's Unified Plan sender.
-  rtc::scoped_refptr<RtpSenderInternal> sender_internal() const;
+  scoped_refptr<RtpSenderInternal> sender_internal() const;
 
   // Returns the backing object for the transceiver's Unified Plan receiver.
-  rtc::scoped_refptr<RtpReceiverInternal> receiver_internal() const;
+  scoped_refptr<RtpReceiverInternal> receiver_internal() const;
 
   // RtpTransceivers are not associated until they have a corresponding media
   // section set in SetLocalDescription or SetRemoteDescription. Therefore,
@@ -262,8 +260,8 @@
   // RtpTransceiverInterface implementation.
   webrtc::MediaType media_type() const override;
   std::optional<std::string> mid() const override;
-  rtc::scoped_refptr<RtpSenderInterface> sender() const override;
-  rtc::scoped_refptr<RtpReceiverInterface> receiver() const override;
+  scoped_refptr<RtpSenderInterface> sender() const override;
+  scoped_refptr<RtpReceiverInterface> receiver() const override;
   bool stopped() const override;
   bool stopping() const override;
   RtpTransceiverDirection direction() const override;
@@ -273,8 +271,7 @@
   std::optional<RtpTransceiverDirection> fired_direction() const override;
   RTCError StopStandard() override;
   void StopInternal() override;
-  RTCError SetCodecPreferences(
-      rtc::ArrayView<RtpCodecCapability> codecs) override;
+  RTCError SetCodecPreferences(ArrayView<RtpCodecCapability> codecs) override;
   // TODO(https://crbug.com/webrtc/391275081): Delete codec_preferences() in
   // favor of filtered_codec_preferences() because it's not used anywhere.
   std::vector<RtpCodecCapability> codec_preferences() const override;
@@ -287,8 +284,7 @@
   std::vector<RtpHeaderExtensionCapability> GetNegotiatedHeaderExtensions()
       const override;
   RTCError SetHeaderExtensionsToNegotiate(
-      rtc::ArrayView<const RtpHeaderExtensionCapability> header_extensions)
-      override;
+      ArrayView<const RtpHeaderExtensionCapability> header_extensions) override;
 
   // Called on the signaling thread when the local or remote content description
   // is updated. Used to update the negotiated header extensions.
@@ -329,11 +325,10 @@
   TaskQueueBase* const thread_;
   const bool unified_plan_;
   const webrtc::MediaType media_type_;
-  rtc::scoped_refptr<PendingTaskSafetyFlag> signaling_thread_safety_;
-  std::vector<rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
+  scoped_refptr<PendingTaskSafetyFlag> signaling_thread_safety_;
+  std::vector<scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
       senders_;
-  std::vector<
-      rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
+  std::vector<scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
       receivers_;
 
   bool stopped_ RTC_GUARDED_BY(thread_) = false;
@@ -363,8 +358,7 @@
   // `negotiated_header_extensions_` is read and written to on the signaling
   // thread from the SdpOfferAnswerHandler class (e.g.
   // PushdownMediaDescription().
-  cricket::RtpHeaderExtensions negotiated_header_extensions_
-      RTC_GUARDED_BY(thread_);
+  RtpHeaderExtensions negotiated_header_extensions_ RTC_GUARDED_BY(thread_);
 
   const std::function<void()> on_negotiation_needed_;
 };
@@ -374,8 +368,8 @@
 PROXY_PRIMARY_THREAD_DESTRUCTOR()
 BYPASS_PROXY_CONSTMETHOD0(webrtc::MediaType, media_type)
 PROXY_CONSTMETHOD0(std::optional<std::string>, mid)
-PROXY_CONSTMETHOD0(rtc::scoped_refptr<RtpSenderInterface>, sender)
-PROXY_CONSTMETHOD0(rtc::scoped_refptr<RtpReceiverInterface>, receiver)
+PROXY_CONSTMETHOD0(scoped_refptr<RtpSenderInterface>, sender)
+PROXY_CONSTMETHOD0(scoped_refptr<RtpReceiverInterface>, receiver)
 PROXY_CONSTMETHOD0(bool, stopped)
 PROXY_CONSTMETHOD0(bool, stopping)
 PROXY_CONSTMETHOD0(RtpTransceiverDirection, direction)
@@ -384,7 +378,7 @@
 PROXY_CONSTMETHOD0(std::optional<RtpTransceiverDirection>, fired_direction)
 PROXY_METHOD0(RTCError, StopStandard)
 PROXY_METHOD0(void, StopInternal)
-PROXY_METHOD1(RTCError, SetCodecPreferences, rtc::ArrayView<RtpCodecCapability>)
+PROXY_METHOD1(RTCError, SetCodecPreferences, ArrayView<RtpCodecCapability>)
 PROXY_CONSTMETHOD0(std::vector<RtpCodecCapability>, codec_preferences)
 PROXY_CONSTMETHOD0(std::vector<RtpHeaderExtensionCapability>,
                    GetHeaderExtensionsToNegotiate)
@@ -392,7 +386,7 @@
                    GetNegotiatedHeaderExtensions)
 PROXY_METHOD1(RTCError,
               SetHeaderExtensionsToNegotiate,
-              rtc::ArrayView<const RtpHeaderExtensionCapability>)
+              ArrayView<const RtpHeaderExtensionCapability>)
 END_PROXY_MAP(RtpTransceiver)
 
 }  // namespace webrtc
diff --git a/pc/rtp_transceiver_unittest.cc b/pc/rtp_transceiver_unittest.cc
index b2f3590..c9b42be 100644
--- a/pc/rtp_transceiver_unittest.cc
+++ b/pc/rtp_transceiver_unittest.cc
@@ -98,14 +98,14 @@
   }
 
   PeerConnectionFactoryDependencies dependencies_;
-  rtc::scoped_refptr<ConnectionContext> context_;
+  scoped_refptr<ConnectionContext> context_;
   FakeCodecLookupHelper codec_lookup_helper_;
 };
 
 // Checks that a channel cannot be set on a stopped `RtpTransceiver`.
 TEST_F(RtpTransceiverTest, CannotSetChannelOnStoppedTransceiver) {
   const std::string content_name("my_mid");
-  auto transceiver = rtc::make_ref_counted<RtpTransceiver>(
+  auto transceiver = make_ref_counted<RtpTransceiver>(
       webrtc::MediaType::AUDIO, context(), codec_lookup_helper());
   auto channel1 = std::make_unique<NiceMock<MockChannelInterface>>();
   EXPECT_CALL(*channel1, media_type())
@@ -141,7 +141,7 @@
 // Checks that a channel can be unset on a stopped `RtpTransceiver`
 TEST_F(RtpTransceiverTest, CanUnsetChannelOnStoppedTransceiver) {
   const std::string content_name("my_mid");
-  auto transceiver = rtc::make_ref_counted<RtpTransceiver>(
+  auto transceiver = make_ref_counted<RtpTransceiver>(
       webrtc::MediaType::VIDEO, context(), codec_lookup_helper());
   auto channel = std::make_unique<NiceMock<MockChannelInterface>>();
   EXPECT_CALL(*channel, media_type())
@@ -169,25 +169,25 @@
 
 class RtpTransceiverUnifiedPlanTest : public RtpTransceiverTest {
  public:
-  static rtc::scoped_refptr<MockRtpReceiverInternal> MockReceiver(
+  static scoped_refptr<MockRtpReceiverInternal> MockReceiver(
       webrtc::MediaType media_type) {
-    auto receiver = rtc::make_ref_counted<NiceMock<MockRtpReceiverInternal>>();
+    auto receiver = make_ref_counted<NiceMock<MockRtpReceiverInternal>>();
     EXPECT_CALL(*receiver.get(), media_type())
         .WillRepeatedly(Return(media_type));
     return receiver;
   }
 
-  static rtc::scoped_refptr<MockRtpSenderInternal> MockSender(
+  static scoped_refptr<MockRtpSenderInternal> MockSender(
       webrtc::MediaType media_type) {
-    auto sender = rtc::make_ref_counted<NiceMock<MockRtpSenderInternal>>();
+    auto sender = make_ref_counted<NiceMock<MockRtpSenderInternal>>();
     EXPECT_CALL(*sender.get(), media_type()).WillRepeatedly(Return(media_type));
     return sender;
   }
 
-  rtc::scoped_refptr<RtpTransceiver> CreateTransceiver(
-      rtc::scoped_refptr<RtpSenderInternal> sender,
-      rtc::scoped_refptr<RtpReceiverInternal> receiver) {
-    return rtc::make_ref_counted<RtpTransceiver>(
+  scoped_refptr<RtpTransceiver> CreateTransceiver(
+      scoped_refptr<RtpSenderInternal> sender,
+      scoped_refptr<RtpReceiverInternal> receiver) {
+    return make_ref_counted<RtpTransceiver>(
         RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
             Thread::Current(), std::move(sender)),
         RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
@@ -203,11 +203,11 @@
 
 // Basic tests for Stop()
 TEST_F(RtpTransceiverUnifiedPlanTest, StopSetsDirection) {
-  rtc::scoped_refptr<MockRtpReceiverInternal> receiver =
+  scoped_refptr<MockRtpReceiverInternal> receiver =
       MockReceiver(webrtc::MediaType::AUDIO);
-  rtc::scoped_refptr<MockRtpSenderInternal> sender =
+  scoped_refptr<MockRtpSenderInternal> sender =
       MockSender(webrtc::MediaType::AUDIO);
-  rtc::scoped_refptr<RtpTransceiver> transceiver =
+  scoped_refptr<RtpTransceiver> transceiver =
       CreateTransceiver(sender, receiver);
 
   EXPECT_CALL(*receiver.get(), Stop());
@@ -350,7 +350,7 @@
 #endif  // RTC_ENABLE_H265
 
  protected:
-  rtc::scoped_refptr<RtpTransceiver> transceiver_;
+  scoped_refptr<RtpTransceiver> transceiver_;
 };
 
 TEST_F(RtpTransceiverFilteredCodecPreferencesTest, EmptyByDefault) {
@@ -577,7 +577,7 @@
              RtpHeaderExtensionCapability(RtpExtension::kVideoRotationUri,
                                           4,
                                           RtpTransceiverDirection::kSendRecv)}),
-        transceiver_(rtc::make_ref_counted<RtpTransceiver>(
+        transceiver_(make_ref_counted<RtpTransceiver>(
             RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
                 Thread::Current(),
                 sender_),
@@ -595,13 +595,13 @@
     transceiver_->ClearChannel();
   }
 
-  rtc::scoped_refptr<MockRtpReceiverInternal> receiver_ =
+  scoped_refptr<MockRtpReceiverInternal> receiver_ =
       MockReceiver(webrtc::MediaType::AUDIO);
-  rtc::scoped_refptr<MockRtpSenderInternal> sender_ =
+  scoped_refptr<MockRtpSenderInternal> sender_ =
       MockSender(webrtc::MediaType::AUDIO);
 
   std::vector<RtpHeaderExtensionCapability> extensions_;
-  rtc::scoped_refptr<RtpTransceiver> transceiver_;
+  scoped_refptr<RtpTransceiver> transceiver_;
 };
 
 TEST_F(RtpTransceiverTestForHeaderExtensions, OffersChannelManagerList) {
@@ -783,8 +783,8 @@
   EXPECT_CALL(*mock_channel, mid()).WillRepeatedly(ReturnRef(content_name));
   EXPECT_CALL(*mock_channel, SetRtpTransport(_)).WillRepeatedly(Return(true));
 
-  cricket::RtpHeaderExtensions extensions = {RtpExtension("uri1", 1),
-                                             RtpExtension("uri2", 2)};
+  RtpHeaderExtensions extensions = {RtpExtension("uri1", 1),
+                                    RtpExtension("uri2", 2)};
   AudioContentDescription description;
   description.set_rtp_header_extensions(extensions);
   transceiver_->OnNegotiationUpdate(SdpType::kAnswer, &description);
@@ -812,8 +812,8 @@
   EXPECT_CALL(*sender_.get(), SetTransceiverAsStopped());
   EXPECT_CALL(*sender_.get(), Stop());
 
-  cricket::RtpHeaderExtensions extensions = {RtpExtension("uri1", 1),
-                                             RtpExtension("uri2", 2)};
+  RtpHeaderExtensions extensions = {RtpExtension("uri1", 1),
+                                    RtpExtension("uri2", 2)};
   AudioContentDescription description;
   description.set_rtp_header_extensions(extensions);
   transceiver_->OnNegotiationUpdate(SdpType::kAnswer, &description);
@@ -852,8 +852,8 @@
   };
 
   // Default is stopped.
-  auto sender = rtc::make_ref_counted<NiceMock<MockRtpSenderInternal>>();
-  auto transceiver = rtc::make_ref_counted<RtpTransceiver>(
+  auto sender = make_ref_counted<NiceMock<MockRtpSenderInternal>>();
+  auto transceiver = make_ref_counted<RtpTransceiver>(
       RtpSenderProxyWithInternal<RtpSenderInternal>::Create(Thread::Current(),
                                                             sender),
       RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
@@ -871,11 +871,10 @@
   // Simulcast, i.e. more than one encoding.
   RtpParameters simulcast_parameters;
   simulcast_parameters.encodings.resize(2);
-  auto simulcast_sender =
-      rtc::make_ref_counted<NiceMock<MockRtpSenderInternal>>();
+  auto simulcast_sender = make_ref_counted<NiceMock<MockRtpSenderInternal>>();
   EXPECT_CALL(*simulcast_sender, GetParametersInternal())
       .WillRepeatedly(Return(simulcast_parameters));
-  auto simulcast_transceiver = rtc::make_ref_counted<RtpTransceiver>(
+  auto simulcast_transceiver = make_ref_counted<RtpTransceiver>(
       RtpSenderProxyWithInternal<RtpSenderInternal>::Create(Thread::Current(),
                                                             simulcast_sender),
       RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
@@ -899,10 +898,10 @@
   svc_parameters.encodings.resize(1);
   svc_parameters.encodings[0].scalability_mode = "L3T3";
 
-  auto svc_sender = rtc::make_ref_counted<NiceMock<MockRtpSenderInternal>>();
+  auto svc_sender = make_ref_counted<NiceMock<MockRtpSenderInternal>>();
   EXPECT_CALL(*svc_sender, GetParametersInternal())
       .WillRepeatedly(Return(svc_parameters));
-  auto svc_transceiver = rtc::make_ref_counted<RtpTransceiver>(
+  auto svc_transceiver = make_ref_counted<RtpTransceiver>(
       RtpSenderProxyWithInternal<RtpSenderInternal>::Create(Thread::Current(),
                                                             svc_sender),
       RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
diff --git a/pc/rtp_transmission_manager.cc b/pc/rtp_transmission_manager.cc
index b6eac06..8c6d2a8 100644
--- a/pc/rtp_transmission_manager.cc
+++ b/pc/rtp_transmission_manager.cc
@@ -146,9 +146,8 @@
   }
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>
-RtpTransmissionManager::AddTrack(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+RTCErrorOr<scoped_refptr<RtpSenderInterface>> RtpTransmissionManager::AddTrack(
+    scoped_refptr<MediaStreamTrackInterface> track,
     const std::vector<std::string>& stream_ids,
     const std::vector<RtpEncodingParameters>* init_send_encodings) {
   RTC_DCHECK_RUN_ON(signaling_thread());
@@ -158,9 +157,9 @@
               : AddTrackPlanB(track, stream_ids, init_send_encodings));
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>
+RTCErrorOr<scoped_refptr<RtpSenderInterface>>
 RtpTransmissionManager::AddTrackPlanB(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+    scoped_refptr<MediaStreamTrackInterface> track,
     const std::vector<std::string>& stream_ids,
     const std::vector<RtpEncodingParameters>* init_send_encodings) {
   RTC_DCHECK_RUN_ON(signaling_thread());
@@ -202,12 +201,12 @@
       new_sender->internal()->SetSsrc(sender_info->first_ssrc);
     }
   }
-  return rtc::scoped_refptr<RtpSenderInterface>(new_sender);
+  return scoped_refptr<RtpSenderInterface>(new_sender);
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>
+RTCErrorOr<scoped_refptr<RtpSenderInterface>>
 RtpTransmissionManager::AddTrackUnifiedPlan(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+    scoped_refptr<MediaStreamTrackInterface> track,
     const std::vector<std::string>& stream_ids,
     const std::vector<RtpEncodingParameters>* init_send_encodings) {
   auto transceiver =
@@ -258,15 +257,15 @@
   return transceiver->sender();
 }
 
-rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>
+scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>
 RtpTransmissionManager::CreateSender(
     webrtc::MediaType media_type,
     const std::string& id,
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+    scoped_refptr<MediaStreamTrackInterface> track,
     const std::vector<std::string>& stream_ids,
     const std::vector<RtpEncodingParameters>& send_encodings) {
   RTC_DCHECK_RUN_ON(signaling_thread());
-  rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender;
+  scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender;
   if (media_type == webrtc::MediaType::AUDIO) {
     RTC_DCHECK(!track ||
                (track->kind() == MediaStreamTrackInterface::kAudioKind));
@@ -290,35 +289,33 @@
   return sender;
 }
 
-rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
+scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
 RtpTransmissionManager::CreateReceiver(webrtc::MediaType media_type,
                                        const std::string& receiver_id) {
   RTC_DCHECK_RUN_ON(signaling_thread());
-  rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
-      receiver;
+  scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> receiver;
   if (media_type == webrtc::MediaType::AUDIO) {
     receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
         signaling_thread(), worker_thread(),
-        rtc::make_ref_counted<AudioRtpReceiver>(worker_thread(), receiver_id,
-                                                std::vector<std::string>({}),
-                                                IsUnifiedPlan()));
+        make_ref_counted<AudioRtpReceiver>(worker_thread(), receiver_id,
+                                           std::vector<std::string>({}),
+                                           IsUnifiedPlan()));
     NoteUsageEvent(UsageEvent::AUDIO_ADDED);
   } else {
     RTC_DCHECK_EQ(media_type, webrtc::MediaType::VIDEO);
     receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
         signaling_thread(), worker_thread(),
-        rtc::make_ref_counted<VideoRtpReceiver>(worker_thread(), receiver_id,
-                                                std::vector<std::string>({})));
+        make_ref_counted<VideoRtpReceiver>(worker_thread(), receiver_id,
+                                           std::vector<std::string>({})));
     NoteUsageEvent(UsageEvent::VIDEO_ADDED);
   }
   return receiver;
 }
 
-rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
 RtpTransmissionManager::CreateAndAddTransceiver(
-    rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender,
-    rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
-        receiver) {
+    scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender,
+    scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> receiver) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   // Ensure that the new sender does not have an ID that is already in use by
   // another sender.
@@ -327,7 +324,7 @@
   RTC_DCHECK(!FindSenderById(sender->id()));
   auto transceiver = RtpTransceiverProxyWithInternal<RtpTransceiver>::Create(
       signaling_thread(),
-      rtc::make_ref_counted<RtpTransceiver>(
+      make_ref_counted<RtpTransceiver>(
           sender, receiver, context_, codec_lookup_helper_,
           sender->media_type() == webrtc::MediaType::AUDIO
               ? media_engine()->voice().GetRtpHeaderExtensions()
@@ -341,9 +338,9 @@
   return transceiver;
 }
 
-rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
 RtpTransmissionManager::FindFirstTransceiverForAddedTrack(
-    rtc::scoped_refptr<MediaStreamTrackInterface> track,
+    scoped_refptr<MediaStreamTrackInterface> track,
     const std::vector<RtpEncodingParameters>* init_send_encodings) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   RTC_DCHECK(track);
@@ -361,10 +358,10 @@
   return nullptr;
 }
 
-std::vector<rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
+std::vector<scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
 RtpTransmissionManager::GetSendersInternal() const {
   RTC_DCHECK_RUN_ON(signaling_thread());
-  std::vector<rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
+  std::vector<scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
       all_senders;
   for (const auto& transceiver : transceivers_.List()) {
     if (IsUnifiedPlan() && transceiver->internal()->stopped())
@@ -376,12 +373,10 @@
   return all_senders;
 }
 
-std::vector<
-    rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
+std::vector<scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
 RtpTransmissionManager::GetReceiversInternal() const {
   RTC_DCHECK_RUN_ON(signaling_thread());
-  std::vector<
-      rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
+  std::vector<scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
       all_receivers;
   for (const auto& transceiver : transceivers_.List()) {
     if (IsUnifiedPlan() && transceiver->internal()->stopped())
@@ -394,7 +389,7 @@
   return all_receivers;
 }
 
-rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
 RtpTransmissionManager::GetAudioTransceiver() const {
   RTC_DCHECK_RUN_ON(signaling_thread());
   // This method only works with Plan B SDP, where there is a single
@@ -409,7 +404,7 @@
   return nullptr;
 }
 
-rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
 RtpTransmissionManager::GetVideoTransceiver() const {
   RTC_DCHECK_RUN_ON(signaling_thread());
   // This method only works with Plan B SDP, where there is a single
@@ -439,7 +434,7 @@
 
   // Normal case; we've never seen this track before.
   auto new_sender = CreateSender(webrtc::MediaType::AUDIO, track->id(),
-                                 rtc::scoped_refptr<AudioTrackInterface>(track),
+                                 scoped_refptr<AudioTrackInterface>(track),
                                  {stream->id()}, {{}});
   new_sender->internal()->SetMediaChannel(voice_media_send_channel());
   GetAudioTransceiver()->internal()->AddSender(new_sender);
@@ -486,7 +481,7 @@
 
   // Normal case; we've never seen this track before.
   auto new_sender = CreateSender(webrtc::MediaType::VIDEO, track->id(),
-                                 rtc::scoped_refptr<VideoTrackInterface>(track),
+                                 scoped_refptr<VideoTrackInterface>(track),
                                  {stream->id()}, {{}});
   new_sender->internal()->SetMediaChannel(video_media_send_channel());
   GetVideoTransceiver()->internal()->AddSender(new_sender);
@@ -514,11 +509,11 @@
     MediaStreamInterface* stream,
     const RtpSenderInfo& remote_sender_info) {
   RTC_DCHECK(!closed_);
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams;
-  streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream));
+  std::vector<scoped_refptr<MediaStreamInterface>> streams;
+  streams.push_back(scoped_refptr<MediaStreamInterface>(stream));
   // TODO(https://crbug.com/webrtc/9480): When we remove remote_streams(), use
   // the constructor taking stream IDs instead.
-  auto audio_receiver = rtc::make_ref_counted<AudioRtpReceiver>(
+  auto audio_receiver = make_ref_counted<AudioRtpReceiver>(
       worker_thread(), remote_sender_info.sender_id, streams, IsUnifiedPlan(),
       voice_media_receive_channel());
   if (remote_sender_info.sender_id == kDefaultAudioSenderId) {
@@ -538,11 +533,11 @@
     MediaStreamInterface* stream,
     const RtpSenderInfo& remote_sender_info) {
   RTC_DCHECK(!closed_);
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams;
-  streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream));
+  std::vector<scoped_refptr<MediaStreamInterface>> streams;
+  streams.push_back(scoped_refptr<MediaStreamInterface>(stream));
   // TODO(https://crbug.com/webrtc/9480): When we remove remote_streams(), use
   // the constructor taking stream IDs instead.
-  auto video_receiver = rtc::make_ref_counted<VideoRtpReceiver>(
+  auto video_receiver = make_ref_counted<VideoRtpReceiver>(
       worker_thread(), remote_sender_info.sender_id, streams);
 
   video_receiver->SetupMediaChannel(
@@ -560,7 +555,7 @@
 
 // TODO(deadbeef): Keep RtpReceivers around even if track goes away in remote
 // description.
-rtc::scoped_refptr<RtpReceiverInterface>
+scoped_refptr<RtpReceiverInterface>
 RtpTransmissionManager::RemoveAndStopReceiver(
     const RtpSenderInfo& remote_sender_info) {
   auto receiver = FindReceiverById(remote_sender_info.sender_id);
@@ -604,12 +599,12 @@
                    << " receiver for track_id=" << sender_info.sender_id
                    << " and stream_id=" << sender_info.stream_id;
 
-  rtc::scoped_refptr<RtpReceiverInterface> receiver;
+  scoped_refptr<RtpReceiverInterface> receiver;
   if (media_type == webrtc::MediaType::AUDIO) {
     // When the MediaEngine audio channel is destroyed, the RemoteAudioSource
     // will be notified which will end the AudioRtpReceiver::track().
     receiver = RemoveAndStopReceiver(sender_info);
-    rtc::scoped_refptr<AudioTrackInterface> audio_track =
+    scoped_refptr<AudioTrackInterface> audio_track =
         stream->FindAudioTrack(sender_info.sender_id);
     if (audio_track) {
       stream->RemoveTrack(audio_track);
@@ -618,7 +613,7 @@
     // Stopping or destroying a VideoRtpReceiver will end the
     // VideoRtpReceiver::track().
     receiver = RemoveAndStopReceiver(sender_info);
-    rtc::scoped_refptr<VideoTrackInterface> video_track =
+    scoped_refptr<VideoTrackInterface> video_track =
         stream->FindVideoTrack(sender_info.sender_id);
     if (video_track) {
       // There's no guarantee the track is still available, e.g. the track may
@@ -709,7 +704,7 @@
   return nullptr;
 }
 
-rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>
+scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>
 RtpTransmissionManager::FindSenderForTrack(
     MediaStreamTrackInterface* track) const {
   RTC_DCHECK_RUN_ON(signaling_thread());
@@ -723,7 +718,7 @@
   return nullptr;
 }
 
-rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>
+scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>
 RtpTransmissionManager::FindSenderById(const std::string& sender_id) const {
   RTC_DCHECK_RUN_ON(signaling_thread());
   for (const auto& transceiver : transceivers_.List()) {
@@ -736,7 +731,7 @@
   return nullptr;
 }
 
-rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
+scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
 RtpTransmissionManager::FindReceiverById(const std::string& receiver_id) const {
   RTC_DCHECK_RUN_ON(signaling_thread());
   for (const auto& transceiver : transceivers_.List()) {
diff --git a/pc/rtp_transmission_manager.h b/pc/rtp_transmission_manager.h
index 6916675..6afb454 100644
--- a/pc/rtp_transmission_manager.h
+++ b/pc/rtp_transmission_manager.h
@@ -90,53 +90,52 @@
   void OnSetStreams() override;
 
   // Add a new track, creating transceiver if required.
-  RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrack(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  RTCErrorOr<scoped_refptr<RtpSenderInterface>> AddTrack(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<std::string>& stream_ids,
       const std::vector<RtpEncodingParameters>* init_send_encodings);
 
   // Create a new RTP sender. Does not associate with a transceiver.
-  rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>
-  CreateSender(webrtc::MediaType media_type,
-               const std::string& id,
-               rtc::scoped_refptr<MediaStreamTrackInterface> track,
-               const std::vector<std::string>& stream_ids,
-               const std::vector<RtpEncodingParameters>& send_encodings);
+  scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> CreateSender(
+      webrtc::MediaType media_type,
+      const std::string& id,
+      scoped_refptr<MediaStreamTrackInterface> track,
+      const std::vector<std::string>& stream_ids,
+      const std::vector<RtpEncodingParameters>& send_encodings);
 
   // Create a new RTP receiver. Does not associate with a transceiver.
-  rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
+  scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
   CreateReceiver(webrtc::MediaType media_type, const std::string& receiver_id);
 
   // Create a new RtpTransceiver of the given type and add it to the list of
   // registered transceivers.
-  rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+  scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
   CreateAndAddTransceiver(
-      rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender,
-      rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
+      scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender,
+      scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
           receiver);
 
   // Returns the first RtpTransceiver suitable for a newly added track, if such
   // transceiver is available.
-  rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+  scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
   FindFirstTransceiverForAddedTrack(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<RtpEncodingParameters>* init_send_encodings);
 
   // Returns the list of senders currently associated with some
   // registered transceiver
-  std::vector<rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
+  std::vector<scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>
   GetSendersInternal() const;
 
   // Returns the list of receivers currently associated with a transceiver
-  std::vector<
-      rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
+  std::vector<scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>>
   GetReceiversInternal() const;
 
   // Plan B: Get the transceiver containing all audio senders and receivers
-  rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+  scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
   GetAudioTransceiver() const;
   // Plan B: Get the transceiver containing all video senders and receivers
-  rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+  scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
   GetVideoTransceiver() const;
 
   // Add an audio track, reusing or creating the sender.
@@ -188,15 +187,15 @@
                                       const std::string& sender_id) const;
 
   // Return the RtpSender with the given track attached.
-  rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>
+  scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>
   FindSenderForTrack(MediaStreamTrackInterface* track) const;
 
   // Return the RtpSender with the given id, or null if none exists.
-  rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>
-  FindSenderById(const std::string& sender_id) const;
+  scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> FindSenderById(
+      const std::string& sender_id) const;
 
   // Return the RtpReceiver with the given id, or null if none exists.
-  rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
+  scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>>
   FindReceiverById(const std::string& receiver_id) const;
 
   TransceiverList* transceivers() { return &transceivers_; }
@@ -218,13 +217,13 @@
   }
 
   // AddTrack implementation when Unified Plan is specified.
-  RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrackUnifiedPlan(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  RTCErrorOr<scoped_refptr<RtpSenderInterface>> AddTrackUnifiedPlan(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<std::string>& stream_ids,
       const std::vector<RtpEncodingParameters>* init_send_encodings);
   // AddTrack implementation when Plan B is specified.
-  RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrackPlanB(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  RTCErrorOr<scoped_refptr<RtpSenderInterface>> AddTrackPlanB(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<std::string>& stream_ids,
       const std::vector<RtpEncodingParameters>* init_send_encodings);
 
@@ -237,7 +236,7 @@
   void CreateVideoReceiver(MediaStreamInterface* stream,
                            const RtpSenderInfo& remote_sender_info)
       RTC_RUN_ON(signaling_thread());
-  rtc::scoped_refptr<RtpReceiverInterface> RemoveAndStopReceiver(
+  scoped_refptr<RtpReceiverInterface> RemoveAndStopReceiver(
       const RtpSenderInfo& remote_sender_info) RTC_RUN_ON(signaling_thread());
 
   PeerConnectionObserver* Observer() const;
diff --git a/pc/rtp_transport.cc b/pc/rtp_transport.cc
index 96dc9d5..2ab4ef5 100644
--- a/pc/rtp_transport.cc
+++ b/pc/rtp_transport.cc
@@ -78,8 +78,8 @@
     new_packet_transport->SignalReadyToSend.connect(
         this, &RtpTransport::OnReadyToSend);
     new_packet_transport->RegisterReceivedPacketCallback(
-        this, [&](rtc::PacketTransportInternal* transport,
-                  const rtc::ReceivedPacket& packet) {
+        this, [&](PacketTransportInternal* transport,
+                  const ReceivedIpPacket& packet) {
           OnReadPacket(transport, packet);
         });
     new_packet_transport->SignalNetworkRouteChanged.connect(
@@ -115,8 +115,8 @@
     new_packet_transport->SignalReadyToSend.connect(
         this, &RtpTransport::OnReadyToSend);
     new_packet_transport->RegisterReceivedPacketCallback(
-        this, [&](rtc::PacketTransportInternal* transport,
-                  const rtc::ReceivedPacket& packet) {
+        this, [&](PacketTransportInternal* transport,
+                  const ReceivedIpPacket& packet) {
           OnReadPacket(transport, packet);
         });
     new_packet_transport->SignalNetworkRouteChanged.connect(
@@ -142,21 +142,21 @@
   return transport && transport->writable();
 }
 
-bool RtpTransport::SendRtpPacket(rtc::CopyOnWriteBuffer* packet,
-                                 const rtc::PacketOptions& options,
+bool RtpTransport::SendRtpPacket(CopyOnWriteBuffer* packet,
+                                 const AsyncSocketPacketOptions& options,
                                  int flags) {
   return SendPacket(false, packet, options, flags);
 }
 
-bool RtpTransport::SendRtcpPacket(rtc::CopyOnWriteBuffer* packet,
-                                  const rtc::PacketOptions& options,
+bool RtpTransport::SendRtcpPacket(CopyOnWriteBuffer* packet,
+                                  const AsyncSocketPacketOptions& options,
                                   int flags) {
   return SendPacket(true, packet, options, flags);
 }
 
 bool RtpTransport::SendPacket(bool rtcp,
-                              rtc::CopyOnWriteBuffer* packet,
-                              const rtc::PacketOptions& options,
+                              CopyOnWriteBuffer* packet,
+                              const AsyncSocketPacketOptions& options,
                               int flags) {
   PacketTransportInternal* transport = rtcp && !rtcp_mux_enabled_
                                            ? rtcp_packet_transport_
@@ -178,7 +178,7 @@
 }
 
 void RtpTransport::UpdateRtpHeaderExtensionMap(
-    const cricket::RtpHeaderExtensions& header_extensions) {
+    const RtpHeaderExtensions& header_extensions) {
   header_extension_map_ = RtpHeaderExtensionMap(header_extensions);
 }
 
@@ -204,9 +204,9 @@
   return rtp_demuxer_.GetSsrcsForSink(sink);
 }
 
-void RtpTransport::DemuxPacket(rtc::CopyOnWriteBuffer packet,
+void RtpTransport::DemuxPacket(CopyOnWriteBuffer packet,
                                webrtc::Timestamp arrival_time,
-                               rtc::EcnMarking ecn) {
+                               EcnMarking ecn) {
   RtpPacketReceived parsed_packet(&header_extension_map_);
   parsed_packet.set_arrival_time(arrival_time);
   parsed_packet.set_ecn(ecn);
@@ -247,7 +247,7 @@
 }
 
 void RtpTransport::OnSentPacket(PacketTransportInternal* packet_transport,
-                                const rtc::SentPacket& sent_packet) {
+                                const SentPacketInfo& sent_packet) {
   RTC_DCHECK(packet_transport == rtp_packet_transport_ ||
              packet_transport == rtcp_packet_transport_);
   if (processing_sent_packet_) {
@@ -261,8 +261,8 @@
 }
 
 void RtpTransport::OnRtpPacketReceived(
-    const rtc::ReceivedPacket& received_packet) {
-  rtc::CopyOnWriteBuffer payload(received_packet.payload());
+    const ReceivedIpPacket& received_packet) {
+  CopyOnWriteBuffer payload(received_packet.payload());
   DemuxPacket(
       payload,
       received_packet.arrival_time().value_or(Timestamp::MinusInfinity()),
@@ -270,8 +270,8 @@
 }
 
 void RtpTransport::OnRtcpPacketReceived(
-    const rtc::ReceivedPacket& received_packet) {
-  rtc::CopyOnWriteBuffer payload(received_packet.payload());
+    const ReceivedIpPacket& received_packet) {
+  CopyOnWriteBuffer payload(received_packet.payload());
   // TODO(bugs.webrtc.org/15368): Propagate timestamp and maybe received packet
   // further.
   SendRtcpPacketReceived(&payload, received_packet.arrival_time()
@@ -280,7 +280,7 @@
 }
 
 void RtpTransport::OnReadPacket(PacketTransportInternal* transport,
-                                const rtc::ReceivedPacket& received_packet) {
+                                const ReceivedIpPacket& received_packet) {
   TRACE_EVENT0("webrtc", "RtpTransport::OnReadPacket");
 
   // When using RTCP multiplexing we might get RTCP packets on the RTP
diff --git a/pc/rtp_transport.h b/pc/rtp_transport.h
index a577cd5..4394b16 100644
--- a/pc/rtp_transport.h
+++ b/pc/rtp_transport.h
@@ -71,18 +71,18 @@
 
   bool IsWritable(bool rtcp) const override;
 
-  bool SendRtpPacket(rtc::CopyOnWriteBuffer* packet,
-                     const rtc::PacketOptions& options,
+  bool SendRtpPacket(CopyOnWriteBuffer* packet,
+                     const AsyncSocketPacketOptions& options,
                      int flags) override;
 
-  bool SendRtcpPacket(rtc::CopyOnWriteBuffer* packet,
-                      const rtc::PacketOptions& options,
+  bool SendRtcpPacket(CopyOnWriteBuffer* packet,
+                      const AsyncSocketPacketOptions& options,
                       int flags) override;
 
   bool IsSrtpActive() const override { return false; }
 
   void UpdateRtpHeaderExtensionMap(
-      const cricket::RtpHeaderExtensions& header_extensions) override;
+      const RtpHeaderExtensions& header_extensions) override;
 
   bool RegisterRtpDemuxerSink(const RtpDemuxerCriteria& criteria,
                               RtpPacketSinkInterface* sink) override;
@@ -91,29 +91,29 @@
 
  protected:
   // These methods will be used in the subclasses.
-  void DemuxPacket(rtc::CopyOnWriteBuffer packet,
+  void DemuxPacket(CopyOnWriteBuffer packet,
                    Timestamp arrival_time,
-                   rtc::EcnMarking ecn);
+                   EcnMarking ecn);
 
   bool SendPacket(bool rtcp,
-                  rtc::CopyOnWriteBuffer* packet,
-                  const rtc::PacketOptions& options,
+                  CopyOnWriteBuffer* packet,
+                  const AsyncSocketPacketOptions& options,
                   int flags);
   flat_set<uint32_t> GetSsrcsForSink(RtpPacketSinkInterface* sink);
 
   // Overridden by SrtpTransport.
   virtual void OnNetworkRouteChanged(std::optional<NetworkRoute> network_route);
-  virtual void OnRtpPacketReceived(const rtc::ReceivedPacket& packet);
-  virtual void OnRtcpPacketReceived(const rtc::ReceivedPacket& packet);
+  virtual void OnRtpPacketReceived(const ReceivedIpPacket& packet);
+  virtual void OnRtcpPacketReceived(const ReceivedIpPacket& packet);
   // Overridden by SrtpTransport and DtlsSrtpTransport.
   virtual void OnWritableState(PacketTransportInternal* packet_transport);
 
  private:
   void OnReadyToSend(PacketTransportInternal* transport);
   void OnSentPacket(PacketTransportInternal* packet_transport,
-                    const rtc::SentPacket& sent_packet);
+                    const SentPacketInfo& sent_packet);
   void OnReadPacket(PacketTransportInternal* transport,
-                    const rtc::ReceivedPacket& received_packet);
+                    const ReceivedIpPacket& received_packet);
 
   // Updates "ready to send" for an individual channel and fires
   // SignalReadyToSend.
diff --git a/pc/rtp_transport_internal.h b/pc/rtp_transport_internal.h
index addde97..faac226 100644
--- a/pc/rtp_transport_internal.h
+++ b/pc/rtp_transport_internal.h
@@ -66,7 +66,7 @@
   // BaseChannel through the RtpDemuxer callback.
   void SubscribeRtcpPacketReceived(
       const void* tag,
-      absl::AnyInvocable<void(rtc::CopyOnWriteBuffer*, int64_t)> callback) {
+      absl::AnyInvocable<void(webrtc::CopyOnWriteBuffer*, int64_t)> callback) {
     callback_list_rtcp_packet_received_.AddReceiver(tag, std::move(callback));
   }
   // There doesn't seem to be a need to unsubscribe from this signal.
@@ -100,7 +100,7 @@
   }
   void SubscribeSentPacket(
       const void* tag,
-      absl::AnyInvocable<void(const rtc::SentPacket&)> callback) {
+      absl::AnyInvocable<void(const webrtc::SentPacketInfo&)> callback) {
     callback_list_sent_packet_.AddReceiver(tag, std::move(callback));
   }
   void UnsubscribeSentPacket(const void* tag) {
@@ -111,12 +111,12 @@
 
   // TODO(zhihuang): Pass the `packet` by copy so that the original data
   // wouldn't be modified.
-  virtual bool SendRtpPacket(rtc::CopyOnWriteBuffer* packet,
-                             const rtc::PacketOptions& options,
+  virtual bool SendRtpPacket(CopyOnWriteBuffer* packet,
+                             const AsyncSocketPacketOptions& options,
                              int flags) = 0;
 
-  virtual bool SendRtcpPacket(rtc::CopyOnWriteBuffer* packet,
-                              const rtc::PacketOptions& options,
+  virtual bool SendRtcpPacket(CopyOnWriteBuffer* packet,
+                              const AsyncSocketPacketOptions& options,
                               int flags) = 0;
 
   // This method updates the RTP header extension map so that the RTP transport
@@ -130,7 +130,7 @@
   //   UpdateRecvEncryptedHeaderExtensionIds,
   //   CacheRtpAbsSendTimeHeaderExtension,
   virtual void UpdateRtpHeaderExtensionMap(
-      const cricket::RtpHeaderExtensions& header_extensions) = 0;
+      const RtpHeaderExtensions& header_extensions) = 0;
 
   virtual bool IsSrtpActive() const = 0;
 
@@ -141,7 +141,7 @@
 
  protected:
   void SendReadyToSend(bool arg) { callback_list_ready_to_send_.Send(arg); }
-  void SendRtcpPacketReceived(rtc::CopyOnWriteBuffer* buffer,
+  void SendRtcpPacketReceived(CopyOnWriteBuffer* buffer,
                               int64_t packet_time_us) {
     callback_list_rtcp_packet_received_.Send(buffer, packet_time_us);
   }
@@ -154,21 +154,20 @@
   void SendWritableState(bool state) {
     callback_list_writable_state_.Send(state);
   }
-  void SendSentPacket(const rtc::SentPacket& packet) {
+  void SendSentPacket(const SentPacketInfo& packet) {
     callback_list_sent_packet_.Send(packet);
   }
 
  private:
   CallbackList<bool> callback_list_ready_to_send_;
-  CallbackList<rtc::CopyOnWriteBuffer*, int64_t>
-      callback_list_rtcp_packet_received_;
+  CallbackList<CopyOnWriteBuffer*, int64_t> callback_list_rtcp_packet_received_;
   absl::AnyInvocable<void(RtpPacketReceived&)>
       callback_undemuxable_rtp_packet_received_ =
           [](RtpPacketReceived& packet) {};
   CallbackList<std::optional<NetworkRoute>>
       callback_list_network_route_changed_;
   CallbackList<bool> callback_list_writable_state_;
-  CallbackList<const rtc::SentPacket&> callback_list_sent_packet_;
+  CallbackList<const SentPacketInfo&> callback_list_sent_packet_;
 };
 
 }  // namespace webrtc
diff --git a/pc/rtp_transport_unittest.cc b/pc/rtp_transport_unittest.cc
index e2babb3..c4d207d 100644
--- a/pc/rtp_transport_unittest.cc
+++ b/pc/rtp_transport_unittest.cc
@@ -51,7 +51,7 @@
     transport->SubscribeReadyToSend(
         this, [this](bool ready) { OnReadyToSend(ready); });
     transport->SubscribeNetworkRouteChanged(
-        this, [this](std::optional<rtc::NetworkRoute> route) {
+        this, [this](std::optional<NetworkRoute> route) {
           OnNetworkRouteChanged(route);
         });
     if (transport->rtp_packet_transport()) {
@@ -74,7 +74,7 @@
   }
 
   void OnSentPacket(PacketTransportInternal* packet_transport,
-                    const rtc::SentPacket& sent_packet) {
+                    const SentPacketInfo& sent_packet) {
     if (packet_transport == transport_->rtp_packet_transport()) {
       rtp_transport_sent_count_++;
     } else {
@@ -234,14 +234,14 @@
   fake_rtp.SetDestination(&fake_rtp, true);
   fake_rtcp.SetDestination(&fake_rtcp, true);
 
-  rtc::CopyOnWriteBuffer packet;
-  EXPECT_TRUE(transport.SendRtcpPacket(&packet, rtc::PacketOptions(), 0));
+  CopyOnWriteBuffer packet;
+  EXPECT_TRUE(transport.SendRtcpPacket(&packet, AsyncSocketPacketOptions(), 0));
   EXPECT_EQ(1, observer.rtcp_transport_sent_count());
 
   // The RTCP packets are expected to be sent over RtpPacketTransport if
   // RTCP-mux is enabled.
   transport.SetRtcpMuxEnabled(true);
-  EXPECT_TRUE(transport.SendRtcpPacket(&packet, rtc::PacketOptions(), 0));
+  EXPECT_TRUE(transport.SendRtcpPacket(&packet, AsyncSocketPacketOptions(), 0));
   EXPECT_EQ(1, observer.rtp_transport_sent_count());
 }
 
@@ -280,7 +280,7 @@
   // An rtcp packet.
   const unsigned char data[] = {0x80, 73, 0, 0};
   const int len = 4;
-  const rtc::PacketOptions options;
+  const AsyncSocketPacketOptions options;
   const int flags = 0;
   fake_rtp.SendPacket(reinterpret_cast<const char*>(data), len, options, flags);
   EXPECT_EQ(0, observer.rtp_count());
@@ -305,9 +305,9 @@
   transport.RegisterRtpDemuxerSink(demuxer_criteria, &observer);
 
   // An rtp packet.
-  const rtc::PacketOptions options;
+  const AsyncSocketPacketOptions options;
   const int flags = 0;
-  rtc::Buffer rtp_data(kRtpData, kRtpLen);
+  Buffer rtp_data(kRtpData, kRtpLen);
   fake_rtp.SendPacket(rtp_data.data<char>(), kRtpLen, options, flags);
   EXPECT_EQ(1, observer.rtp_count());
   EXPECT_EQ(0, observer.un_demuxable_rtp_count());
@@ -328,13 +328,13 @@
   demuxer_criteria.payload_types().insert(0x11);
   transport.RegisterRtpDemuxerSink(demuxer_criteria, &observer);
 
-  rtc::PacketOptions options;
+  AsyncSocketPacketOptions options;
   options.ecn_1 = true;
   const int flags = 0;
-  rtc::Buffer rtp_data(kRtpData, kRtpLen);
+  Buffer rtp_data(kRtpData, kRtpLen);
   fake_rtp.SendPacket(rtp_data.data<char>(), kRtpLen, options, flags);
   ASSERT_EQ(observer.rtp_count(), 1);
-  EXPECT_EQ(observer.last_recv_rtp_packet().ecn(), rtc::EcnMarking::kEct1);
+  EXPECT_EQ(observer.last_recv_rtp_packet().ecn(), EcnMarking::kEct1);
 
   transport.UnregisterRtpDemuxerSink(&observer);
 }
@@ -352,9 +352,9 @@
   demuxer_criteria.payload_types().insert(0x12);
   transport.RegisterRtpDemuxerSink(demuxer_criteria, &observer);
 
-  const rtc::PacketOptions options;
+  const AsyncSocketPacketOptions options;
   const int flags = 0;
-  rtc::Buffer rtp_data(kRtpData, kRtpLen);
+  Buffer rtp_data(kRtpData, kRtpLen);
   fake_rtp.SendPacket(rtp_data.data<char>(), kRtpLen, options, flags);
   EXPECT_EQ(0, observer.rtp_count());
   EXPECT_EQ(1, observer.un_demuxable_rtp_count());
@@ -375,12 +375,12 @@
   fake_rtp.SetWritable(true);
   EXPECT_TRUE(observer.ready_to_send());
   EXPECT_EQ(observer.ready_to_send_signal_count(), 1);
-  rtc::CopyOnWriteBuffer packet;
-  EXPECT_TRUE(transport.SendRtpPacket(&packet, rtc::PacketOptions(), 0));
+  CopyOnWriteBuffer packet;
+  EXPECT_TRUE(transport.SendRtpPacket(&packet, AsyncSocketPacketOptions(), 0));
 
   // The fake RTP will return -1 due to ENOTCONN.
   fake_rtp.SetError(ENOTCONN);
-  EXPECT_FALSE(transport.SendRtpPacket(&packet, rtc::PacketOptions(), 0));
+  EXPECT_FALSE(transport.SendRtpPacket(&packet, AsyncSocketPacketOptions(), 0));
   // Ready to send state should not have changed.
   EXPECT_TRUE(observer.ready_to_send());
   EXPECT_EQ(observer.ready_to_send_signal_count(), 1);
@@ -397,9 +397,9 @@
   transport.SetRtpPacketTransport(&fake_rtp);
   TransportObserver observer(&transport);
   observer.SetActionOnReadyToSend([&](bool ready) {
-    const rtc::PacketOptions options;
+    const AsyncSocketPacketOptions options;
     const int flags = 0;
-    rtc::CopyOnWriteBuffer rtp_data(kRtpData, kRtpLen);
+    CopyOnWriteBuffer rtp_data(kRtpData, kRtpLen);
     transport.SendRtpPacket(&rtp_data, options, flags);
   });
   // The fake RTP will have no destination, so will return -1.
@@ -424,17 +424,17 @@
   transport.SetRtpPacketTransport(&fake_rtp);
   fake_rtp.SetDestination(&fake_rtp, true);
   TransportObserver observer(&transport);
-  const rtc::PacketOptions options;
+  const AsyncSocketPacketOptions options;
   const int flags = 0;
 
   fake_rtp.SetWritable(true);
   observer.SetActionOnSentPacket([&]() {
-    rtc::CopyOnWriteBuffer rtp_data(kRtpData, kRtpLen);
+    CopyOnWriteBuffer rtp_data(kRtpData, kRtpLen);
     if (observer.sent_packet_count() < 2) {
       transport.SendRtpPacket(&rtp_data, options, flags);
     }
   });
-  rtc::CopyOnWriteBuffer rtp_data(kRtpData, kRtpLen);
+  CopyOnWriteBuffer rtp_data(kRtpData, kRtpLen);
   transport.SendRtpPacket(&rtp_data, options, flags);
   EXPECT_EQ(observer.sent_packet_count(), 1);
   EXPECT_THAT(
diff --git a/pc/scenario_tests/goog_cc_test.cc b/pc/scenario_tests/goog_cc_test.cc
index 2fb58aa..2e8ff64 100644
--- a/pc/scenario_tests/goog_cc_test.cc
+++ b/pc/scenario_tests/goog_cc_test.cc
@@ -74,8 +74,7 @@
   ASSERT_EQ(num_video_streams, 1);  // Exactly 1 video stream.
 
   auto get_bwe = [&] {
-    auto callback =
-        rtc::make_ref_counted<webrtc::MockRTCStatsCollectorCallback>();
+    auto callback = make_ref_counted<webrtc::MockRTCStatsCollectorCallback>();
     caller->pc()->GetStats(callback.get());
     s.net()->time_controller()->Wait([&] { return callback->called(); });
     auto stats =
diff --git a/pc/sctp_data_channel.cc b/pc/sctp_data_channel.cc
index cbfbfd7..0faa6bb 100644
--- a/pc/sctp_data_channel.cc
+++ b/pc/sctp_data_channel.cc
@@ -178,7 +178,7 @@
  public:
   explicit ObserverAdapter(
       SctpDataChannel* channel,
-      rtc::scoped_refptr<PendingTaskSafetyFlag> signaling_safety)
+      scoped_refptr<PendingTaskSafetyFlag> signaling_safety)
       : channel_(channel), signaling_safety_(std::move(signaling_safety)) {}
 
   bool IsInsideCallback() const {
@@ -291,12 +291,12 @@
   // `channel_` in the `RTC_DCHECK_RUN_ON` checks on the signaling thread.
   Thread* const signaling_thread_{channel_->signaling_thread_};
   ScopedTaskSafety safety_;
-  rtc::scoped_refptr<PendingTaskSafetyFlag> signaling_safety_;
+  scoped_refptr<PendingTaskSafetyFlag> signaling_safety_;
   CachedGetters* cached_getters_ RTC_GUARDED_BY(signaling_thread()) = nullptr;
 };
 
 // static
-rtc::scoped_refptr<SctpDataChannel> SctpDataChannel::Create(
+scoped_refptr<SctpDataChannel> SctpDataChannel::Create(
     WeakPtr<SctpDataChannelControllerInterface> controller,
     const std::string& label,
     bool connected_to_transport,
@@ -304,15 +304,15 @@
     Thread* signaling_thread,
     Thread* network_thread) {
   RTC_DCHECK(config.IsValid());
-  return rtc::make_ref_counted<SctpDataChannel>(
-      config, std::move(controller), label, connected_to_transport,
-      signaling_thread, network_thread);
+  return make_ref_counted<SctpDataChannel>(config, std::move(controller), label,
+                                           connected_to_transport,
+                                           signaling_thread, network_thread);
 }
 
 // static
-rtc::scoped_refptr<DataChannelInterface> SctpDataChannel::CreateProxy(
-    rtc::scoped_refptr<SctpDataChannel> channel,
-    rtc::scoped_refptr<PendingTaskSafetyFlag> signaling_safety) {
+scoped_refptr<DataChannelInterface> SctpDataChannel::CreateProxy(
+    scoped_refptr<SctpDataChannel> channel,
+    scoped_refptr<PendingTaskSafetyFlag> signaling_safety) {
   // Copy thread params to local variables before `std::move()`.
   auto* signaling_thread = channel->signaling_thread_;
   auto* network_thread = channel->network_thread_;
@@ -401,7 +401,7 @@
   // a reference to ourselves while the task is in flight. We can't use
   // `SafeTask(network_safety_, ...)` for this since we can't assume that we
   // have a transport (network_safety_ represents the transport connection).
-  rtc::scoped_refptr<SctpDataChannel> me(this);
+  scoped_refptr<SctpDataChannel> me(this);
   auto register_observer = [me = std::move(me), observer = observer] {
     RTC_DCHECK_RUN_ON(me->network_thread_);
     me->observer_ = observer;
@@ -688,7 +688,7 @@
 }
 
 void SctpDataChannel::OnDataReceived(DataMessageType type,
-                                     const rtc::CopyOnWriteBuffer& payload) {
+                                     const CopyOnWriteBuffer& payload) {
   RTC_DCHECK_RUN_ON(network_thread_);
   RTC_DCHECK(id_n_.has_value());
 
@@ -790,13 +790,13 @@
     case kConnecting: {
       if (connected_to_transport() && controller_) {
         if (handshake_state_ == kHandshakeShouldSendOpen) {
-          rtc::CopyOnWriteBuffer payload;
+          CopyOnWriteBuffer payload;
           WriteDataChannelOpenMessage(label_, protocol_, priority_, ordered_,
                                       max_retransmits_, max_retransmit_time_,
                                       &payload);
           SendControlMessage(payload);
         } else if (handshake_state_ == kHandshakeShouldSendAck) {
-          rtc::CopyOnWriteBuffer payload;
+          CopyOnWriteBuffer payload;
           WriteDataChannelOpenAckMessage(&payload);
           SendControlMessage(payload);
         }
@@ -959,7 +959,7 @@
 }
 
 // RTC_RUN_ON(network_thread_).
-bool SctpDataChannel::SendControlMessage(const rtc::CopyOnWriteBuffer& buffer) {
+bool SctpDataChannel::SendControlMessage(const CopyOnWriteBuffer& buffer) {
   RTC_DCHECK(connected_to_transport());
   RTC_DCHECK(id_n_.has_value());
   RTC_DCHECK(controller_);
diff --git a/pc/sctp_data_channel.h b/pc/sctp_data_channel.h
index de3c2b9..71ccd2c 100644
--- a/pc/sctp_data_channel.h
+++ b/pc/sctp_data_channel.h
@@ -46,7 +46,7 @@
   // Sends the data to the transport.
   virtual RTCError SendData(StreamId sid,
                             const SendDataParams& params,
-                            const rtc::CopyOnWriteBuffer& payload) = 0;
+                            const CopyOnWriteBuffer& payload) = 0;
   // Adds the data channel SID to the transport for SCTP.
   virtual void AddSctpDataStream(StreamId sid, PriorityValue priority) = 0;
   // Begins the closing procedure by sending an outgoing stream reset. Still
@@ -129,7 +129,7 @@
 //    OnClosingProcedureComplete callback and transition to kClosed.
 class SctpDataChannel : public DataChannelInterface {
  public:
-  static rtc::scoped_refptr<SctpDataChannel> Create(
+  static scoped_refptr<SctpDataChannel> Create(
       WeakPtr<SctpDataChannelControllerInterface> controller,
       const std::string& label,
       bool connected_to_transport,
@@ -144,9 +144,9 @@
   // callbacks after the peerconnection has been closed. The data controller
   // will update the flag when closed, which will cancel any pending event
   // notifications.
-  static rtc::scoped_refptr<DataChannelInterface> CreateProxy(
-      rtc::scoped_refptr<SctpDataChannel> channel,
-      rtc::scoped_refptr<PendingTaskSafetyFlag> signaling_safety);
+  static scoped_refptr<DataChannelInterface> CreateProxy(
+      scoped_refptr<SctpDataChannel> channel,
+      scoped_refptr<PendingTaskSafetyFlag> signaling_safety);
 
   void RegisterObserver(DataChannelObserver* observer) override;
   void UnregisterObserver() override;
@@ -186,8 +186,7 @@
   // already finished.
   void OnTransportReady();
 
-  void OnDataReceived(DataMessageType type,
-                      const rtc::CopyOnWriteBuffer& payload);
+  void OnDataReceived(DataMessageType type, const CopyOnWriteBuffer& payload);
 
   // Sets the SCTP sid and adds to transport layer if not set yet. Should only
   // be called once.
@@ -256,7 +255,7 @@
   RTCError SendDataMessage(const DataBuffer& buffer, bool queue_if_blocked)
       RTC_RUN_ON(network_thread_);
 
-  bool SendControlMessage(const rtc::CopyOnWriteBuffer& buffer)
+  bool SendControlMessage(const CopyOnWriteBuffer& buffer)
       RTC_RUN_ON(network_thread_);
 
   bool connected_to_transport() const RTC_RUN_ON(network_thread_) {
@@ -293,7 +292,7 @@
   // Did we already start the graceful SCTP closing procedure?
   bool started_closing_procedure_ RTC_GUARDED_BY(network_thread_) = false;
   PacketQueue queued_received_data_ RTC_GUARDED_BY(network_thread_);
-  rtc::scoped_refptr<PendingTaskSafetyFlag> network_safety_ =
+  scoped_refptr<PendingTaskSafetyFlag> network_safety_ =
       PendingTaskSafetyFlag::CreateDetachedInactive();
 };
 
diff --git a/pc/sctp_transport.cc b/pc/sctp_transport.cc
index f09c380..6f56026 100644
--- a/pc/sctp_transport.cc
+++ b/pc/sctp_transport.cc
@@ -34,7 +34,7 @@
 namespace webrtc {
 
 SctpTransport::SctpTransport(std::unique_ptr<SctpTransportInternal> internal,
-                             rtc::scoped_refptr<DtlsTransport> dtls_transport)
+                             scoped_refptr<DtlsTransport> dtls_transport)
     : owner_thread_(Thread::Current()),
       info_(SctpTransportState::kConnecting,
             dtls_transport,
@@ -46,8 +46,7 @@
   RTC_DCHECK(dtls_transport_.get());
 
   dtls_transport_->internal()->SubscribeDtlsTransportState(
-      [this](cricket::DtlsTransportInternal* transport,
-             DtlsTransportState state) {
+      [this](DtlsTransportInternal* transport, DtlsTransportState state) {
         OnDtlsStateChange(transport, state);
       });
 
@@ -95,7 +94,7 @@
 
 RTCError SctpTransport::SendData(int channel_id,
                                  const SendDataParams& params,
-                                 const rtc::CopyOnWriteBuffer& buffer) {
+                                 const CopyOnWriteBuffer& buffer) {
   RTC_DCHECK_RUN_ON(owner_thread_);
   return internal_sctp_transport_->SendData(channel_id, params, buffer);
 }
@@ -136,8 +135,7 @@
   internal_sctp_transport_->SetBufferedAmountLowThreshold(channel_id, bytes);
 }
 
-rtc::scoped_refptr<DtlsTransportInterface> SctpTransport::dtls_transport()
-    const {
+scoped_refptr<DtlsTransportInterface> SctpTransport::dtls_transport() const {
   RTC_DCHECK_RUN_ON(owner_thread_);
   return dtls_transport_;
 }
diff --git a/pc/sctp_transport.h b/pc/sctp_transport.h
index ca275ec..cc43aaa 100644
--- a/pc/sctp_transport.h
+++ b/pc/sctp_transport.h
@@ -30,19 +30,19 @@
 
 namespace webrtc {
 
-// This implementation wraps a cricket::SctpTransport, and takes
+// This implementation wraps a webrtc::SctpTransport, and takes
 // ownership of it.
 // This object must be constructed and updated on the networking thread,
-// the same thread as the one the cricket::SctpTransportInternal object
+// the same thread as the one the webrtc::SctpTransportInternal object
 // lives on.
 class SctpTransport : public SctpTransportInterface,
                       public DataChannelTransportInterface {
  public:
   SctpTransport(std::unique_ptr<SctpTransportInternal> internal,
-                rtc::scoped_refptr<DtlsTransport> dtls_transport);
+                scoped_refptr<DtlsTransport> dtls_transport);
 
   // SctpTransportInterface
-  rtc::scoped_refptr<DtlsTransportInterface> dtls_transport() const override;
+  scoped_refptr<DtlsTransportInterface> dtls_transport() const override;
   SctpTransportInformation Information() const override;
   void RegisterObserver(SctpTransportObserverInterface* observer) override;
   void UnregisterObserver() override;
@@ -51,7 +51,7 @@
   RTCError OpenChannel(int channel_id, PriorityValue priority) override;
   RTCError SendData(int channel_id,
                     const SendDataParams& params,
-                    const rtc::CopyOnWriteBuffer& buffer) override;
+                    const CopyOnWriteBuffer& buffer) override;
   RTCError CloseChannel(int channel_id) override;
   void SetDataSink(DataChannelSink* sink) override;
   bool IsReadyToSend() const override;
@@ -61,7 +61,7 @@
 
   // Internal functions
   void Clear();
-  // Initialize the cricket::SctpTransport. This can be called from
+  // Initialize the webrtc::SctpTransport. This can be called from
   // the signaling thread.
   void Start(const SctpOptions& options);
 
@@ -98,8 +98,7 @@
       RTC_GUARDED_BY(owner_thread_);
   SctpTransportObserverInterface* observer_ RTC_GUARDED_BY(owner_thread_) =
       nullptr;
-  rtc::scoped_refptr<DtlsTransport> dtls_transport_
-      RTC_GUARDED_BY(owner_thread_);
+  scoped_refptr<DtlsTransport> dtls_transport_ RTC_GUARDED_BY(owner_thread_);
 };
 
 }  // namespace webrtc
diff --git a/pc/sctp_transport_unittest.cc b/pc/sctp_transport_unittest.cc
index d494f75..c47690c 100644
--- a/pc/sctp_transport_unittest.cc
+++ b/pc/sctp_transport_unittest.cc
@@ -57,7 +57,7 @@
   bool ResetStream(int sid) override { return true; }
   RTCError SendData(int sid,
                     const SendDataParams& params,
-                    const rtc::CopyOnWriteBuffer& payload) override {
+                    const CopyOnWriteBuffer& payload) override {
     return RTCError::OK();
   }
   bool ReadyToSendData() override { return true; }
@@ -127,11 +127,11 @@
         std::make_unique<FakeDtlsTransport>("audio",
                                             ICE_CANDIDATE_COMPONENT_RTP);
     dtls_transport_ =
-        rtc::make_ref_counted<DtlsTransport>(std::move(cricket_transport));
+        make_ref_counted<DtlsTransport>(std::move(cricket_transport));
 
     auto cricket_sctp_transport =
         absl::WrapUnique(new FakeCricketSctpTransport());
-    transport_ = rtc::make_ref_counted<SctpTransport>(
+    transport_ = make_ref_counted<SctpTransport>(
         std::move(cricket_sctp_transport), dtls_transport_);
   }
 
@@ -148,8 +148,8 @@
   }
 
   AutoThread main_thread_;
-  rtc::scoped_refptr<SctpTransport> transport_;
-  rtc::scoped_refptr<DtlsTransport> dtls_transport_;
+  scoped_refptr<SctpTransport> transport_;
+  scoped_refptr<DtlsTransport> dtls_transport_;
   TestSctpTransportObserver observer_;
 };
 
@@ -157,14 +157,13 @@
   AutoThread main_thread;
   std::unique_ptr<DtlsTransportInternal> cricket_transport =
       std::make_unique<FakeDtlsTransport>("audio", ICE_CANDIDATE_COMPONENT_RTP);
-  rtc::scoped_refptr<DtlsTransport> dtls_transport =
-      rtc::make_ref_counted<DtlsTransport>(std::move(cricket_transport));
+  scoped_refptr<DtlsTransport> dtls_transport =
+      make_ref_counted<DtlsTransport>(std::move(cricket_transport));
 
   std::unique_ptr<SctpTransportInternal> fake_cricket_sctp_transport =
       absl::WrapUnique(new FakeCricketSctpTransport());
-  rtc::scoped_refptr<SctpTransport> sctp_transport =
-      rtc::make_ref_counted<SctpTransport>(
-          std::move(fake_cricket_sctp_transport), dtls_transport);
+  scoped_refptr<SctpTransport> sctp_transport = make_ref_counted<SctpTransport>(
+      std::move(fake_cricket_sctp_transport), dtls_transport);
   ASSERT_TRUE(sctp_transport->internal());
   ASSERT_EQ(SctpTransportState::kConnecting,
             sctp_transport->Information().state());
diff --git a/pc/sctp_utils.cc b/pc/sctp_utils.cc
index b683e28..bc248cd 100644
--- a/pc/sctp_utils.cc
+++ b/pc/sctp_utils.cc
@@ -47,7 +47,7 @@
   DCO_PRIORITY_HIGH = 1024,
 };
 
-bool IsOpenMessage(const rtc::CopyOnWriteBuffer& payload) {
+bool IsOpenMessage(const CopyOnWriteBuffer& payload) {
   // Format defined at
   // https://www.rfc-editor.org/rfc/rfc8832#section-5.1
   if (payload.size() < 1) {
@@ -59,7 +59,7 @@
   return message_type == DATA_CHANNEL_OPEN_MESSAGE_TYPE;
 }
 
-bool ParseDataChannelOpenMessage(const rtc::CopyOnWriteBuffer& payload,
+bool ParseDataChannelOpenMessage(const CopyOnWriteBuffer& payload,
                                  std::string* label,
                                  DataChannelInit* config) {
   // Format defined at
@@ -138,7 +138,7 @@
   return true;
 }
 
-bool ParseDataChannelOpenAckMessage(const rtc::CopyOnWriteBuffer& payload) {
+bool ParseDataChannelOpenAckMessage(const CopyOnWriteBuffer& payload) {
   if (payload.size() < 1) {
     RTC_LOG(LS_WARNING) << "Could not read OPEN_ACK message type.";
     return false;
@@ -155,7 +155,7 @@
 
 bool WriteDataChannelOpenMessage(const std::string& label,
                                  const DataChannelInit& config,
-                                 rtc::CopyOnWriteBuffer* payload) {
+                                 CopyOnWriteBuffer* payload) {
   return WriteDataChannelOpenMessage(label, config.protocol, config.priority,
                                      config.ordered, config.maxRetransmits,
                                      config.maxRetransmitTime, payload);
@@ -167,7 +167,7 @@
                                  bool ordered,
                                  std::optional<int> max_retransmits,
                                  std::optional<int> max_retransmit_time,
-                                 rtc::CopyOnWriteBuffer* payload) {
+                                 CopyOnWriteBuffer* payload) {
   // Format defined at
   // http://tools.ietf.org/html/draft-ietf-rtcweb-data-protocol-09#section-5.1
   uint8_t channel_type = 0;
@@ -211,7 +211,7 @@
   return true;
 }
 
-void WriteDataChannelOpenAckMessage(rtc::CopyOnWriteBuffer* payload) {
+void WriteDataChannelOpenAckMessage(CopyOnWriteBuffer* payload) {
   uint8_t data = DATA_CHANNEL_OPEN_ACK_MESSAGE_TYPE;
   payload->SetData(&data, sizeof(data));
 }
diff --git a/pc/sctp_utils.h b/pc/sctp_utils.h
index e2ded86..098f6e9 100644
--- a/pc/sctp_utils.h
+++ b/pc/sctp_utils.h
@@ -51,13 +51,13 @@
 };
 
 // Read the message type and return true if it's an OPEN message.
-bool IsOpenMessage(const rtc::CopyOnWriteBuffer& payload);
+bool IsOpenMessage(const CopyOnWriteBuffer& payload);
 
-bool ParseDataChannelOpenMessage(const rtc::CopyOnWriteBuffer& payload,
+bool ParseDataChannelOpenMessage(const CopyOnWriteBuffer& payload,
                                  std::string* label,
                                  DataChannelInit* config);
 
-bool ParseDataChannelOpenAckMessage(const rtc::CopyOnWriteBuffer& payload);
+bool ParseDataChannelOpenAckMessage(const CopyOnWriteBuffer& payload);
 
 bool WriteDataChannelOpenMessage(const std::string& label,
                                  const std::string& protocol,
@@ -65,11 +65,11 @@
                                  bool ordered,
                                  std::optional<int> max_retransmits,
                                  std::optional<int> max_retransmit_time,
-                                 rtc::CopyOnWriteBuffer* payload);
+                                 CopyOnWriteBuffer* payload);
 bool WriteDataChannelOpenMessage(const std::string& label,
                                  const DataChannelInit& config,
-                                 rtc::CopyOnWriteBuffer* payload);
-void WriteDataChannelOpenAckMessage(rtc::CopyOnWriteBuffer* payload);
+                                 CopyOnWriteBuffer* payload);
+void WriteDataChannelOpenAckMessage(CopyOnWriteBuffer* payload);
 
 }  // namespace webrtc
 
diff --git a/pc/sctp_utils_unittest.cc b/pc/sctp_utils_unittest.cc
index 930a636..5e7d099 100644
--- a/pc/sctp_utils_unittest.cc
+++ b/pc/sctp_utils_unittest.cc
@@ -27,7 +27,7 @@
 
 class SctpUtilsTest : public ::testing::Test {
  public:
-  void VerifyOpenMessageFormat(const rtc::CopyOnWriteBuffer& packet,
+  void VerifyOpenMessageFormat(const webrtc::CopyOnWriteBuffer& packet,
                                const std::string& label,
                                const webrtc::DataChannelInit& config) {
     uint8_t message_type;
@@ -89,7 +89,7 @@
   std::string label = "abc";
   config.protocol = "y";
 
-  rtc::CopyOnWriteBuffer packet;
+  webrtc::CopyOnWriteBuffer packet;
   ASSERT_TRUE(webrtc::WriteDataChannelOpenMessage(label, config, &packet));
 
   VerifyOpenMessageFormat(packet, label, config);
@@ -113,7 +113,7 @@
   config.maxRetransmitTime = 10;
   config.protocol = "y";
 
-  rtc::CopyOnWriteBuffer packet;
+  webrtc::CopyOnWriteBuffer packet;
   ASSERT_TRUE(webrtc::WriteDataChannelOpenMessage(label, config, &packet));
 
   VerifyOpenMessageFormat(packet, label, config);
@@ -136,7 +136,7 @@
   config.maxRetransmits = 10;
   config.protocol = "y";
 
-  rtc::CopyOnWriteBuffer packet;
+  webrtc::CopyOnWriteBuffer packet;
   ASSERT_TRUE(webrtc::WriteDataChannelOpenMessage(label, config, &packet));
 
   VerifyOpenMessageFormat(packet, label, config);
@@ -159,7 +159,7 @@
   config.protocol = "y";
   config.priority = webrtc::PriorityValue(webrtc::Priority::kVeryLow);
 
-  rtc::CopyOnWriteBuffer packet;
+  webrtc::CopyOnWriteBuffer packet;
   ASSERT_TRUE(webrtc::WriteDataChannelOpenMessage(label, config, &packet));
 
   VerifyOpenMessageFormat(packet, label, config);
@@ -175,7 +175,7 @@
 }
 
 TEST_F(SctpUtilsTest, WriteParseAckMessage) {
-  rtc::CopyOnWriteBuffer packet;
+  webrtc::CopyOnWriteBuffer packet;
   webrtc::WriteDataChannelOpenAckMessage(&packet);
 
   uint8_t message_type;
@@ -187,19 +187,19 @@
 }
 
 TEST_F(SctpUtilsTest, TestIsOpenMessage) {
-  rtc::CopyOnWriteBuffer open(1);
+  webrtc::CopyOnWriteBuffer open(1);
   open.MutableData()[0] = 0x03;
   EXPECT_TRUE(webrtc::IsOpenMessage(open));
 
-  rtc::CopyOnWriteBuffer openAck(1);
+  webrtc::CopyOnWriteBuffer openAck(1);
   openAck.MutableData()[0] = 0x02;
   EXPECT_FALSE(webrtc::IsOpenMessage(openAck));
 
-  rtc::CopyOnWriteBuffer invalid(1);
+  webrtc::CopyOnWriteBuffer invalid(1);
   invalid.MutableData()[0] = 0x01;
   EXPECT_FALSE(webrtc::IsOpenMessage(invalid));
 
-  rtc::CopyOnWriteBuffer empty;
+  webrtc::CopyOnWriteBuffer empty;
   EXPECT_FALSE(webrtc::IsOpenMessage(empty));
 }
 
diff --git a/pc/sdp_munging_detector.cc b/pc/sdp_munging_detector.cc
index a489579..baef265 100644
--- a/pc/sdp_munging_detector.cc
+++ b/pc/sdp_munging_detector.cc
@@ -31,8 +31,8 @@
 namespace {
 
 SdpMungingType DetermineTransportModification(
-    const cricket::TransportInfos& last_created_transport_infos,
-    const cricket::TransportInfos& transport_infos_to_set) {
+    const TransportInfos& last_created_transport_infos,
+    const TransportInfos& transport_infos_to_set) {
   if (last_created_transport_infos.size() != transport_infos_to_set.size()) {
     RTC_LOG(LS_WARNING) << "SDP munging: Number of transport-infos does not "
                            "match last created description.";
@@ -288,13 +288,13 @@
     bool created_sim =
         absl::c_find_if(
             last_created_media_description->streams()[0].ssrc_groups,
-            [](const cricket::SsrcGroup group) {
+            [](const SsrcGroup group) {
               return group.semantics == kSimSsrcGroupSemantics;
             }) !=
         last_created_media_description->streams()[0].ssrc_groups.end();
     bool set_sim =
         absl::c_find_if(media_description_to_set->streams()[0].ssrc_groups,
-                        [](const cricket::SsrcGroup group) {
+                        [](const SsrcGroup group) {
                           return group.semantics == kSimSsrcGroupSemantics;
                         }) !=
         media_description_to_set->streams()[0].ssrc_groups.end();
diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc
index 59604bc..d0289e3 100644
--- a/pc/sdp_offer_answer.cc
+++ b/pc/sdp_offer_answer.cc
@@ -103,9 +103,9 @@
 #include "rtc_base/weak_ptr.h"
 #include "system_wrappers/include/metrics.h"
 
-using cricket::MediaContentDescription;
 using ::webrtc::ContentInfo;
 using ::webrtc::ContentInfos;
+using webrtc::MediaContentDescription;
 using ::webrtc::MediaProtocolType;
 using ::webrtc::RidDescription;
 using ::webrtc::RidDirection;
@@ -164,7 +164,7 @@
   std::vector<const ContentGroup*> bundle_groups =
       desc->GetGroupsByName(GROUP_TYPE_BUNDLE);
   std::map<std::string, const ContentGroup*> bundle_groups_by_mid;
-  for (const cricket::ContentGroup* bundle_group : bundle_groups) {
+  for (const ContentGroup* bundle_group : bundle_groups) {
     for (const std::string& content_name : bundle_group->content_names()) {
       bundle_groups_by_mid[content_name] = bundle_group;
     }
@@ -217,7 +217,7 @@
   return oss.Release();
 }
 
-std::string GetStreamIdsString(rtc::ArrayView<const std::string> stream_ids) {
+std::string GetStreamIdsString(ArrayView<const std::string> stream_ids) {
   std::string output = "streams=[";
   const char* separator = "";
   for (const auto& stream_id : stream_ids) {
@@ -320,7 +320,7 @@
     const SessionDescription* desc,
     bool dtls_enabled,
     const std::map<std::string, const ContentGroup*>& bundle_groups_by_mid) {
-  for (const cricket::ContentInfo& content_info : desc->contents()) {
+  for (const ContentInfo& content_info : desc->contents()) {
     if (content_info.rejected) {
       continue;
     }
@@ -361,7 +361,7 @@
 bool VerifyIceUfragPwdPresent(
     const SessionDescription* desc,
     const std::map<std::string, const ContentGroup*>& bundle_groups_by_mid) {
-  for (const cricket::ContentInfo& content_info : desc->contents()) {
+  for (const ContentInfo& content_info : desc->contents()) {
     if (content_info.rejected) {
       continue;
     }
@@ -395,7 +395,7 @@
 
 RTCError ValidateMids(const SessionDescription& description) {
   std::set<std::string> mids;
-  for (const cricket::ContentInfo& content : description.contents()) {
+  for (const ContentInfo& content : description.contents()) {
     if (content.mid().empty()) {
       LOG_AND_RETURN_ERROR(RTCErrorType::INVALID_PARAMETER,
                            "A media section is missing a MID attribute.");
@@ -440,7 +440,7 @@
   // that can affect the codec configuration and packetization.
   std::vector<const ContentGroup*> bundle_groups =
       description.GetGroupsByName(GROUP_TYPE_BUNDLE);
-  for (const cricket::ContentGroup* bundle_group : bundle_groups) {
+  for (const ContentGroup* bundle_group : bundle_groups) {
     std::map<int, RtpCodecParameters> payload_to_codec_parameters;
     for (const std::string& content_name : bundle_group->content_names()) {
       const ContentInfo* content_description =
@@ -498,7 +498,7 @@
   // extension across all the bundled media descriptions.
   std::vector<const ContentGroup*> bundle_groups =
       description.GetGroupsByName(GROUP_TYPE_BUNDLE);
-  for (const cricket::ContentGroup* bundle_group : bundle_groups) {
+  for (const ContentGroup* bundle_group : bundle_groups) {
     std::map<int, RtpExtension> id_to_extension;
     for (const std::string& content_name : bundle_group->content_names()) {
       const ContentInfo* content_description =
@@ -558,7 +558,7 @@
       continue;
     }
     for (const StreamParams& stream : content.media_description()->streams()) {
-      for (const cricket::SsrcGroup& group : stream.ssrc_groups) {
+      for (const SsrcGroup& group : stream.ssrc_groups) {
         // Validate the number of SSRCs for standard SSRC group semantics such
         // as FID and FEC-FR and the non-standard SIM group.
         if ((group.semantics == kFidSsrcGroupSemantics &&
@@ -656,7 +656,7 @@
 
 RTCError UpdateSimulcastLayerStatusInSender(
     const std::vector<SimulcastLayer>& layers,
-    rtc::scoped_refptr<RtpSenderInternal> sender) {
+    scoped_refptr<RtpSenderInternal> sender) {
   RTC_DCHECK(sender);
   RtpParameters parameters = sender->GetParametersInternalWithAllLayers();
   std::vector<std::string> disabled_layers;
@@ -700,8 +700,7 @@
   return simulcast_offered && (!simulcast_answered || !rids_supported);
 }
 
-RTCError DisableSimulcastInSender(
-    rtc::scoped_refptr<RtpSenderInternal> sender) {
+RTCError DisableSimulcastInSender(scoped_refptr<RtpSenderInternal> sender) {
   RTC_DCHECK(sender);
   RtpParameters parameters = sender->GetParametersInternalWithAllLayers();
   if (parameters.encodings.size() <= 1) {
@@ -738,8 +737,8 @@
 
 // Add options to |[audio/video]_media_description_options| from `senders`.
 void AddPlanBRtpSenderOptions(
-    const std::vector<rtc::scoped_refptr<
-        RtpSenderProxyWithInternal<RtpSenderInternal>>>& senders,
+    const std::vector<
+        scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>>>& senders,
     MediaDescriptionOptions* audio_media_description_options,
     MediaDescriptionOptions* video_media_description_options,
     int num_sim_layers) {
@@ -878,7 +877,7 @@
   return true;
 }
 
-rtc::scoped_refptr<DtlsTransport> LookupDtlsTransportByMid(
+scoped_refptr<DtlsTransport> LookupDtlsTransportByMid(
     Thread* network_thread,
     JsepTransportController* controller,
     const std::string& mid) {
@@ -942,7 +941,7 @@
   RemoteDescriptionOperation(
       SdpOfferAnswerHandler* handler,
       std::unique_ptr<SessionDescriptionInterface> desc,
-      rtc::scoped_refptr<SetRemoteDescriptionObserverInterface> observer,
+      scoped_refptr<SetRemoteDescriptionObserverInterface> observer,
       std::function<void()> operations_chain_callback)
       : handler_(handler),
         desc_(std::move(desc)),
@@ -1168,7 +1167,7 @@
   // is taking place since methods that depend on `old_remote_description()`
   // for updating the state, need it.
   std::unique_ptr<SessionDescriptionInterface> replaced_remote_description_;
-  rtc::scoped_refptr<SetRemoteDescriptionObserverInterface> observer_;
+  scoped_refptr<SetRemoteDescriptionObserverInterface> observer_;
   std::function<void()> operations_chain_callback_;
   RTCError error_ = RTCError::OK();
   std::map<std::string, const ContentGroup*> bundle_groups_by_mid_;
@@ -1183,7 +1182,7 @@
  public:
   ImplicitCreateSessionDescriptionObserver(
       WeakPtr<SdpOfferAnswerHandler> sdp_handler,
-      rtc::scoped_refptr<SetLocalDescriptionObserverInterface>
+      scoped_refptr<SetLocalDescriptionObserverInterface>
           set_local_description_observer)
       : sdp_handler_(std::move(sdp_handler)),
         set_local_description_observer_(
@@ -1229,7 +1228,7 @@
  private:
   bool was_called_ = false;
   WeakPtr<SdpOfferAnswerHandler> sdp_handler_;
-  rtc::scoped_refptr<SetLocalDescriptionObserverInterface>
+  scoped_refptr<SetLocalDescriptionObserverInterface>
       set_local_description_observer_;
   std::function<void()> operation_complete_callback_;
 };
@@ -1241,7 +1240,7 @@
     : public CreateSessionDescriptionObserver {
  public:
   CreateSessionDescriptionObserverOperationWrapper(
-      rtc::scoped_refptr<CreateSessionDescriptionObserver> observer,
+      scoped_refptr<CreateSessionDescriptionObserver> observer,
       std::function<void()> operation_complete_callback)
       : observer_(std::move(observer)),
         operation_complete_callback_(std::move(operation_complete_callback)) {
@@ -1277,7 +1276,7 @@
 #if RTC_DCHECK_IS_ON
   bool was_called_ = false;
 #endif  // RTC_DCHECK_IS_ON
-  rtc::scoped_refptr<CreateSessionDescriptionObserver> observer_;
+  scoped_refptr<CreateSessionDescriptionObserver> observer_;
   std::function<void()> operation_complete_callback_;
 };
 
@@ -1288,7 +1287,7 @@
  public:
   CreateDescriptionObserverWrapperWithCreationCallback(
       std::function<void(const SessionDescriptionInterface* desc)> callback,
-      rtc::scoped_refptr<CreateSessionDescriptionObserver> observer)
+      scoped_refptr<CreateSessionDescriptionObserver> observer)
       : callback_(callback), observer_(observer) {
     RTC_DCHECK(observer_);
   }
@@ -1303,7 +1302,7 @@
 
  private:
   std::function<void(const SessionDescriptionInterface* desc)> callback_;
-  rtc::scoped_refptr<CreateSessionDescriptionObserver> observer_;
+  scoped_refptr<CreateSessionDescriptionObserver> observer_;
 };
 
 // Wrapper for SetSessionDescriptionObserver that invokes the success or failure
@@ -1320,7 +1319,7 @@
  public:
   SetSessionDescriptionObserverAdapter(
       WeakPtr<SdpOfferAnswerHandler> handler,
-      rtc::scoped_refptr<SetSessionDescriptionObserver> inner_observer)
+      scoped_refptr<SetSessionDescriptionObserver> inner_observer)
       : handler_(std::move(handler)),
         inner_observer_(std::move(inner_observer)) {}
 
@@ -1347,7 +1346,7 @@
   }
 
   WeakPtr<SdpOfferAnswerHandler> handler_;
-  rtc::scoped_refptr<SetSessionDescriptionObserver> inner_observer_;
+  scoped_refptr<SetSessionDescriptionObserver> inner_observer_;
 };
 
 class SdpOfferAnswerHandler::LocalIceCredentialsToReplace {
@@ -1458,7 +1457,7 @@
       configuration.audio_jitter_buffer_min_delay_ms;
 
   // Obtain a certificate from RTCConfiguration if any were provided (optional).
-  rtc::scoped_refptr<RTCCertificate> certificate;
+  scoped_refptr<RTCCertificate> certificate;
   if (!configuration.certificates.empty()) {
     // TODO(hbos,torbjorng): Decide on certificate-selection strategy instead of
     // just picking the first one. The decision should be made based on the DTLS
@@ -1470,7 +1469,7 @@
       std::make_unique<WebRtcSessionDescriptionFactory>(
           context, this, pc_->session_id(), pc_->dtls_enabled(),
           std::move(cert_generator), std::move(certificate),
-          [this](const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) {
+          [this](const scoped_refptr<RTCCertificate>& certificate) {
             RTC_DCHECK_RUN_ON(signaling_thread());
             transport_controller_s()->SetLocalCertificate(certificate);
           },
@@ -1583,7 +1582,7 @@
   operations_chain_->ChainOperation(
       [this_weak_ptr = weak_ptr_factory_.GetWeakPtr(),
        observer_refptr =
-           rtc::scoped_refptr<CreateSessionDescriptionObserver>(observer),
+           scoped_refptr<CreateSessionDescriptionObserver>(observer),
        options](std::function<void()> operations_chain_callback) {
         // Abort early if `this_weak_ptr` is no longer valid.
         if (!this_weak_ptr) {
@@ -1594,9 +1593,10 @@
           return;
         }
         // The operation completes asynchronously when the wrapper is invoked.
-        auto observer_wrapper = rtc::make_ref_counted<
-            CreateSessionDescriptionObserverOperationWrapper>(
-            std::move(observer_refptr), std::move(operations_chain_callback));
+        auto observer_wrapper =
+            make_ref_counted<CreateSessionDescriptionObserverOperationWrapper>(
+                std::move(observer_refptr),
+                std::move(operations_chain_callback));
         this_weak_ptr->DoCreateOffer(options, observer_wrapper);
       });
 }
@@ -1610,8 +1610,7 @@
   // lambda will execute immediately.
   operations_chain_->ChainOperation(
       [this_weak_ptr = weak_ptr_factory_.GetWeakPtr(),
-       observer_refptr =
-           rtc::scoped_refptr<SetSessionDescriptionObserver>(observer),
+       observer_refptr = scoped_refptr<SetSessionDescriptionObserver>(observer),
        desc = std::unique_ptr<SessionDescriptionInterface>(desc_ptr)](
           std::function<void()> operations_chain_callback) mutable {
         // Abort early if `this_weak_ptr` is no longer valid.
@@ -1626,7 +1625,7 @@
         // `observer_refptr` is invoked in a posted message.
         this_weak_ptr->DoSetLocalDescription(
             std::move(desc),
-            rtc::make_ref_counted<SetSessionDescriptionObserverAdapter>(
+            make_ref_counted<SetSessionDescriptionObserverAdapter>(
                 this_weak_ptr, observer_refptr));
         // For backwards-compatability reasons, we declare the operation as
         // completed here (rather than in a post), so that the operation chain
@@ -1639,7 +1638,7 @@
 
 void SdpOfferAnswerHandler::SetLocalDescription(
     std::unique_ptr<SessionDescriptionInterface> desc,
-    rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) {
+    scoped_refptr<SetLocalDescriptionObserverInterface> observer) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   // Chain this operation. If asynchronous operations are pending on the chain,
   // this operation will be queued to be invoked, otherwise the contents of the
@@ -1667,19 +1666,18 @@
 void SdpOfferAnswerHandler::SetLocalDescription(
     SetSessionDescriptionObserver* observer) {
   RTC_DCHECK_RUN_ON(signaling_thread());
-  SetLocalDescription(
-      rtc::make_ref_counted<SetSessionDescriptionObserverAdapter>(
-          weak_ptr_factory_.GetWeakPtr(),
-          rtc::scoped_refptr<SetSessionDescriptionObserver>(observer)));
+  SetLocalDescription(make_ref_counted<SetSessionDescriptionObserverAdapter>(
+      weak_ptr_factory_.GetWeakPtr(),
+      scoped_refptr<SetSessionDescriptionObserver>(observer)));
 }
 
 void SdpOfferAnswerHandler::SetLocalDescription(
-    rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) {
+    scoped_refptr<SetLocalDescriptionObserverInterface> observer) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   // The `create_sdp_observer` handles performing DoSetLocalDescription() with
   // the resulting description as well as completing the operation.
   auto create_sdp_observer =
-      rtc::make_ref_counted<ImplicitCreateSessionDescriptionObserver>(
+      make_ref_counted<ImplicitCreateSessionDescriptionObserver>(
           weak_ptr_factory_.GetWeakPtr(), observer);
   // Chain this operation. If asynchronous operations are pending on the chain,
   // this operation will be queued to be invoked, otherwise the contents of the
@@ -1792,8 +1790,8 @@
       return error;
     }
     if (ConfiguredForMedia()) {
-      std::vector<rtc::scoped_refptr<RtpTransceiverInterface>> remove_list;
-      std::vector<rtc::scoped_refptr<MediaStreamInterface>> removed_streams;
+      std::vector<scoped_refptr<RtpTransceiverInterface>> remove_list;
+      std::vector<scoped_refptr<MediaStreamInterface>> removed_streams;
       for (const auto& transceiver_ext : transceivers()->List()) {
         auto transceiver = transceiver_ext->internal();
         if (transceiver->stopped()) {
@@ -1992,8 +1990,7 @@
   // lambda will execute immediately.
   operations_chain_->ChainOperation(
       [this_weak_ptr = weak_ptr_factory_.GetWeakPtr(),
-       observer_refptr =
-           rtc::scoped_refptr<SetSessionDescriptionObserver>(observer),
+       observer_refptr = scoped_refptr<SetSessionDescriptionObserver>(observer),
        desc = std::unique_ptr<SessionDescriptionInterface>(desc_ptr)](
           std::function<void()> operations_chain_callback) mutable {
         // Abort early if `this_weak_ptr` is no longer valid.
@@ -2009,7 +2006,7 @@
         this_weak_ptr->DoSetRemoteDescription(
             std::make_unique<RemoteDescriptionOperation>(
                 this_weak_ptr.get(), std::move(desc),
-                rtc::make_ref_counted<SetSessionDescriptionObserverAdapter>(
+                make_ref_counted<SetSessionDescriptionObserverAdapter>(
                     this_weak_ptr, observer_refptr),
                 std::move(operations_chain_callback)));
       });
@@ -2017,7 +2014,7 @@
 
 void SdpOfferAnswerHandler::SetRemoteDescription(
     std::unique_ptr<SessionDescriptionInterface> desc,
-    rtc::scoped_refptr<SetRemoteDescriptionObserverInterface> observer) {
+    scoped_refptr<SetRemoteDescriptionObserverInterface> observer) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   // Chain this operation. If asynchronous operations are pending on the chain,
   // this operation will be queued to be invoked, otherwise the contents of the
@@ -2102,7 +2099,7 @@
     return;
 
   if (operation->old_remote_description()) {
-    for (const cricket::ContentInfo& content :
+    for (const ContentInfo& content :
          operation->old_remote_description()->description()->contents()) {
       // Check if this new SessionDescription contains new ICE ufrag and
       // password that indicates the remote peer requests an ICE restart.
@@ -2188,11 +2185,11 @@
   if (!ConfiguredForMedia()) {
     return;
   }
-  std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>
+  std::vector<scoped_refptr<RtpTransceiverInterface>>
       now_receiving_transceivers;
-  std::vector<rtc::scoped_refptr<RtpTransceiverInterface>> remove_list;
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> added_streams;
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> removed_streams;
+  std::vector<scoped_refptr<RtpTransceiverInterface>> remove_list;
+  std::vector<scoped_refptr<MediaStreamInterface>> added_streams;
+  std::vector<scoped_refptr<MediaStreamInterface>> removed_streams;
   for (const auto& transceiver_ext : transceivers()->List()) {
     const auto transceiver = transceiver_ext->internal();
     const ContentInfo* content =
@@ -2319,7 +2316,7 @@
 
   // We wait to signal new streams until we finish processing the description,
   // since only at that point will new streams have all their tracks.
-  rtc::scoped_refptr<StreamCollection> new_streams(StreamCollection::Create());
+  scoped_refptr<StreamCollection> new_streams(StreamCollection::Create());
 
   // TODO(steveanton): When removing RTP senders/receivers in response to a
   // rejected media section, there is some cleanup logic that expects the
@@ -2364,7 +2361,7 @@
   for (size_t i = 0; i < new_streams->count(); ++i) {
     MediaStreamInterface* new_stream = new_streams->at(i);
     pc_->legacy_stats()->AddStream(new_stream);
-    observer->OnAddStream(rtc::scoped_refptr<MediaStreamInterface>(new_stream));
+    observer->OnAddStream(scoped_refptr<MediaStreamInterface>(new_stream));
   }
 
   UpdateEndedRemoteMediaStreams();
@@ -2399,7 +2396,7 @@
 
 void SdpOfferAnswerHandler::DoSetLocalDescription(
     std::unique_ptr<SessionDescriptionInterface> desc,
-    rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) {
+    scoped_refptr<SetLocalDescriptionObserverInterface> observer) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   TRACE_EVENT0("webrtc", "SdpOfferAnswerHandler::DoSetLocalDescription");
 
@@ -2534,7 +2531,7 @@
 
 void SdpOfferAnswerHandler::DoCreateOffer(
     const PeerConnectionInterface::RTCOfferAnswerOptions& options,
-    rtc::scoped_refptr<CreateSessionDescriptionObserver> observer) {
+    scoped_refptr<CreateSessionDescriptionObserver> observer) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   TRACE_EVENT0("webrtc", "SdpOfferAnswerHandler::DoCreateOffer");
 
@@ -2585,17 +2582,17 @@
 
   MediaSessionOptions session_options;
   GetOptionsForOffer(options, &session_options);
-  auto observer_wrapper = rtc::make_ref_counted<
-      CreateDescriptionObserverWrapperWithCreationCallback>(
-      [this](const SessionDescriptionInterface* desc) {
-        RTC_DCHECK_RUN_ON(signaling_thread());
-        if (desc) {
-          last_created_offer_ = desc->Clone();
-        } else {
-          last_created_offer_.reset(nullptr);
-        }
-      },
-      std::move(observer));
+  auto observer_wrapper =
+      make_ref_counted<CreateDescriptionObserverWrapperWithCreationCallback>(
+          [this](const SessionDescriptionInterface* desc) {
+            RTC_DCHECK_RUN_ON(signaling_thread());
+            if (desc) {
+              last_created_offer_ = desc->Clone();
+            } else {
+              last_created_offer_.reset(nullptr);
+            }
+          },
+          std::move(observer));
   webrtc_session_desc_factory_->CreateOffer(observer_wrapper.get(), options,
                                             session_options);
 }
@@ -2611,7 +2608,7 @@
   operations_chain_->ChainOperation(
       [this_weak_ptr = weak_ptr_factory_.GetWeakPtr(),
        observer_refptr =
-           rtc::scoped_refptr<CreateSessionDescriptionObserver>(observer),
+           scoped_refptr<CreateSessionDescriptionObserver>(observer),
        options](std::function<void()> operations_chain_callback) {
         // Abort early if `this_weak_ptr` is no longer valid.
         if (!this_weak_ptr) {
@@ -2622,16 +2619,17 @@
           return;
         }
         // The operation completes asynchronously when the wrapper is invoked.
-        auto observer_wrapper = rtc::make_ref_counted<
-            CreateSessionDescriptionObserverOperationWrapper>(
-            std::move(observer_refptr), std::move(operations_chain_callback));
+        auto observer_wrapper =
+            make_ref_counted<CreateSessionDescriptionObserverOperationWrapper>(
+                std::move(observer_refptr),
+                std::move(operations_chain_callback));
         this_weak_ptr->DoCreateAnswer(options, observer_wrapper);
       });
 }
 
 void SdpOfferAnswerHandler::DoCreateAnswer(
     const PeerConnectionInterface::RTCOfferAnswerOptions& options,
-    rtc::scoped_refptr<CreateSessionDescriptionObserver> observer) {
+    scoped_refptr<CreateSessionDescriptionObserver> observer) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   TRACE_EVENT0("webrtc", "SdpOfferAnswerHandler::DoCreateAnswer");
   if (!observer) {
@@ -2682,17 +2680,17 @@
 
   MediaSessionOptions session_options;
   GetOptionsForAnswer(options, &session_options);
-  auto observer_wrapper = rtc::make_ref_counted<
-      CreateDescriptionObserverWrapperWithCreationCallback>(
-      [this](const SessionDescriptionInterface* desc) {
-        RTC_DCHECK_RUN_ON(signaling_thread());
-        if (desc) {
-          last_created_answer_ = desc->Clone();
-        } else {
-          last_created_answer_.reset(nullptr);
-        }
-      },
-      std::move(observer));
+  auto observer_wrapper =
+      make_ref_counted<CreateDescriptionObserverWrapperWithCreationCallback>(
+          [this](const SessionDescriptionInterface* desc) {
+            RTC_DCHECK_RUN_ON(signaling_thread());
+            if (desc) {
+              last_created_answer_ = desc->Clone();
+            } else {
+              last_created_answer_.reset(nullptr);
+            }
+          },
+          std::move(observer));
   webrtc_session_desc_factory_->CreateAnswer(observer_wrapper.get(),
                                              session_options);
 }
@@ -2752,14 +2750,14 @@
 }
 
 void SdpOfferAnswerHandler::SetAssociatedRemoteStreams(
-    rtc::scoped_refptr<RtpReceiverInternal> receiver,
+    scoped_refptr<RtpReceiverInternal> receiver,
     const std::vector<std::string>& stream_ids,
-    std::vector<rtc::scoped_refptr<MediaStreamInterface>>* added_streams,
-    std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams) {
+    std::vector<scoped_refptr<MediaStreamInterface>>* added_streams,
+    std::vector<scoped_refptr<MediaStreamInterface>>* removed_streams) {
   RTC_DCHECK_RUN_ON(signaling_thread());
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> media_streams;
+  std::vector<scoped_refptr<MediaStreamInterface>> media_streams;
   for (const std::string& stream_id : stream_ids) {
-    rtc::scoped_refptr<MediaStreamInterface> stream(
+    scoped_refptr<MediaStreamInterface> stream(
         remote_streams_->find(stream_id));
     if (!stream) {
       stream = MediaStreamProxy::Create(Thread::Current(),
@@ -2780,7 +2778,7 @@
     }
     media_streams.push_back(missing_msid_default_stream_);
   }
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> previous_streams =
+  std::vector<scoped_refptr<MediaStreamInterface>> previous_streams =
       receiver->streams();
   // SetStreams() will add/remove the receiver's track to/from the streams.
   // This differs from the spec - the spec uses an "addList" and "removeList"
@@ -3094,7 +3092,7 @@
   return true;
 }
 
-rtc::scoped_refptr<StreamCollectionInterface>
+scoped_refptr<StreamCollectionInterface>
 SdpOfferAnswerHandler::local_streams() {
   RTC_DCHECK_RUN_ON(signaling_thread());
   RTC_CHECK(!IsUnifiedPlan()) << "local_streams is not available with Unified "
@@ -3103,7 +3101,7 @@
   return local_streams_;
 }
 
-rtc::scoped_refptr<StreamCollectionInterface>
+scoped_refptr<StreamCollectionInterface>
 SdpOfferAnswerHandler::remote_streams() {
   RTC_DCHECK_RUN_ON(signaling_thread());
   RTC_CHECK(!IsUnifiedPlan()) << "remote_streams is not available with Unified "
@@ -3123,8 +3121,7 @@
     return false;
   }
 
-  local_streams_->AddStream(
-      rtc::scoped_refptr<MediaStreamInterface>(local_stream));
+  local_streams_->AddStream(scoped_refptr<MediaStreamInterface>(local_stream));
   auto observer = std::make_unique<MediaStreamObserver>(
       local_stream,
       [this](AudioTrackInterface* audio_track,
@@ -3239,11 +3236,11 @@
   }
   RTC_DCHECK_RUN_ON(signaling_thread());
   RTC_DCHECK(IsUnifiedPlan());
-  std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>
+  std::vector<scoped_refptr<RtpTransceiverInterface>>
       now_receiving_transceivers;
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> all_added_streams;
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> all_removed_streams;
-  std::vector<rtc::scoped_refptr<RtpReceiverInterface>> removed_receivers;
+  std::vector<scoped_refptr<MediaStreamInterface>> all_added_streams;
+  std::vector<scoped_refptr<MediaStreamInterface>> all_removed_streams;
+  std::vector<scoped_refptr<RtpReceiverInterface>> removed_receivers;
 
   for (auto&& transceivers_stable_state_pair : transceivers()->StableStates()) {
     auto transceiver = transceivers_stable_state_pair.first;
@@ -3268,8 +3265,8 @@
     }
 
     if (stable_state.remote_stream_ids()) {
-      std::vector<rtc::scoped_refptr<MediaStreamInterface>> added_streams;
-      std::vector<rtc::scoped_refptr<MediaStreamInterface>> removed_streams;
+      std::vector<scoped_refptr<MediaStreamInterface>> added_streams;
+      std::vector<scoped_refptr<MediaStreamInterface>> removed_streams;
       SetAssociatedRemoteStreams(transceiver->internal()->receiver_internal(),
                                  stable_state.remote_stream_ids().value(),
                                  &added_streams, &removed_streams);
@@ -3943,7 +3940,7 @@
   return RTCError::OK();
 }
 
-RTCErrorOr<rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
+RTCErrorOr<scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
 SdpOfferAnswerHandler::AssociateTransceiver(
     ContentSource source,
     SdpType type,
@@ -4079,8 +4076,7 @@
 }
 
 RTCError SdpOfferAnswerHandler::UpdateTransceiverChannel(
-    rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
-        transceiver,
+    scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>> transceiver,
     const ContentInfo& content,
     const ContentGroup* bundle_group) {
   TRACE_EVENT0("webrtc", "SdpOfferAnswerHandler::UpdateTransceiverChannel");
@@ -4157,11 +4153,11 @@
     SessionDescription* new_remote_description) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   RTC_DCHECK(new_remote_description);
-  const cricket::ContentInfos no_infos;
-  const cricket::ContentInfos& local_contents =
+  const ContentInfos no_infos;
+  const ContentInfos& local_contents =
       (local_description() ? local_description()->description()->contents()
                            : no_infos);
-  const cricket::ContentInfos& remote_contents =
+  const ContentInfos& remote_contents =
       (remote_description() ? remote_description()->description()->contents()
                             : no_infos);
   for (size_t i = 0; i < new_remote_description->contents().size(); ++i) {
@@ -4196,7 +4192,7 @@
   }
 }
 
-rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
 SdpOfferAnswerHandler::FindAvailableTransceiverToReceive(
     webrtc::MediaType media_type) const {
   RTC_DCHECK_RUN_ON(signaling_thread());
@@ -4746,11 +4742,10 @@
   }
 }
 
-std::vector<rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
+std::vector<scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
 SdpOfferAnswerHandler::GetReceivingTransceiversOfType(
     webrtc::MediaType media_type) {
-  std::vector<
-      rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
+  std::vector<scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
       receiving_transceivers;
   for (const auto& transceiver : transceivers()->List()) {
     if (!transceiver->stopped() && transceiver->media_type() == media_type &&
@@ -4762,14 +4757,13 @@
 }
 
 void SdpOfferAnswerHandler::ProcessRemovalOfRemoteTrack(
-    rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
-        transceiver,
-    std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>* remove_list,
-    std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams) {
+    scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>> transceiver,
+    std::vector<scoped_refptr<RtpTransceiverInterface>>* remove_list,
+    std::vector<scoped_refptr<MediaStreamInterface>>* removed_streams) {
   RTC_DCHECK(transceiver->mid());
   RTC_LOG(LS_INFO) << "Processing the removal of a track for MID="
                    << *transceiver->mid();
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> previous_streams =
+  std::vector<scoped_refptr<MediaStreamInterface>> previous_streams =
       transceiver->internal()->receiver_internal()->streams();
   // This will remove the remote track from the streams.
   transceiver->internal()->receiver_internal()->set_stream_ids({});
@@ -4778,8 +4772,8 @@
 }
 
 void SdpOfferAnswerHandler::RemoveRemoteStreamsIfEmpty(
-    const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& remote_streams,
-    std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams) {
+    const std::vector<scoped_refptr<MediaStreamInterface>>& remote_streams,
+    std::vector<scoped_refptr<MediaStreamInterface>>* removed_streams) {
   RTC_DCHECK_RUN_ON(signaling_thread());
   // TODO(https://crbug.com/webrtc/9480): When we use stream IDs instead of
   // streams, see if the stream was removed by checking if this was the last
@@ -4825,7 +4819,7 @@
   }
 
   // Find new and active senders.
-  for (const cricket::StreamParams& params : streams) {
+  for (const StreamParams& params : streams) {
     // The sync_label is the MediaStream label and the `stream.id` is the
     // sender id.
     const std::string& stream_id = params.first_stream_id();
@@ -4841,7 +4835,7 @@
 }
 
 void SdpOfferAnswerHandler::UpdateRemoteSendersList(
-    const cricket::StreamParamsVec& streams,
+    const StreamParamsVec& streams,
     bool default_sender_needed,
     webrtc::MediaType media_type,
     StreamCollection* new_streams) {
@@ -4879,7 +4873,7 @@
   }
 
   // Find new and active senders.
-  for (const cricket::StreamParams& params : streams) {
+  for (const StreamParams& params : streams) {
     if (!params.has_ssrcs()) {
       // The remote endpoint has streams, but didn't signal ssrcs. For an active
       // sender, this means it is coming from a Unified Plan endpoint,so we just
@@ -4899,7 +4893,7 @@
     const std::string& sender_id = params.id;
     uint32_t ssrc = params.first_ssrc();
 
-    rtc::scoped_refptr<MediaStreamInterface> stream(
+    scoped_refptr<MediaStreamInterface> stream(
         remote_streams_->find(stream_id));
     if (!stream) {
       // This is a new MediaStream. Create a new remote MediaStream.
@@ -4920,7 +4914,7 @@
 
   // Add default sender if necessary.
   if (default_sender_needed) {
-    rtc::scoped_refptr<MediaStreamInterface> default_stream(
+    scoped_refptr<MediaStreamInterface> default_stream(
         remote_streams_->find(kDefaultStreamId));
     if (!default_stream) {
       // Create the new default MediaStream.
@@ -5168,12 +5162,11 @@
 
 void SdpOfferAnswerHandler::UpdateEndedRemoteMediaStreams() {
   RTC_DCHECK_RUN_ON(signaling_thread());
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams_to_remove;
+  std::vector<scoped_refptr<MediaStreamInterface>> streams_to_remove;
   for (size_t i = 0; i < remote_streams_->count(); ++i) {
     MediaStreamInterface* stream = remote_streams_->at(i);
     if (stream->GetAudioTracks().empty() && stream->GetVideoTracks().empty()) {
-      streams_to_remove.push_back(
-          rtc::scoped_refptr<MediaStreamInterface>(stream));
+      streams_to_remove.push_back(scoped_refptr<MediaStreamInterface>(stream));
     }
   }
 
@@ -5273,8 +5266,8 @@
     const IceCandidateInterface* candidate) {
   if (!candidate->sdp_mid().empty()) {
     auto& contents = description->description()->contents();
-    auto it = absl::c_find_if(
-        contents, [candidate](const cricket::ContentInfo& content_info) {
+    auto it =
+        absl::c_find_if(contents, [candidate](const ContentInfo& content_info) {
           return content_info.mid() == candidate->sdp_mid();
         });
     if (it == contents.end()) {
@@ -5388,8 +5381,7 @@
     std::optional<size_t>* data_index,
     MediaSessionOptions* session_options) {
   RTC_DCHECK_RUN_ON(signaling_thread());
-  for (const cricket::ContentInfo& content :
-       session_desc->description()->contents()) {
+  for (const ContentInfo& content : session_desc->description()->contents()) {
     if (IsAudioContent(&content)) {
       // If we already have an audio m= section, reject this extra one.
       if (*audio_index) {
diff --git a/pc/sdp_offer_answer.h b/pc/sdp_offer_answer.h
index 453e4bc..c91b252 100644
--- a/pc/sdp_offer_answer.h
+++ b/pc/sdp_offer_answer.h
@@ -131,16 +131,16 @@
 
   void SetLocalDescription(
       std::unique_ptr<SessionDescriptionInterface> desc,
-      rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer);
+      scoped_refptr<SetLocalDescriptionObserverInterface> observer);
   void SetLocalDescription(
-      rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer);
+      scoped_refptr<SetLocalDescriptionObserverInterface> observer);
   void SetLocalDescription(SetSessionDescriptionObserver* observer,
                            SessionDescriptionInterface* desc);
   void SetLocalDescription(SetSessionDescriptionObserver* observer);
 
   void SetRemoteDescription(
       std::unique_ptr<SessionDescriptionInterface> desc,
-      rtc::scoped_refptr<SetRemoteDescriptionObserverInterface> observer);
+      scoped_refptr<SetRemoteDescriptionObserverInterface> observer);
   void SetRemoteDescription(SetSessionDescriptionObserver* observer,
                             SessionDescriptionInterface* desc);
 
@@ -172,8 +172,8 @@
   // Destroys all media BaseChannels.
   void DestroyMediaChannels();
 
-  rtc::scoped_refptr<StreamCollectionInterface> local_streams();
-  rtc::scoped_refptr<StreamCollectionInterface> remote_streams();
+  scoped_refptr<StreamCollectionInterface> local_streams();
+  scoped_refptr<StreamCollectionInterface> remote_streams();
 
   bool initial_offerer() {
     RTC_DCHECK_RUN_ON(signaling_thread());
@@ -268,13 +268,13 @@
   // SetLocalDescription() and SetRemoteDescription() methods are invoked.
   void DoCreateOffer(
       const PeerConnectionInterface::RTCOfferAnswerOptions& options,
-      rtc::scoped_refptr<CreateSessionDescriptionObserver> observer);
+      scoped_refptr<CreateSessionDescriptionObserver> observer);
   void DoCreateAnswer(
       const PeerConnectionInterface::RTCOfferAnswerOptions& options,
-      rtc::scoped_refptr<CreateSessionDescriptionObserver> observer);
+      scoped_refptr<CreateSessionDescriptionObserver> observer);
   void DoSetLocalDescription(
       std::unique_ptr<SessionDescriptionInterface> desc,
-      rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer);
+      scoped_refptr<SetLocalDescriptionObserverInterface> observer);
   void DoSetRemoteDescription(
       std::unique_ptr<RemoteDescriptionOperation> operation);
 
@@ -315,10 +315,10 @@
   // Runs the algorithm **set the associated remote streams** specified in
   // https://w3c.github.io/webrtc-pc/#set-associated-remote-streams.
   void SetAssociatedRemoteStreams(
-      rtc::scoped_refptr<RtpReceiverInternal> receiver,
+      scoped_refptr<RtpReceiverInternal> receiver,
       const std::vector<std::string>& stream_ids,
-      std::vector<rtc::scoped_refptr<MediaStreamInterface>>* added_streams,
-      std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams);
+      std::vector<scoped_refptr<MediaStreamInterface>>* added_streams,
+      std::vector<scoped_refptr<MediaStreamInterface>>* removed_streams);
 
   bool CheckIfNegotiationIsNeeded();
   void GenerateNegotiationNeededEvent();
@@ -339,8 +339,7 @@
       const std::map<std::string, const ContentGroup*>& bundle_groups_by_mid);
 
   // Associate the given transceiver according to the JSEP rules.
-  RTCErrorOr<
-      rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
+  RTCErrorOr<scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
   AssociateTransceiver(ContentSource source,
                        SdpType type,
                        size_t mline_index,
@@ -360,7 +359,7 @@
   // Either creates or destroys the transceiver's BaseChannel according to the
   // given media section.
   RTCError UpdateTransceiverChannel(
-      rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+      scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
           transceiver,
       const ContentInfo& content,
       const ContentGroup* bundle_group) RTC_RUN_ON(signaling_thread());
@@ -386,7 +385,7 @@
 
   // Returns an RtpTransceiver, if available, that can be used to receive the
   // given media type according to JSEP rules.
-  rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+  scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
   FindAvailableTransceiverToReceive(webrtc::MediaType media_type) const;
 
   // Returns a MediaSessionOptions struct with options decided by `options`,
@@ -432,8 +431,7 @@
       webrtc::MediaType media_type) RTC_RUN_ON(signaling_thread());
   void AddUpToOneReceivingTransceiverOfType(webrtc::MediaType media_type);
 
-  std::vector<
-      rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
+  std::vector<scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
   GetReceivingTransceiversOfType(webrtc::MediaType media_type)
       RTC_RUN_ON(signaling_thread());
 
@@ -445,15 +443,14 @@
   // `removed_streams` is the list of streams which no longer have a receiving
   //     track so should be removed.
   void ProcessRemovalOfRemoteTrack(
-      const rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+      const scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
           transceiver,
-      std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>* remove_list,
-      std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams);
+      std::vector<scoped_refptr<RtpTransceiverInterface>>* remove_list,
+      std::vector<scoped_refptr<MediaStreamInterface>>* removed_streams);
 
   void RemoveRemoteStreamsIfEmpty(
-      const std::vector<rtc::scoped_refptr<MediaStreamInterface>>&
-          remote_streams,
-      std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams);
+      const std::vector<scoped_refptr<MediaStreamInterface>>& remote_streams,
+      std::vector<scoped_refptr<MediaStreamInterface>>* removed_streams);
 
   // Remove all local and remote senders of type `media_type`.
   // Called when a media type is rejected (m-line set to port 0).
@@ -616,10 +613,10 @@
   std::optional<bool> is_caller_ RTC_GUARDED_BY(signaling_thread());
 
   // Streams added via AddStream.
-  const rtc::scoped_refptr<StreamCollection> local_streams_
+  const scoped_refptr<StreamCollection> local_streams_
       RTC_GUARDED_BY(signaling_thread());
   // Streams created as a result of SetRemoteDescription.
-  const rtc::scoped_refptr<StreamCollection> remote_streams_
+  const scoped_refptr<StreamCollection> remote_streams_
       RTC_GUARDED_BY(signaling_thread());
 
   std::vector<std::unique_ptr<MediaStreamObserver>> stream_observers_
@@ -630,7 +627,7 @@
   // SetRemoteDescription() is invoked while CreateOffer() is still pending, the
   // SRD operation will not start until CreateOffer() has completed. See
   // https://w3c.github.io/webrtc-pc/#dfn-operations-chain.
-  rtc::scoped_refptr<OperationsChain> operations_chain_
+  scoped_refptr<OperationsChain> operations_chain_
       RTC_GUARDED_BY(signaling_thread());
 
   // One PeerConnection has only one RTCP CNAME.
@@ -665,7 +662,7 @@
   // line we create and use a stream with a random ID for our receivers. This is
   // to support legacy endpoints that do not support the a=msid attribute (as
   // opposed to streamless tracks with "a=msid:-").
-  rtc::scoped_refptr<MediaStreamInterface> missing_msid_default_stream_
+  scoped_refptr<MediaStreamInterface> missing_msid_default_stream_
       RTC_GUARDED_BY(signaling_thread());
 
   SessionError session_error_ RTC_GUARDED_BY(signaling_thread()) =
diff --git a/pc/sdp_offer_answer_unittest.cc b/pc/sdp_offer_answer_unittest.cc
index 8315c9e..a48df74 100644
--- a/pc/sdp_offer_answer_unittest.cc
+++ b/pc/sdp_offer_answer_unittest.cc
@@ -153,7 +153,7 @@
 
  protected:
   std::unique_ptr<Thread> signaling_thread_;
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
+  scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
 
  private:
   AutoThread main_thread_;
@@ -2105,9 +2105,9 @@
   ASSERT_TRUE(media_description);
   std::vector<Codec> codecs = media_description->codecs();
   for (auto& codec : codecs) {
-    if (codec.name == cricket::kH264CodecName) {
-      codec.SetParam(cricket::kH264FmtpSpsPpsIdrInKeyframe,
-                     cricket::kParamValueTrue);
+    if (codec.name == webrtc::kH264CodecName) {
+      codec.SetParam(webrtc::kH264FmtpSpsPpsIdrInKeyframe,
+                     webrtc::kParamValueTrue);
     }
   }
   media_description->set_codecs(codecs);
diff --git a/pc/sdp_utils.cc b/pc/sdp_utils.cc
index 010a3ae..33281e5 100644
--- a/pc/sdp_utils.cc
+++ b/pc/sdp_utils.cc
@@ -55,8 +55,8 @@
 
 bool SdpContentsNone(SdpContentPredicate pred, const SessionDescription* desc) {
   return SdpContentsAll(
-      [pred](const cricket::ContentInfo* content_info,
-             const cricket::TransportInfo* transport_info) {
+      [pred](const ContentInfo* content_info,
+             const TransportInfo* transport_info) {
         return !pred(content_info, transport_info);
       },
       desc);
diff --git a/pc/session_description.cc b/pc/session_description.cc
index e436928..96ea3d9 100644
--- a/pc/session_description.cc
+++ b/pc/session_description.cc
@@ -204,8 +204,7 @@
 }
 
 bool SessionDescription::RemoveTransportInfoByName(const std::string& name) {
-  for (cricket::TransportInfos::iterator transport_info =
-           transport_infos_.begin();
+  for (TransportInfos::iterator transport_info = transport_infos_.begin();
        transport_info != transport_infos_.end(); ++transport_info) {
     if (transport_info->content_name == name) {
       transport_infos_.erase(transport_info);
@@ -217,7 +216,7 @@
 
 const TransportInfo* SessionDescription::GetTransportInfoByName(
     const std::string& name) const {
-  for (cricket::TransportInfos::const_iterator iter = transport_infos_.begin();
+  for (TransportInfos::const_iterator iter = transport_infos_.begin();
        iter != transport_infos_.end(); ++iter) {
     if (iter->content_name == name) {
       return &(*iter);
@@ -228,7 +227,7 @@
 
 TransportInfo* SessionDescription::GetTransportInfoByName(
     const std::string& name) {
-  for (cricket::TransportInfos::iterator iter = transport_infos_.begin();
+  for (TransportInfos::iterator iter = transport_infos_.begin();
        iter != transport_infos_.end(); ++iter) {
     if (iter->content_name == name) {
       return &(*iter);
diff --git a/pc/session_description.h b/pc/session_description.h
index 4950e6e..bd08db4 100644
--- a/pc/session_description.h
+++ b/pc/session_description.h
@@ -154,10 +154,10 @@
   // provide the ClearRtpHeaderExtensions method to allow "no support" to be
   // clearly indicated (i.e. when derived from other information).
   bool rtp_header_extensions_set() const { return rtp_header_extensions_set_; }
-  const cricket::StreamParamsVec& streams() const { return send_streams_; }
+  const StreamParamsVec& streams() const { return send_streams_; }
   // TODO(pthatcher): Remove this by giving mediamessage.cc access
   // to MediaContentDescription
-  cricket::StreamParamsVec& mutable_streams() { return send_streams_; }
+  StreamParamsVec& mutable_streams() { return send_streams_; }
   void AddStream(const StreamParams& stream) {
     send_streams_.push_back(stream);
   }
@@ -270,7 +270,7 @@
 
   std::vector<RtpExtension> rtp_header_extensions_;
   bool rtp_header_extensions_set_ = false;
-  cricket::StreamParamsVec send_streams_;
+  StreamParamsVec send_streams_;
   bool conference_mode_ = false;
   RtpTransceiverDirection direction_ = RtpTransceiverDirection::kSendRecv;
   SocketAddress connection_address_;
@@ -530,10 +530,8 @@
   bool RemoveContentByName(const std::string& name);
 
   // Transport accessors.
-  const cricket::TransportInfos& transport_infos() const {
-    return transport_infos_;
-  }
-  cricket::TransportInfos& transport_infos() { return transport_infos_; }
+  const TransportInfos& transport_infos() const { return transport_infos_; }
+  TransportInfos& transport_infos() { return transport_infos_; }
   const TransportInfo* GetTransportInfoByName(const std::string& name) const;
   TransportInfo* GetTransportInfoByName(const std::string& name);
   const TransportDescription* GetTransportDescriptionByName(
@@ -543,7 +541,7 @@
   }
 
   // Transport mutators.
-  void set_transport_infos(const cricket::TransportInfos& transport_infos) {
+  void set_transport_infos(const TransportInfos& transport_infos) {
     transport_infos_ = transport_infos;
   }
   // Adds a TransportInfo to this description.
@@ -592,7 +590,7 @@
   SessionDescription(const SessionDescription&);
 
   ContentInfos contents_;
-  cricket::TransportInfos transport_infos_;
+  TransportInfos transport_infos_;
   ContentGroups content_groups_;
   int msid_signaling_ = kMsidSignalingMediaSection | kMsidSignalingSemantic;
   bool extmap_allow_mixed_ = true;
diff --git a/pc/slow_peer_connection_integration_test.cc b/pc/slow_peer_connection_integration_test.cc
index 06716cb..d306989 100644
--- a/pc/slow_peer_connection_integration_test.cc
+++ b/pc/slow_peer_connection_integration_test.cc
@@ -178,7 +178,7 @@
   // Enable TCP-TLS for the fake turn server. We need to pass in 88.88.88.0 so
   // that host name verification passes on the fake certificate.
   CreateTurnServer(turn_server_internal_address, turn_server_external_address,
-                   cricket::PROTO_TLS, "88.88.88.0");
+                   PROTO_TLS, "88.88.88.0");
 
   PeerConnectionInterface::IceServer ice_server;
   ice_server.urls.push_back("turns:88.88.88.0:3478?transport=tcp");
@@ -285,7 +285,7 @@
   }
 
   bool TestIPv6() {
-    return (port_allocator_flags_ & cricket::PORTALLOCATOR_ENABLE_IPV6);
+    return (port_allocator_flags_ & PORTALLOCATOR_ENABLE_IPV6);
   }
 
   std::vector<SocketAddress> CallerAddresses() {
@@ -403,7 +403,7 @@
   // Block connections to/from the caller and wait for ICE to become
   // disconnected.
   for (const auto& caller_address : CallerAddresses()) {
-    firewall()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, caller_address);
+    firewall()->AddRule(false, FP_ANY, FD_ANY, caller_address);
   }
   RTC_LOG(LS_INFO) << "Firewall rules applied";
   ScopedFakeClock& fake_clock = FakeClock();
@@ -439,7 +439,7 @@
   // is signaled by the state transitioning to "failed".
   constexpr TimeDelta kConsentTimeout = TimeDelta::Millis(30000);
   for (const auto& caller_address : CallerAddresses()) {
-    firewall()->AddRule(false, rtc::FP_ANY, rtc::FD_ANY, caller_address);
+    firewall()->AddRule(false, FP_ANY, FD_ANY, caller_address);
   }
   RTC_LOG(LS_INFO) << "Firewall rules applied again";
   ASSERT_THAT(
@@ -527,14 +527,14 @@
                          Values(SdpSemantics::kPlanB_DEPRECATED,
                                 SdpSemantics::kUnifiedPlan));
 
-constexpr uint32_t kFlagsIPv4NoStun = cricket::PORTALLOCATOR_DISABLE_TCP |
-                                      cricket::PORTALLOCATOR_DISABLE_STUN |
-                                      cricket::PORTALLOCATOR_DISABLE_RELAY;
+constexpr uint32_t kFlagsIPv4NoStun = PORTALLOCATOR_DISABLE_TCP |
+                                      PORTALLOCATOR_DISABLE_STUN |
+                                      PORTALLOCATOR_DISABLE_RELAY;
 constexpr uint32_t kFlagsIPv6NoStun =
-    cricket::PORTALLOCATOR_DISABLE_TCP | cricket::PORTALLOCATOR_DISABLE_STUN |
-    cricket::PORTALLOCATOR_ENABLE_IPV6 | cricket::PORTALLOCATOR_DISABLE_RELAY;
+    PORTALLOCATOR_DISABLE_TCP | PORTALLOCATOR_DISABLE_STUN |
+    PORTALLOCATOR_ENABLE_IPV6 | PORTALLOCATOR_DISABLE_RELAY;
 constexpr uint32_t kFlagsIPv4Stun =
-    cricket::PORTALLOCATOR_DISABLE_TCP | cricket::PORTALLOCATOR_DISABLE_RELAY;
+    PORTALLOCATOR_DISABLE_TCP | PORTALLOCATOR_DISABLE_RELAY;
 
 INSTANTIATE_TEST_SUITE_P(
     PeerConnectionIntegrationTest,
diff --git a/pc/srtp_session.cc b/pc/srtp_session.cc
index 047966c7..7fe7e04 100644
--- a/pc/srtp_session.cc
+++ b/pc/srtp_session.cc
@@ -174,25 +174,25 @@
 }
 
 bool SrtpSession::SetSend(int crypto_suite,
-                          const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                          const ZeroOnFreeBuffer<uint8_t>& key,
                           const std::vector<int>& extension_ids) {
   return SetKey(ssrc_any_outbound, crypto_suite, key, extension_ids);
 }
 
 bool SrtpSession::UpdateSend(int crypto_suite,
-                             const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                             const ZeroOnFreeBuffer<uint8_t>& key,
                              const std::vector<int>& extension_ids) {
   return UpdateKey(ssrc_any_outbound, crypto_suite, key, extension_ids);
 }
 
 bool SrtpSession::SetReceive(int crypto_suite,
-                             const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                             const ZeroOnFreeBuffer<uint8_t>& key,
                              const std::vector<int>& extension_ids) {
   return SetKey(ssrc_any_inbound, crypto_suite, key, extension_ids);
 }
 
 bool SrtpSession::UpdateReceive(int crypto_suite,
-                                const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                                const ZeroOnFreeBuffer<uint8_t>& key,
                                 const std::vector<int>& extension_ids) {
   return UpdateKey(ssrc_any_inbound, crypto_suite, key, extension_ids);
 }
@@ -257,7 +257,7 @@
   *out_len = in_len;
   int err = srtp_protect(session_, p, out_len);
   int seq_num = webrtc::ParseRtpSequenceNumber(
-      rtc::MakeArrayView(reinterpret_cast<const uint8_t*>(p), in_len));
+      MakeArrayView(reinterpret_cast<const uint8_t*>(p), in_len));
   if (err != srtp_err_status_ok) {
     RTC_LOG(LS_WARNING) << "Failed to protect SRTP packet, seqnum=" << seq_num
                         << ", err=" << err
@@ -525,7 +525,7 @@
 
 bool SrtpSession::DoSetKey(int type,
                            int crypto_suite,
-                           const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                           const ZeroOnFreeBuffer<uint8_t>& key,
                            const std::vector<int>& extension_ids) {
   RTC_DCHECK(thread_checker_.IsCurrent());
 
@@ -594,7 +594,7 @@
 
 bool SrtpSession::SetKey(int type,
                          int crypto_suite,
-                         const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                         const ZeroOnFreeBuffer<uint8_t>& key,
                          const std::vector<int>& extension_ids) {
   RTC_DCHECK(thread_checker_.IsCurrent());
   if (session_) {
@@ -617,7 +617,7 @@
 
 bool SrtpSession::UpdateKey(int type,
                             int crypto_suite,
-                            const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                            const ZeroOnFreeBuffer<uint8_t>& key,
                             const std::vector<int>& extension_ids) {
   RTC_DCHECK(thread_checker_.IsCurrent());
   if (!session_) {
diff --git a/pc/srtp_session.h b/pc/srtp_session.h
index 8006489..d2f4af3 100644
--- a/pc/srtp_session.h
+++ b/pc/srtp_session.h
@@ -45,19 +45,19 @@
   // Configures the session for sending data using the specified
   // crypto suite and key. Receiving must be done by a separate session.
   bool SetSend(int crypto_suite,
-               const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+               const ZeroOnFreeBuffer<uint8_t>& key,
                const std::vector<int>& extension_ids);
   bool UpdateSend(int crypto_suite,
-                  const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                  const ZeroOnFreeBuffer<uint8_t>& key,
                   const std::vector<int>& extension_ids);
 
   // Configures the session for receiving data using the specified
   // crypto suite and key. Sending must be done by a separate session.
   bool SetReceive(int crypto_suite,
-                  const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                  const ZeroOnFreeBuffer<uint8_t>& key,
                   const std::vector<int>& extension_ids);
   bool UpdateReceive(int crypto_suite,
-                     const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                     const ZeroOnFreeBuffer<uint8_t>& key,
                      const std::vector<int>& extension_ids);
 
   // Encrypts/signs an individual RTP/RTCP packet, in-place.
@@ -120,15 +120,15 @@
  private:
   bool DoSetKey(int type,
                 int crypto_suite,
-                const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                const ZeroOnFreeBuffer<uint8_t>& key,
                 const std::vector<int>& extension_ids);
   bool SetKey(int type,
               int crypto_suite,
-              const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+              const ZeroOnFreeBuffer<uint8_t>& key,
               const std::vector<int>& extension_ids);
   bool UpdateKey(int type,
                  int crypto_suite,
-                 const rtc::ZeroOnFreeBuffer<uint8_t>& key,
+                 const ZeroOnFreeBuffer<uint8_t>& key,
                  const std::vector<int>& extension_ids);
   // Returns send stream current packet index from srtp db.
   bool GetSendStreamPacketIndex(CopyOnWriteBuffer& buffer, int64_t* index);
diff --git a/pc/srtp_session_unittest.cc b/pc/srtp_session_unittest.cc
index 300db77..fd58ce7 100644
--- a/pc/srtp_session_unittest.cc
+++ b/pc/srtp_session_unittest.cc
@@ -22,7 +22,7 @@
 #include "rtc_base/buffer.h"
 #include "rtc_base/byte_order.h"
 #include "rtc_base/copy_on_write_buffer.h"
-#include "rtc_base/ssl_stream_adapter.h"  // For rtc::SRTP_*
+#include "rtc_base/ssl_stream_adapter.h"  // For webrtc::SRTP_*
 #include "system_wrappers/include/metrics.h"
 #include "test/gmock.h"
 #include "test/gtest.h"
@@ -112,12 +112,12 @@
 TEST_F(SrtpSessionTest, TestKeysTooShort) {
   EXPECT_FALSE(
       s1_.SetSend(webrtc::kSrtpAes128CmSha1_80,
-                  rtc::ZeroOnFreeBuffer<uint8_t>(webrtc::kTestKey1.data(), 1),
+                  ZeroOnFreeBuffer<uint8_t>(webrtc::kTestKey1.data(), 1),
                   kEncryptedHeaderExtensionIds));
-  EXPECT_FALSE(s2_.SetReceive(
-      webrtc::kSrtpAes128CmSha1_80,
-      rtc::ZeroOnFreeBuffer<uint8_t>(webrtc::kTestKey1.data(), 1),
-      kEncryptedHeaderExtensionIds));
+  EXPECT_FALSE(
+      s2_.SetReceive(webrtc::kSrtpAes128CmSha1_80,
+                     ZeroOnFreeBuffer<uint8_t>(webrtc::kTestKey1.data(), 1),
+                     kEncryptedHeaderExtensionIds));
 }
 
 // Test that we can encrypt and decrypt RTP/RTCP using AES_CM_128_HMAC_SHA1_80.
diff --git a/pc/srtp_transport.cc b/pc/srtp_transport.cc
index 8160cdd..62f4a14 100644
--- a/pc/srtp_transport.cc
+++ b/pc/srtp_transport.cc
@@ -39,8 +39,8 @@
     : RtpTransport(rtcp_mux_enabled, field_trials),
       field_trials_(field_trials) {}
 
-bool SrtpTransport::SendRtpPacket(rtc::CopyOnWriteBuffer* packet,
-                                  const rtc::PacketOptions& options,
+bool SrtpTransport::SendRtpPacket(CopyOnWriteBuffer* packet,
+                                  const AsyncSocketPacketOptions& options,
                                   int flags) {
   RTC_DCHECK(packet);
   if (!IsSrtpActive()) {
@@ -48,7 +48,7 @@
         << "Failed to send the packet because SRTP transport is inactive.";
     return false;
   }
-  rtc::PacketOptions updated_options = options;
+  AsyncSocketPacketOptions updated_options = options;
   TRACE_EVENT0("webrtc", "SRTP Encode");
   // If ENABLE_EXTERNAL_AUTH flag is on then packet authentication is not done
   // inside libsrtp for a RTP packet. A external HMAC module will be writing
@@ -92,8 +92,8 @@
   return SendPacket(/*rtcp=*/false, packet, updated_options, flags);
 }
 
-bool SrtpTransport::SendRtcpPacket(rtc::CopyOnWriteBuffer* packet,
-                                   const rtc::PacketOptions& options,
+bool SrtpTransport::SendRtcpPacket(CopyOnWriteBuffer* packet,
+                                   const AsyncSocketPacketOptions& options,
                                    int flags) {
   RTC_DCHECK(packet);
   if (!IsSrtpActive()) {
@@ -114,7 +114,7 @@
   return SendPacket(/*rtcp=*/true, packet, options, flags);
 }
 
-void SrtpTransport::OnRtpPacketReceived(const rtc::ReceivedPacket& packet) {
+void SrtpTransport::OnRtpPacketReceived(const ReceivedIpPacket& packet) {
   TRACE_EVENT0("webrtc", "SrtpTransport::OnRtpPacketReceived");
   if (!IsSrtpActive()) {
     RTC_LOG(LS_WARNING)
@@ -122,7 +122,7 @@
     return;
   }
 
-  rtc::CopyOnWriteBuffer payload(packet.payload());
+  CopyOnWriteBuffer payload(packet.payload());
   if (!UnprotectRtp(payload)) {
     // Limit the error logging to avoid excessive logs when there are lots of
     // bad packets.
@@ -143,14 +143,14 @@
               packet.ecn());
 }
 
-void SrtpTransport::OnRtcpPacketReceived(const rtc::ReceivedPacket& packet) {
+void SrtpTransport::OnRtcpPacketReceived(const ReceivedIpPacket& packet) {
   TRACE_EVENT0("webrtc", "SrtpTransport::OnRtcpPacketReceived");
   if (!IsSrtpActive()) {
     RTC_LOG(LS_WARNING)
         << "Inactive SRTP transport received an RTCP packet. Drop it.";
     return;
   }
-  rtc::CopyOnWriteBuffer payload(packet.payload());
+  CopyOnWriteBuffer payload(packet.payload());
   if (!UnprotectRtcp(payload)) {
     int type = -1;
     GetRtcpType(payload.data(), payload.size(), &type);
@@ -180,10 +180,10 @@
 }
 
 bool SrtpTransport::SetRtpParams(int send_crypto_suite,
-                                 const rtc::ZeroOnFreeBuffer<uint8_t>& send_key,
+                                 const ZeroOnFreeBuffer<uint8_t>& send_key,
                                  const std::vector<int>& send_extension_ids,
                                  int recv_crypto_suite,
-                                 const rtc::ZeroOnFreeBuffer<uint8_t>& recv_key,
+                                 const ZeroOnFreeBuffer<uint8_t>& recv_key,
                                  const std::vector<int>& recv_extension_ids) {
   // If parameters are being set for the first time, we should create new SRTP
   // sessions and call "SetSend/SetReceive". Otherwise we should call
@@ -222,13 +222,12 @@
   return true;
 }
 
-bool SrtpTransport::SetRtcpParams(
-    int send_crypto_suite,
-    const rtc::ZeroOnFreeBuffer<uint8_t>& send_key,
-    const std::vector<int>& send_extension_ids,
-    int recv_crypto_suite,
-    const rtc::ZeroOnFreeBuffer<uint8_t>& recv_key,
-    const std::vector<int>& recv_extension_ids) {
+bool SrtpTransport::SetRtcpParams(int send_crypto_suite,
+                                  const ZeroOnFreeBuffer<uint8_t>& send_key,
+                                  const std::vector<int>& send_extension_ids,
+                                  int recv_crypto_suite,
+                                  const ZeroOnFreeBuffer<uint8_t>& recv_key,
+                                  const std::vector<int>& recv_extension_ids) {
   // This can only be called once, but can be safely called after
   // SetRtpParams
   if (send_rtcp_session_ || recv_rtcp_session_) {
@@ -281,7 +280,7 @@
   }
 }
 
-bool SrtpTransport::ProtectRtp(rtc::CopyOnWriteBuffer& buffer) {
+bool SrtpTransport::ProtectRtp(CopyOnWriteBuffer& buffer) {
   if (!IsSrtpActive()) {
     RTC_LOG(LS_WARNING) << "Failed to ProtectRtp: SRTP not active";
     return false;
@@ -290,7 +289,7 @@
   return send_session_->ProtectRtp(buffer);
 }
 
-bool SrtpTransport::ProtectRtp(rtc::CopyOnWriteBuffer& buffer, int64_t* index) {
+bool SrtpTransport::ProtectRtp(CopyOnWriteBuffer& buffer, int64_t* index) {
   if (!IsSrtpActive()) {
     RTC_LOG(LS_WARNING) << "Failed to ProtectRtp: SRTP not active";
     return false;
@@ -299,7 +298,7 @@
   return send_session_->ProtectRtp(buffer, index);
 }
 
-bool SrtpTransport::ProtectRtcp(rtc::CopyOnWriteBuffer& buffer) {
+bool SrtpTransport::ProtectRtcp(CopyOnWriteBuffer& buffer) {
   if (!IsSrtpActive()) {
     RTC_LOG(LS_WARNING) << "Failed to ProtectRtcp: SRTP not active";
     return false;
@@ -312,7 +311,7 @@
   }
 }
 
-bool SrtpTransport::UnprotectRtp(rtc::CopyOnWriteBuffer& buffer) {
+bool SrtpTransport::UnprotectRtp(CopyOnWriteBuffer& buffer) {
   if (!IsSrtpActive()) {
     RTC_LOG(LS_WARNING) << "Failed to UnprotectRtp: SRTP not active";
     return false;
@@ -321,7 +320,7 @@
   return recv_session_->UnprotectRtp(buffer);
 }
 
-bool SrtpTransport::UnprotectRtcp(rtc::CopyOnWriteBuffer& buffer) {
+bool SrtpTransport::UnprotectRtcp(CopyOnWriteBuffer& buffer) {
   if (!IsSrtpActive()) {
     RTC_LOG(LS_WARNING) << "Failed to UnprotectRtcp: SRTP not active";
     return false;
diff --git a/pc/srtp_transport.h b/pc/srtp_transport.h
index 78f4090..1dddf3e 100644
--- a/pc/srtp_transport.h
+++ b/pc/srtp_transport.h
@@ -41,12 +41,12 @@
 
   virtual ~SrtpTransport() = default;
 
-  bool SendRtpPacket(rtc::CopyOnWriteBuffer* packet,
-                     const rtc::PacketOptions& options,
+  bool SendRtpPacket(CopyOnWriteBuffer* packet,
+                     const AsyncSocketPacketOptions& options,
                      int flags) override;
 
-  bool SendRtcpPacket(rtc::CopyOnWriteBuffer* packet,
-                      const rtc::PacketOptions& options,
+  bool SendRtcpPacket(CopyOnWriteBuffer* packet,
+                      const AsyncSocketPacketOptions& options,
                       int flags) override;
 
   // The transport becomes active if the send_session_ and recv_session_ are
@@ -59,20 +59,20 @@
   // packet encryption. The keys can either come from SDES negotiation or DTLS
   // handshake.
   bool SetRtpParams(int send_crypto_suite,
-                    const rtc::ZeroOnFreeBuffer<uint8_t>& send_key,
+                    const ZeroOnFreeBuffer<uint8_t>& send_key,
                     const std::vector<int>& send_extension_ids,
                     int recv_crypto_suite,
-                    const rtc::ZeroOnFreeBuffer<uint8_t>& recv_key,
+                    const ZeroOnFreeBuffer<uint8_t>& recv_key,
                     const std::vector<int>& recv_extension_ids);
 
   // Create new send/recv sessions and set the negotiated crypto keys for RTCP
   // packet encryption. The keys can either come from SDES negotiation or DTLS
   // handshake.
   bool SetRtcpParams(int send_crypto_suite,
-                     const rtc::ZeroOnFreeBuffer<uint8_t>& send_key,
+                     const ZeroOnFreeBuffer<uint8_t>& send_key,
                      const std::vector<int>& send_extension_ids,
                      int recv_crypto_suite,
-                     const rtc::ZeroOnFreeBuffer<uint8_t>& recv_key,
+                     const ZeroOnFreeBuffer<uint8_t>& recv_key,
                      const std::vector<int>& recv_extension_ids);
 
   void ResetParams();
@@ -114,23 +114,23 @@
   void ConnectToRtpTransport();
   void CreateSrtpSessions();
 
-  void OnRtpPacketReceived(const rtc::ReceivedPacket& packet) override;
-  void OnRtcpPacketReceived(const rtc::ReceivedPacket& packet) override;
+  void OnRtpPacketReceived(const ReceivedIpPacket& packet) override;
+  void OnRtcpPacketReceived(const ReceivedIpPacket& packet) override;
   void OnNetworkRouteChanged(
       std::optional<NetworkRoute> network_route) override;
 
   // Override the RtpTransport::OnWritableState.
   void OnWritableState(PacketTransportInternal* packet_transport) override;
 
-  bool ProtectRtp(rtc::CopyOnWriteBuffer& buffer);
+  bool ProtectRtp(CopyOnWriteBuffer& buffer);
   // Overloaded version, outputs packet index.
-  bool ProtectRtp(rtc::CopyOnWriteBuffer& buffer, int64_t* index);
-  bool ProtectRtcp(rtc::CopyOnWriteBuffer& buffer);
+  bool ProtectRtp(CopyOnWriteBuffer& buffer, int64_t* index);
+  bool ProtectRtcp(CopyOnWriteBuffer& buffer);
 
   // Decrypts/verifies an invidiual RTP/RTCP packet.
   // If an HMAC is used, this will decrease the packet size.
-  bool UnprotectRtp(rtc::CopyOnWriteBuffer& buffer);
-  bool UnprotectRtcp(rtc::CopyOnWriteBuffer& buffer);
+  bool UnprotectRtp(CopyOnWriteBuffer& buffer);
+  bool UnprotectRtcp(CopyOnWriteBuffer& buffer);
 
   const std::string content_name_;
 
@@ -141,8 +141,8 @@
 
   std::optional<int> send_crypto_suite_;
   std::optional<int> recv_crypto_suite_;
-  rtc::ZeroOnFreeBuffer<uint8_t> send_key_;
-  rtc::ZeroOnFreeBuffer<uint8_t> recv_key_;
+  ZeroOnFreeBuffer<uint8_t> send_key_;
+  ZeroOnFreeBuffer<uint8_t> recv_key_;
 
   bool writable_ = false;
 
diff --git a/pc/srtp_transport_unittest.cc b/pc/srtp_transport_unittest.cc
index 77b0a65..9155832 100644
--- a/pc/srtp_transport_unittest.cc
+++ b/pc/srtp_transport_unittest.cc
@@ -39,14 +39,14 @@
 
 namespace webrtc {
 // 128 bits key + 96 bits salt.
-static const rtc::ZeroOnFreeBuffer<uint8_t> kTestKeyGcm128_1{
+static const ZeroOnFreeBuffer<uint8_t> kTestKeyGcm128_1{
     "ABCDEFGHIJKLMNOPQRSTUVWXYZ12", 28};
-static const rtc::ZeroOnFreeBuffer<uint8_t> kTestKeyGcm128_2{
+static const ZeroOnFreeBuffer<uint8_t> kTestKeyGcm128_2{
     "21ZYXWVUTSRQPONMLKJIHGFEDCBA", 28};
 // 256 bits key + 96 bits salt.
-static const rtc::ZeroOnFreeBuffer<uint8_t> kTestKeyGcm256_1{
+static const ZeroOnFreeBuffer<uint8_t> kTestKeyGcm256_1{
     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr", 44};
-static const rtc::ZeroOnFreeBuffer<uint8_t> kTestKeyGcm256_2{
+static const ZeroOnFreeBuffer<uint8_t> kTestKeyGcm256_2{
     "rqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA", 44};
 
 class SrtpTransportTest : public ::testing::Test, public sigslot::has_slots<> {
@@ -72,13 +72,11 @@
     srtp_transport2_->SetRtpPacketTransport(rtp_packet_transport2_.get());
 
     srtp_transport1_->SubscribeRtcpPacketReceived(
-        &rtp_sink1_,
-        [this](rtc::CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
+        &rtp_sink1_, [this](CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
           rtp_sink1_.OnRtcpPacketReceived(buffer, packet_time_ms);
         });
     srtp_transport2_->SubscribeRtcpPacketReceived(
-        &rtp_sink2_,
-        [this](rtc::CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
+        &rtp_sink2_, [this](CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
           rtp_sink2_.OnRtcpPacketReceived(buffer, packet_time_ms);
         });
 
@@ -130,26 +128,24 @@
   void TestSendRecvRtpPacket(int crypto_suite) {
     size_t rtp_len = sizeof(kPcmuFrame);
     size_t packet_size = rtp_len + rtp_auth_tag_len(crypto_suite);
-    rtc::Buffer rtp_packet_buffer(packet_size);
+    Buffer rtp_packet_buffer(packet_size);
     char* rtp_packet_data = rtp_packet_buffer.data<char>();
     memcpy(rtp_packet_data, kPcmuFrame, rtp_len);
     // In order to be able to run this test function multiple times we can not
     // use the same sequence number twice. Increase the sequence number by one.
     SetBE16(reinterpret_cast<uint8_t*>(rtp_packet_data) + 2,
             ++sequence_number_);
-    rtc::CopyOnWriteBuffer rtp_packet1to2(rtp_packet_data, rtp_len,
-                                          packet_size);
-    rtc::CopyOnWriteBuffer rtp_packet2to1(rtp_packet_data, rtp_len,
-                                          packet_size);
+    CopyOnWriteBuffer rtp_packet1to2(rtp_packet_data, rtp_len, packet_size);
+    CopyOnWriteBuffer rtp_packet2to1(rtp_packet_data, rtp_len, packet_size);
 
     char original_rtp_data[sizeof(kPcmuFrame)];
     memcpy(original_rtp_data, rtp_packet_data, rtp_len);
 
-    rtc::PacketOptions options;
+    AsyncSocketPacketOptions options;
     // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
     // that the packet can be successfully received and decrypted.
     ASSERT_TRUE(srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options,
-                                                cricket::PF_SRTP_BYPASS));
+                                                PF_SRTP_BYPASS));
     if (srtp_transport1_->IsExternalAuthActive()) {
       TestRtpAuthParams(srtp_transport1_.get(), crypto_suite);
     } else {
@@ -166,7 +162,7 @@
 
     // Do the same thing in the opposite direction;
     ASSERT_TRUE(srtp_transport2_->SendRtpPacket(&rtp_packet2to1, options,
-                                                cricket::PF_SRTP_BYPASS));
+                                                PF_SRTP_BYPASS));
     if (srtp_transport2_->IsExternalAuthActive()) {
       TestRtpAuthParams(srtp_transport2_.get(), crypto_suite);
     } else {
@@ -183,20 +179,18 @@
   void TestSendRecvRtcpPacket(int crypto_suite) {
     size_t rtcp_len = sizeof(::kRtcpReport);
     size_t packet_size = rtcp_len + 4 + rtcp_auth_tag_len(crypto_suite);
-    rtc::Buffer rtcp_packet_buffer(packet_size);
+    Buffer rtcp_packet_buffer(packet_size);
     char* rtcp_packet_data = rtcp_packet_buffer.data<char>();
     memcpy(rtcp_packet_data, ::kRtcpReport, rtcp_len);
 
-    rtc::CopyOnWriteBuffer rtcp_packet1to2(rtcp_packet_data, rtcp_len,
-                                           packet_size);
-    rtc::CopyOnWriteBuffer rtcp_packet2to1(rtcp_packet_data, rtcp_len,
-                                           packet_size);
+    CopyOnWriteBuffer rtcp_packet1to2(rtcp_packet_data, rtcp_len, packet_size);
+    CopyOnWriteBuffer rtcp_packet2to1(rtcp_packet_data, rtcp_len, packet_size);
 
-    rtc::PacketOptions options;
+    AsyncSocketPacketOptions options;
     // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
     // that the packet can be successfully received and decrypted.
     ASSERT_TRUE(srtp_transport1_->SendRtcpPacket(&rtcp_packet1to2, options,
-                                                 cricket::PF_SRTP_BYPASS));
+                                                 PF_SRTP_BYPASS));
     ASSERT_TRUE(rtp_sink2_.last_recv_rtcp_packet().data());
     EXPECT_EQ(0, memcmp(rtp_sink2_.last_recv_rtcp_packet().data(),
                         rtcp_packet_data, rtcp_len));
@@ -209,7 +203,7 @@
 
     // Do the same thing in the opposite direction;
     ASSERT_TRUE(srtp_transport2_->SendRtcpPacket(&rtcp_packet2to1, options,
-                                                 cricket::PF_SRTP_BYPASS));
+                                                 PF_SRTP_BYPASS));
     ASSERT_TRUE(rtp_sink1_.last_recv_rtcp_packet().data());
     EXPECT_EQ(0, memcmp(rtp_sink1_.last_recv_rtcp_packet().data(),
                         rtcp_packet_data, rtcp_len));
@@ -221,8 +215,8 @@
 
   void TestSendRecvPacket(bool enable_external_auth,
                           int crypto_suite,
-                          const rtc::ZeroOnFreeBuffer<uint8_t>& key1,
-                          const rtc::ZeroOnFreeBuffer<uint8_t>& key2) {
+                          const ZeroOnFreeBuffer<uint8_t>& key1,
+                          const ZeroOnFreeBuffer<uint8_t>& key2) {
     EXPECT_EQ(key1.size(), key2.size());
     if (enable_external_auth) {
       srtp_transport1_->EnableExternalAuth();
@@ -255,26 +249,24 @@
       const std::vector<int>& encrypted_header_ids) {
     size_t rtp_len = sizeof(kPcmuFrameWithExtensions);
     size_t packet_size = rtp_len + rtp_auth_tag_len(crypto_suite);
-    rtc::Buffer rtp_packet_buffer(packet_size);
+    Buffer rtp_packet_buffer(packet_size);
     char* rtp_packet_data = rtp_packet_buffer.data<char>();
     memcpy(rtp_packet_data, kPcmuFrameWithExtensions, rtp_len);
     // In order to be able to run this test function multiple times we can not
     // use the same sequence number twice. Increase the sequence number by one.
     SetBE16(reinterpret_cast<uint8_t*>(rtp_packet_data) + 2,
             ++sequence_number_);
-    rtc::CopyOnWriteBuffer rtp_packet1to2(rtp_packet_data, rtp_len,
-                                          packet_size);
-    rtc::CopyOnWriteBuffer rtp_packet2to1(rtp_packet_data, rtp_len,
-                                          packet_size);
+    CopyOnWriteBuffer rtp_packet1to2(rtp_packet_data, rtp_len, packet_size);
+    CopyOnWriteBuffer rtp_packet2to1(rtp_packet_data, rtp_len, packet_size);
 
     char original_rtp_data[sizeof(kPcmuFrameWithExtensions)];
     memcpy(original_rtp_data, rtp_packet_data, rtp_len);
 
-    rtc::PacketOptions options;
+    AsyncSocketPacketOptions options;
     // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
     // that the packet can be successfully received and decrypted.
     ASSERT_TRUE(srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options,
-                                                cricket::PF_SRTP_BYPASS));
+                                                PF_SRTP_BYPASS));
     ASSERT_TRUE(rtp_sink2_.last_recv_rtp_packet().data());
     EXPECT_EQ(0, memcmp(rtp_sink2_.last_recv_rtp_packet().data(),
                         original_rtp_data, rtp_len));
@@ -292,7 +284,7 @@
 
     // Do the same thing in the opposite direction;
     ASSERT_TRUE(srtp_transport2_->SendRtpPacket(&rtp_packet2to1, options,
-                                                cricket::PF_SRTP_BYPASS));
+                                                PF_SRTP_BYPASS));
     ASSERT_TRUE(rtp_sink1_.last_recv_rtp_packet().data());
     EXPECT_EQ(0, memcmp(rtp_sink1_.last_recv_rtp_packet().data(),
                         original_rtp_data, rtp_len));
@@ -309,8 +301,8 @@
 
   void TestSendRecvEncryptedHeaderExtension(
       int crypto_suite,
-      const rtc::ZeroOnFreeBuffer<uint8_t>& key1,
-      const rtc::ZeroOnFreeBuffer<uint8_t>& key2) {
+      const ZeroOnFreeBuffer<uint8_t>& key1,
+      const ZeroOnFreeBuffer<uint8_t>& key2) {
     std::vector<int> encrypted_headers;
     encrypted_headers.push_back(kHeaderExtensionIDs[0]);
     // Don't encrypt header ids 2 and 3.
@@ -409,15 +401,15 @@
   std::vector<int> extension_ids;
   EXPECT_FALSE(srtp_transport1_->SetRtpParams(
       kSrtpAes128CmSha1_80,
-      rtc::ZeroOnFreeBuffer<uint8_t>(kTestKey1.data(), kTestKey1.size() - 1),
+      ZeroOnFreeBuffer<uint8_t>(kTestKey1.data(), kTestKey1.size() - 1),
       extension_ids, kSrtpAes128CmSha1_80,
-      rtc::ZeroOnFreeBuffer<uint8_t>(kTestKey1.data(), kTestKey1.size() - 1),
+      ZeroOnFreeBuffer<uint8_t>(kTestKey1.data(), kTestKey1.size() - 1),
       extension_ids));
   EXPECT_FALSE(srtp_transport1_->SetRtcpParams(
       kSrtpAes128CmSha1_80,
-      rtc::ZeroOnFreeBuffer<uint8_t>(kTestKey1.data(), kTestKey1.size() - 1),
+      ZeroOnFreeBuffer<uint8_t>(kTestKey1.data(), kTestKey1.size() - 1),
       extension_ids, kSrtpAes128CmSha1_80,
-      rtc::ZeroOnFreeBuffer<uint8_t>(kTestKey1.data(), kTestKey1.size() - 1),
+      ZeroOnFreeBuffer<uint8_t>(kTestKey1.data(), kTestKey1.size() - 1),
       extension_ids));
 }
 
@@ -449,22 +441,22 @@
   // Create a packet and try to send it three times.
   size_t rtp_len = sizeof(kPcmuFrame);
   size_t packet_size = rtp_len + rtp_auth_tag_len(kSrtpAeadAes128Gcm);
-  rtc::Buffer rtp_packet_buffer(packet_size);
+  Buffer rtp_packet_buffer(packet_size);
   char* rtp_packet_data = rtp_packet_buffer.data<char>();
   memcpy(rtp_packet_data, kPcmuFrame, rtp_len);
 
   // First attempt will succeed.
-  rtc::CopyOnWriteBuffer first_try(rtp_packet_data, rtp_len, packet_size);
-  EXPECT_TRUE(srtp_transport->SendRtpPacket(&first_try, rtc::PacketOptions(),
-                                            cricket::PF_SRTP_BYPASS));
+  CopyOnWriteBuffer first_try(rtp_packet_data, rtp_len, packet_size);
+  EXPECT_TRUE(srtp_transport->SendRtpPacket(
+      &first_try, AsyncSocketPacketOptions(), PF_SRTP_BYPASS));
   EXPECT_EQ(rtp_sink.rtp_count(), 1);
 
   // Second attempt will be rejected by libSRTP as a replay attack
   // (srtp_err_status_replay_fail) since the sequence number was already seen.
   // Hence the packet never reaches the sink.
-  rtc::CopyOnWriteBuffer second_try(rtp_packet_data, rtp_len, packet_size);
-  EXPECT_TRUE(srtp_transport->SendRtpPacket(&second_try, rtc::PacketOptions(),
-                                            cricket::PF_SRTP_BYPASS));
+  CopyOnWriteBuffer second_try(rtp_packet_data, rtp_len, packet_size);
+  EXPECT_TRUE(srtp_transport->SendRtpPacket(
+      &second_try, AsyncSocketPacketOptions(), PF_SRTP_BYPASS));
   EXPECT_EQ(rtp_sink.rtp_count(), 1);
 
   // Reset the sink.
@@ -474,9 +466,9 @@
 
   // Third attempt will succeed again since libSRTP does not remember seeing
   // the sequence number after the reset.
-  rtc::CopyOnWriteBuffer third_try(rtp_packet_data, rtp_len, packet_size);
-  EXPECT_TRUE(srtp_transport->SendRtpPacket(&third_try, rtc::PacketOptions(),
-                                            cricket::PF_SRTP_BYPASS));
+  CopyOnWriteBuffer third_try(rtp_packet_data, rtp_len, packet_size);
+  EXPECT_TRUE(srtp_transport->SendRtpPacket(
+      &third_try, AsyncSocketPacketOptions(), PF_SRTP_BYPASS));
   EXPECT_EQ(rtp_sink.rtp_count(), 2);
   // Clear the sink to clean up.
   srtp_transport->UnregisterRtpDemuxerSink(&rtp_sink);
diff --git a/pc/stream_collection.h b/pc/stream_collection.h
index f0f3f07..d417b77 100644
--- a/pc/stream_collection.h
+++ b/pc/stream_collection.h
@@ -22,13 +22,12 @@
 // Implementation of StreamCollection.
 class StreamCollection : public StreamCollectionInterface {
  public:
-  static rtc::scoped_refptr<StreamCollection> Create() {
-    return rtc::make_ref_counted<StreamCollection>();
+  static scoped_refptr<StreamCollection> Create() {
+    return make_ref_counted<StreamCollection>();
   }
 
-  static rtc::scoped_refptr<StreamCollection> Create(
-      StreamCollection* streams) {
-    return rtc::make_ref_counted<StreamCollection>(streams);
+  static scoped_refptr<StreamCollection> Create(StreamCollection* streams) {
+    return make_ref_counted<StreamCollection>(streams);
   }
 
   virtual size_t count() { return media_streams_.size(); }
@@ -69,7 +68,7 @@
     return NULL;
   }
 
-  void AddStream(rtc::scoped_refptr<MediaStreamInterface> stream) {
+  void AddStream(scoped_refptr<MediaStreamInterface> stream) {
     for (StreamVector::iterator it = media_streams_.begin();
          it != media_streams_.end(); ++it) {
       if ((*it)->id().compare(stream->id()) == 0)
@@ -92,7 +91,7 @@
   StreamCollection() {}
   explicit StreamCollection(StreamCollection* original)
       : media_streams_(original->media_streams_) {}
-  typedef std::vector<rtc::scoped_refptr<MediaStreamInterface> > StreamVector;
+  typedef std::vector<scoped_refptr<MediaStreamInterface> > StreamVector;
   StreamVector media_streams_;
 };
 
diff --git a/pc/test/android_test_initializer.cc b/pc/test/android_test_initializer.cc
index 88b4587..db180ac 100644
--- a/pc/test/android_test_initializer.cc
+++ b/pc/test/android_test_initializer.cc
@@ -37,7 +37,7 @@
   JavaVM* jvm = NULL;
   RTC_CHECK_EQ(0, jni->GetJavaVM(&jvm));
 
-  RTC_CHECK(rtc::InitializeSSL()) << "Failed to InitializeSSL()";
+  RTC_CHECK(webrtc::InitializeSSL()) << "Failed to InitializeSSL()";
 
   JVM::Initialize(jvm);
 }
diff --git a/pc/test/fake_audio_capture_module.cc b/pc/test/fake_audio_capture_module.cc
index fc5e2ea..b9e42947 100644
--- a/pc/test/fake_audio_capture_module.cc
+++ b/pc/test/fake_audio_capture_module.cc
@@ -58,8 +58,8 @@
   }
 }
 
-rtc::scoped_refptr<FakeAudioCaptureModule> FakeAudioCaptureModule::Create() {
-  auto capture_module = rtc::make_ref_counted<FakeAudioCaptureModule>();
+webrtc::scoped_refptr<FakeAudioCaptureModule> FakeAudioCaptureModule::Create() {
+  auto capture_module = webrtc::make_ref_counted<FakeAudioCaptureModule>();
   if (!capture_module->Initialize()) {
     return nullptr;
   }
diff --git a/pc/test/fake_audio_capture_module.h b/pc/test/fake_audio_capture_module.h
index bead09b..b5b1574 100644
--- a/pc/test/fake_audio_capture_module.h
+++ b/pc/test/fake_audio_capture_module.h
@@ -44,7 +44,7 @@
   static const size_t kNumberBytesPerSample = sizeof(Sample);
 
   // Creates a FakeAudioCaptureModule or returns NULL on failure.
-  static rtc::scoped_refptr<FakeAudioCaptureModule> Create();
+  static webrtc::scoped_refptr<FakeAudioCaptureModule> Create();
 
   // Returns the number of frames that have been successfully pulled by the
   // instance. Note that correctly detecting success can only be done if the
diff --git a/pc/test/fake_audio_capture_module_unittest.cc b/pc/test/fake_audio_capture_module_unittest.cc
index 828dff7..8a81e88 100644
--- a/pc/test/fake_audio_capture_module_unittest.cc
+++ b/pc/test/fake_audio_capture_module_unittest.cc
@@ -105,7 +105,7 @@
     return pull_iterations_;
   }
 
-  rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
+  webrtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
 
  private:
   bool RecordedDataReceived() const { return rec_buffer_bytes_ != 0; }
diff --git a/pc/test/fake_data_channel_controller.h b/pc/test/fake_data_channel_controller.h
index ac70aea..1fa865c 100644
--- a/pc/test/fake_data_channel_controller.h
+++ b/pc/test/fake_data_channel_controller.h
@@ -55,10 +55,10 @@
     return weak_factory_.GetWeakPtr();
   }
 
-  rtc::scoped_refptr<webrtc::SctpDataChannel> CreateDataChannel(
+  webrtc::scoped_refptr<webrtc::SctpDataChannel> CreateDataChannel(
       absl::string_view label,
       webrtc::InternalDataChannelInit init) {
-    rtc::scoped_refptr<webrtc::SctpDataChannel> channel =
+    webrtc::scoped_refptr<webrtc::SctpDataChannel> channel =
         network_thread_->BlockingCall([&]() {
           RTC_DCHECK_RUN_ON(network_thread_);
           webrtc::WeakPtr<FakeDataChannelController> my_weak_ptr = weak_ptr();
@@ -67,7 +67,7 @@
           // thread.
           RTC_CHECK(my_weak_ptr);
 
-          rtc::scoped_refptr<webrtc::SctpDataChannel> channel =
+          webrtc::scoped_refptr<webrtc::SctpDataChannel> channel =
               webrtc::SctpDataChannel::Create(
                   std::move(my_weak_ptr), std::string(label),
                   transport_available_, init, signaling_thread_,
@@ -91,7 +91,7 @@
 
   webrtc::RTCError SendData(webrtc::StreamId sid,
                             const webrtc::SendDataParams& params,
-                            const rtc::CopyOnWriteBuffer& payload) override {
+                            const webrtc::CopyOnWriteBuffer& payload) override {
     RTC_DCHECK_RUN_ON(network_thread_);
     RTC_CHECK(ready_to_send_);
     RTC_CHECK(transport_available_);
diff --git a/pc/test/fake_peer_connection_base.h b/pc/test/fake_peer_connection_base.h
index 96a054d..10e54ca 100644
--- a/pc/test/fake_peer_connection_base.h
+++ b/pc/test/fake_peer_connection_base.h
@@ -75,11 +75,11 @@
  public:
   // PeerConnectionInterface implementation.
 
-  rtc::scoped_refptr<StreamCollectionInterface> local_streams() override {
+  scoped_refptr<StreamCollectionInterface> local_streams() override {
     return nullptr;
   }
 
-  rtc::scoped_refptr<StreamCollectionInterface> remote_streams() override {
+  scoped_refptr<StreamCollectionInterface> remote_streams() override {
     return nullptr;
   }
 
@@ -87,63 +87,62 @@
 
   void RemoveStream(MediaStreamInterface* stream) override {}
 
-  RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrack(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  RTCErrorOr<scoped_refptr<RtpSenderInterface>> AddTrack(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<std::string>& stream_ids) override {
     return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
   }
 
-  RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrack(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  RTCErrorOr<scoped_refptr<RtpSenderInterface>> AddTrack(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<std::string>& stream_ids,
       const std::vector<RtpEncodingParameters>& init_send_encodings) override {
     return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
   }
 
   RTCError RemoveTrackOrError(
-      rtc::scoped_refptr<RtpSenderInterface> sender) override {
+      scoped_refptr<RtpSenderInterface> sender) override {
     return RTCError(RTCErrorType::UNSUPPORTED_OPERATION);
   }
 
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track) override {
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
+      scoped_refptr<MediaStreamTrackInterface> track) override {
     return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
   }
 
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const RtpTransceiverInit& init) override {
     return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
   }
 
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
       webrtc::MediaType media_type) override {
     return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
   }
 
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
       webrtc::MediaType media_type,
       const RtpTransceiverInit& init) override {
     return RTCError(RTCErrorType::UNSUPPORTED_OPERATION, "Not implemented");
   }
 
-  rtc::scoped_refptr<RtpSenderInterface> CreateSender(
+  scoped_refptr<RtpSenderInterface> CreateSender(
       const std::string& kind,
       const std::string& stream_id) override {
     return nullptr;
   }
 
-  std::vector<rtc::scoped_refptr<RtpSenderInterface>> GetSenders()
+  std::vector<scoped_refptr<RtpSenderInterface>> GetSenders() const override {
+    return {};
+  }
+
+  std::vector<scoped_refptr<RtpReceiverInterface>> GetReceivers()
       const override {
     return {};
   }
 
-  std::vector<rtc::scoped_refptr<RtpReceiverInterface>> GetReceivers()
-      const override {
-    return {};
-  }
-
-  std::vector<rtc::scoped_refptr<RtpTransceiverInterface>> GetTransceivers()
+  std::vector<scoped_refptr<RtpTransceiverInterface>> GetTransceivers()
       const override {
     return {};
   }
@@ -155,20 +154,18 @@
   }
 
   void GetStats(RTCStatsCollectorCallback* callback) override {}
-  void GetStats(
-      rtc::scoped_refptr<RtpSenderInterface> selector,
-      rtc::scoped_refptr<RTCStatsCollectorCallback> callback) override {}
-  void GetStats(
-      rtc::scoped_refptr<RtpReceiverInterface> selector,
-      rtc::scoped_refptr<RTCStatsCollectorCallback> callback) override {}
+  void GetStats(scoped_refptr<RtpSenderInterface> selector,
+                scoped_refptr<RTCStatsCollectorCallback> callback) override {}
+  void GetStats(scoped_refptr<RtpReceiverInterface> selector,
+                scoped_refptr<RTCStatsCollectorCallback> callback) override {}
 
   void ClearStatsCache() override {}
 
-  rtc::scoped_refptr<SctpTransportInterface> GetSctpTransport() const {
+  scoped_refptr<SctpTransportInterface> GetSctpTransport() const {
     return nullptr;
   }
 
-  RTCErrorOr<rtc::scoped_refptr<DataChannelInterface>> CreateDataChannelOrError(
+  RTCErrorOr<scoped_refptr<DataChannelInterface>> CreateDataChannelOrError(
       const std::string& label,
       const DataChannelInit* config) override {
     return RTCError(RTCErrorType::UNSUPPORTED_OPERATION,
@@ -216,8 +213,7 @@
 
   void SetRemoteDescription(
       std::unique_ptr<SessionDescriptionInterface> desc,
-      rtc::scoped_refptr<SetRemoteDescriptionObserverInterface> observer)
-      override {}
+      scoped_refptr<SetRemoteDescriptionObserverInterface> observer) override {}
 
   bool ShouldFireNegotiationNeededEvent(uint32_t event_id) { return true; }
 
@@ -247,7 +243,7 @@
 
   void SetAudioRecording(bool recording) override {}
 
-  rtc::scoped_refptr<DtlsTransportInterface> LookupDtlsTransportByMid(
+  scoped_refptr<DtlsTransportInterface> LookupDtlsTransportByMid(
       const std::string& mid) {
     return nullptr;
   }
@@ -272,7 +268,7 @@
 
   std::optional<bool> can_trickle_ice_candidates() { return std::nullopt; }
 
-  void AddAdaptationResource(rtc::scoped_refptr<Resource> resource) {}
+  void AddAdaptationResource(scoped_refptr<Resource> resource) {}
 
   bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
                         int64_t output_period_ms) override {
@@ -300,8 +296,7 @@
 
   bool initial_offerer() const override { return false; }
 
-  std::vector<
-      rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
+  std::vector<scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
   GetTransceiversInternal() const override {
     return {};
   }
@@ -325,7 +320,7 @@
 
   bool GetLocalCertificate(
       const std::string& transport_name,
-      rtc::scoped_refptr<RTCCertificate>* certificate) override {
+      scoped_refptr<RTCCertificate>* certificate) override {
     return false;
   }
 
@@ -365,7 +360,7 @@
   JsepTransportController* transport_controller_s() override { return nullptr; }
   JsepTransportController* transport_controller_n() override { return nullptr; }
   DataChannelController* data_channel_controller() override { return nullptr; }
-  cricket::PortAllocator* port_allocator() override { return nullptr; }
+  PortAllocator* port_allocator() override { return nullptr; }
   LegacyStatsCollector* legacy_stats() override { return nullptr; }
   PeerConnectionObserver* Observer() const override { return nullptr; }
   std::optional<SSLRole> GetSctpSslRole_n() override { return std::nullopt; }
@@ -378,16 +373,15 @@
   void NoteUsageEvent(UsageEvent event) override {}
   bool IsClosed() const override { return false; }
   bool IsUnifiedPlan() const override { return true; }
-  bool ValidateBundleSettings(
-      const cricket::SessionDescription* desc,
-      const std::map<std::string, const cricket::ContentGroup*>&
-          bundle_groups_by_mid) override {
+  bool ValidateBundleSettings(const SessionDescription* desc,
+                              const std::map<std::string, const ContentGroup*>&
+                                  bundle_groups_by_mid) override {
     return false;
   }
 
-  RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
+  RTCErrorOr<scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
       webrtc::MediaType media_type,
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+      scoped_refptr<MediaStreamTrackInterface> track,
       const RtpTransceiverInit& init,
       bool fire_callback = true) override {
     return RTCError(RTCErrorType::INTERNAL_ERROR, "");
@@ -416,9 +410,7 @@
     return payload_type_picker_;
   }
 
-  cricket::CandidateStatsList GetPooledCandidateStats() const override {
-    return {};
-  }
+  CandidateStatsList GetPooledCandidateStats() const override { return {}; }
 
  protected:
   test::ScopedKeyValueConfig field_trials_;
@@ -426,7 +418,7 @@
 };
 
 static_assert(
-    !std::is_abstract_v<rtc::RefCountedObject<FakePeerConnectionBase>>,
+    !std::is_abstract_v<webrtc::RefCountedObject<FakePeerConnectionBase>>,
     "");
 
 }  // namespace webrtc
diff --git a/pc/test/fake_peer_connection_for_stats.h b/pc/test/fake_peer_connection_for_stats.h
index 0691f06f..809b03e 100644
--- a/pc/test/fake_peer_connection_for_stats.h
+++ b/pc/test/fake_peer_connection_for_stats.h
@@ -62,12 +62,10 @@
 namespace webrtc {
 
 // Fake VoiceMediaChannel where the result of GetStats can be configured.
-class FakeVoiceMediaSendChannelForStats
-    : public cricket::FakeVoiceMediaSendChannel {
+class FakeVoiceMediaSendChannelForStats : public FakeVoiceMediaSendChannel {
  public:
   explicit FakeVoiceMediaSendChannelForStats(TaskQueueBase* network_thread)
-      : cricket::FakeVoiceMediaSendChannel(cricket::AudioOptions(),
-                                           network_thread) {}
+      : FakeVoiceMediaSendChannel(AudioOptions(), network_thread) {}
 
   void SetStats(const VoiceMediaInfo& voice_info) {
     send_stats_ = VoiceMediaSendInfo();
@@ -89,11 +87,10 @@
 };
 
 class FakeVoiceMediaReceiveChannelForStats
-    : public cricket::FakeVoiceMediaReceiveChannel {
+    : public FakeVoiceMediaReceiveChannel {
  public:
   explicit FakeVoiceMediaReceiveChannelForStats(TaskQueueBase* network_thread)
-      : cricket::FakeVoiceMediaReceiveChannel(cricket::AudioOptions(),
-                                              network_thread) {}
+      : FakeVoiceMediaReceiveChannel(AudioOptions(), network_thread) {}
 
   void SetStats(const VoiceMediaInfo& voice_info) {
     receive_stats_ = VoiceMediaReceiveInfo();
@@ -117,11 +114,10 @@
 };
 
 // Fake VideoMediaChannel where the result of GetStats can be configured.
-class FakeVideoMediaSendChannelForStats
-    : public cricket::FakeVideoMediaSendChannel {
+class FakeVideoMediaSendChannelForStats : public FakeVideoMediaSendChannel {
  public:
   explicit FakeVideoMediaSendChannelForStats(TaskQueueBase* network_thread)
-      : cricket::FakeVideoMediaSendChannel(VideoOptions(), network_thread) {}
+      : FakeVideoMediaSendChannel(VideoOptions(), network_thread) {}
 
   void SetStats(const VideoMediaInfo& video_info) {
     send_stats_ = VideoMediaSendInfo();
@@ -144,10 +140,10 @@
 };
 
 class FakeVideoMediaReceiveChannelForStats
-    : public cricket::FakeVideoMediaReceiveChannel {
+    : public FakeVideoMediaReceiveChannel {
  public:
   explicit FakeVideoMediaReceiveChannelForStats(TaskQueueBase* network_thread)
-      : cricket::FakeVideoMediaReceiveChannel(VideoOptions(), network_thread) {}
+      : FakeVideoMediaReceiveChannel(VideoOptions(), network_thread) {}
 
   void SetStats(const VideoMediaInfo& video_info) {
     receive_stats_ = VideoMediaReceiveInfo();
@@ -171,7 +167,7 @@
 constexpr bool kDefaultRtcpMuxRequired = true;
 constexpr bool kDefaultSrtpRequired = true;
 
-class VoiceChannelForTesting : public cricket::VoiceChannel {
+class VoiceChannelForTesting : public VoiceChannel {
  public:
   VoiceChannelForTesting(
       Thread* worker_thread,
@@ -182,7 +178,7 @@
       const std::string& content_name,
       bool srtp_required,
       CryptoOptions crypto_options,
-      rtc::UniqueRandomIdGenerator* ssrc_generator,
+      UniqueRandomIdGenerator* ssrc_generator,
       std::string transport_name)
       : VoiceChannel(worker_thread,
                      network_thread,
@@ -203,7 +199,7 @@
   const std::string test_transport_name_;
 };
 
-class VideoChannelForTesting : public cricket::VideoChannel {
+class VideoChannelForTesting : public VideoChannel {
  public:
   VideoChannelForTesting(
       Thread* worker_thread,
@@ -214,7 +210,7 @@
       const std::string& content_name,
       bool srtp_required,
       CryptoOptions crypto_options,
-      rtc::UniqueRandomIdGenerator* ssrc_generator,
+      UniqueRandomIdGenerator* ssrc_generator,
       std::string transport_name)
       : VideoChannel(worker_thread,
                      network_thread,
@@ -271,16 +267,16 @@
     return dependencies;
   }
 
-  rtc::scoped_refptr<StreamCollection> mutable_local_streams() {
+  scoped_refptr<StreamCollection> mutable_local_streams() {
     return local_streams_;
   }
 
-  rtc::scoped_refptr<StreamCollection> mutable_remote_streams() {
+  scoped_refptr<StreamCollection> mutable_remote_streams() {
     return remote_streams_;
   }
 
-  rtc::scoped_refptr<RtpSenderInterface> AddSender(
-      rtc::scoped_refptr<RtpSenderInternal> sender) {
+  scoped_refptr<RtpSenderInterface> AddSender(
+      scoped_refptr<RtpSenderInternal> sender) {
     // TODO(steveanton): Switch tests to use RtpTransceivers directly.
     auto sender_proxy = RtpSenderProxyWithInternal<RtpSenderInternal>::Create(
         signaling_thread_, sender);
@@ -290,14 +286,14 @@
     return sender_proxy;
   }
 
-  void RemoveSender(rtc::scoped_refptr<RtpSenderInterface> sender) {
+  void RemoveSender(scoped_refptr<RtpSenderInterface> sender) {
     GetOrCreateFirstTransceiverOfType(sender->media_type())
         ->internal()
         ->RemoveSender(sender.get());
   }
 
-  rtc::scoped_refptr<RtpReceiverInterface> AddReceiver(
-      rtc::scoped_refptr<RtpReceiverInternal> receiver) {
+  scoped_refptr<RtpReceiverInterface> AddReceiver(
+      scoped_refptr<RtpReceiverInternal> receiver) {
     // TODO(steveanton): Switch tests to use RtpTransceivers directly.
     auto receiver_proxy =
         RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create(
@@ -308,7 +304,7 @@
     return receiver_proxy;
   }
 
-  void RemoveReceiver(rtc::scoped_refptr<RtpReceiverInterface> receiver) {
+  void RemoveReceiver(scoped_refptr<RtpReceiverInterface> receiver) {
     GetOrCreateFirstTransceiverOfType(receiver->media_type())
         ->internal()
         ->RemoveReceiver(receiver.get());
@@ -390,7 +386,7 @@
         Thread::Current(), Thread::Current()));
   }
 
-  void AddSctpDataChannel(rtc::scoped_refptr<SctpDataChannel> data_channel) {
+  void AddSctpDataChannel(scoped_refptr<SctpDataChannel> data_channel) {
     sctp_data_channels_.push_back(data_channel);
   }
 
@@ -417,7 +413,7 @@
   }
 
   void SetLocalCertificate(const std::string& transport_name,
-                           rtc::scoped_refptr<RTCCertificate> certificate) {
+                           scoped_refptr<RTCCertificate> certificate) {
     local_certificates_by_transport_[transport_name] = certificate;
   }
 
@@ -428,17 +424,16 @@
 
   // PeerConnectionInterface overrides.
 
-  rtc::scoped_refptr<StreamCollectionInterface> local_streams() override {
+  scoped_refptr<StreamCollectionInterface> local_streams() override {
     return local_streams_;
   }
 
-  rtc::scoped_refptr<StreamCollectionInterface> remote_streams() override {
+  scoped_refptr<StreamCollectionInterface> remote_streams() override {
     return remote_streams_;
   }
 
-  std::vector<rtc::scoped_refptr<RtpSenderInterface>> GetSenders()
-      const override {
-    std::vector<rtc::scoped_refptr<RtpSenderInterface>> senders;
+  std::vector<scoped_refptr<RtpSenderInterface>> GetSenders() const override {
+    std::vector<scoped_refptr<RtpSenderInterface>> senders;
     for (auto transceiver : transceivers_) {
       for (auto sender : transceiver->internal()->senders()) {
         senders.push_back(sender);
@@ -447,9 +442,9 @@
     return senders;
   }
 
-  std::vector<rtc::scoped_refptr<RtpReceiverInterface>> GetReceivers()
+  std::vector<scoped_refptr<RtpReceiverInterface>> GetReceivers()
       const override {
-    std::vector<rtc::scoped_refptr<RtpReceiverInterface>> receivers;
+    std::vector<scoped_refptr<RtpReceiverInterface>> receivers;
     for (auto transceiver : transceivers_) {
       for (auto receiver : transceiver->internal()->receivers()) {
         receivers.push_back(receiver);
@@ -466,8 +461,7 @@
 
   Thread* signaling_thread() const override { return signaling_thread_; }
 
-  std::vector<
-      rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
+  std::vector<scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
   GetTransceiversInternal() const override {
     return transceivers_;
   }
@@ -480,9 +474,7 @@
     return stats;
   }
 
-  cricket::CandidateStatsList GetPooledCandidateStats() const override {
-    return {};
-  }
+  CandidateStatsList GetPooledCandidateStats() const override { return {}; }
 
   std::map<std::string, TransportStats> GetTransportStatsByNames(
       const std::set<std::string>& transport_names) override {
@@ -503,7 +495,7 @@
 
   bool GetLocalCertificate(
       const std::string& transport_name,
-      rtc::scoped_refptr<RTCCertificate>* certificate) override {
+      scoped_refptr<RTCCertificate>* certificate) override {
     auto it = local_certificates_by_transport_.find(transport_name);
     if (it != local_certificates_by_transport_.end()) {
       *certificate = it->second;
@@ -540,7 +532,7 @@
     return transport_stats;
   }
 
-  rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+  scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
   GetOrCreateFirstTransceiverOfType(webrtc::MediaType media_type) {
     for (auto transceiver : transceivers_) {
       if (transceiver->internal()->media_type() == media_type) {
@@ -550,12 +542,12 @@
     return CreateTransceiverOfType(media_type);
   }
 
-  rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+  scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
   CreateTransceiverOfType(webrtc::MediaType media_type) {
     auto transceiver = RtpTransceiverProxyWithInternal<RtpTransceiver>::Create(
         signaling_thread_,
-        rtc::make_ref_counted<RtpTransceiver>(media_type, context_.get(),
-                                              &codec_lookup_helper_));
+        make_ref_counted<RtpTransceiver>(media_type, context_.get(),
+                                         &codec_lookup_helper_));
     transceivers_.push_back(transceiver);
     return transceiver;
   }
@@ -565,18 +557,17 @@
   Thread* const signaling_thread_;
 
   PeerConnectionFactoryDependencies dependencies_;
-  rtc::scoped_refptr<ConnectionContext> context_;
+  scoped_refptr<ConnectionContext> context_;
 
-  rtc::scoped_refptr<StreamCollection> local_streams_;
-  rtc::scoped_refptr<StreamCollection> remote_streams_;
+  scoped_refptr<StreamCollection> local_streams_;
+  scoped_refptr<StreamCollection> remote_streams_;
 
-  std::vector<
-      rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
+  std::vector<scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>
       transceivers_;
 
   FakeDataChannelController data_channel_controller_;
 
-  std::vector<rtc::scoped_refptr<SctpDataChannel>> sctp_data_channels_;
+  std::vector<scoped_refptr<SctpDataChannel>> sctp_data_channels_;
 
   std::map<std::string, TransportStats> transport_stats_by_name_;
 
@@ -584,7 +575,7 @@
 
   std::optional<AudioDeviceModule::Stats> audio_device_stats_;
 
-  std::map<std::string, rtc::scoped_refptr<RTCCertificate>>
+  std::map<std::string, scoped_refptr<RTCCertificate>>
       local_certificates_by_transport_;
   std::map<std::string, std::unique_ptr<SSLCertChain>>
       remote_cert_chains_by_transport_;
diff --git a/pc/test/fake_periodic_video_source.h b/pc/test/fake_periodic_video_source.h
index 6a79b18..3b8a0b3 100644
--- a/pc/test/fake_periodic_video_source.h
+++ b/pc/test/fake_periodic_video_source.h
@@ -72,12 +72,12 @@
     return wants_;
   }
 
-  void RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) override {
+  void RemoveSink(VideoSinkInterface<VideoFrame>* sink) override {
     RTC_DCHECK(thread_checker_.IsCurrent());
     broadcaster_.RemoveSink(sink);
   }
 
-  void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
+  void AddOrUpdateSink(VideoSinkInterface<VideoFrame>* sink,
                        const VideoSinkWants& wants) override {
     RTC_DCHECK(thread_checker_.IsCurrent());
     {
@@ -96,8 +96,8 @@
  private:
   SequenceChecker thread_checker_{SequenceChecker::kDetached};
 
-  rtc::VideoBroadcaster broadcaster_;
-  cricket::FakeFrameSource frame_source_;
+  VideoBroadcaster broadcaster_;
+  FakeFrameSource frame_source_;
   mutable Mutex mutex_;
   VideoSinkWants wants_ RTC_GUARDED_BY(&mutex_);
 
diff --git a/pc/test/fake_rtc_certificate_generator.h b/pc/test/fake_rtc_certificate_generator.h
index 90ae666..64879c1 100644
--- a/pc/test/fake_rtc_certificate_generator.h
+++ b/pc/test/fake_rtc_certificate_generator.h
@@ -164,7 +164,7 @@
         });
   }
 
-  static rtc::scoped_refptr<webrtc::RTCCertificate> GenerateCertificate() {
+  static webrtc::scoped_refptr<webrtc::RTCCertificate> GenerateCertificate() {
     switch (webrtc::KT_DEFAULT) {
       case webrtc::KT_RSA:
         return webrtc::RTCCertificate::FromPEM(kRsaPems[0]);
@@ -212,7 +212,7 @@
       ++generated_failures_;
       std::move(callback)(nullptr);
     } else {
-      rtc::scoped_refptr<webrtc::RTCCertificate> certificate =
+      webrtc::scoped_refptr<webrtc::RTCCertificate> certificate =
           webrtc::RTCCertificate::FromPEM(get_pem(key_type));
       RTC_DCHECK(certificate);
       ++generated_certificates_;
diff --git a/pc/test/fake_video_track_renderer.h b/pc/test/fake_video_track_renderer.h
index 3362e09..b45727b 100644
--- a/pc/test/fake_video_track_renderer.h
+++ b/pc/test/fake_video_track_renderer.h
@@ -18,7 +18,7 @@
 
 namespace webrtc {
 
-class FakeVideoTrackRenderer : public cricket::FakeVideoRenderer {
+class FakeVideoTrackRenderer : public FakeVideoRenderer {
  public:
   explicit FakeVideoTrackRenderer(VideoTrackInterface* video_track)
       : video_track_(video_track) {
@@ -27,7 +27,7 @@
   ~FakeVideoTrackRenderer() { video_track_->RemoveSink(this); }
 
  private:
-  rtc::scoped_refptr<VideoTrackInterface> video_track_;
+  scoped_refptr<VideoTrackInterface> video_track_;
 };
 
 }  // namespace webrtc
diff --git a/pc/test/fake_video_track_source.h b/pc/test/fake_video_track_source.h
index a04a25d..df56f62 100644
--- a/pc/test/fake_video_track_source.h
+++ b/pc/test/fake_video_track_source.h
@@ -24,13 +24,11 @@
 // injection of frames.
 class FakeVideoTrackSource : public VideoTrackSource {
  public:
-  static rtc::scoped_refptr<FakeVideoTrackSource> Create(bool is_screencast) {
-    return rtc::make_ref_counted<FakeVideoTrackSource>(is_screencast);
+  static scoped_refptr<FakeVideoTrackSource> Create(bool is_screencast) {
+    return make_ref_counted<FakeVideoTrackSource>(is_screencast);
   }
 
-  static rtc::scoped_refptr<FakeVideoTrackSource> Create() {
-    return Create(false);
-  }
+  static scoped_refptr<FakeVideoTrackSource> Create() { return Create(false); }
 
   bool is_screencast() const override { return is_screencast_; }
 
@@ -43,13 +41,13 @@
       : VideoTrackSource(false /* remote */), is_screencast_(is_screencast) {}
   ~FakeVideoTrackSource() override = default;
 
-  rtc::VideoSourceInterface<VideoFrame>* source() override {
+  VideoSourceInterface<VideoFrame>* source() override {
     return &video_broadcaster_;
   }
 
  private:
   const bool is_screencast_;
-  rtc::VideoBroadcaster video_broadcaster_;
+  VideoBroadcaster video_broadcaster_;
 };
 
 }  // namespace webrtc
diff --git a/pc/test/integration_test_helpers.h b/pc/test/integration_test_helpers.h
index 23e03f1..63ba210 100644
--- a/pc/test/integration_test_helpers.h
+++ b/pc/test/integration_test_helpers.h
@@ -339,19 +339,19 @@
     ResetRtpSenderObservers();
   }
 
-  rtc::scoped_refptr<RtpSenderInterface> AddAudioTrack() {
+  scoped_refptr<RtpSenderInterface> AddAudioTrack() {
     return AddTrack(CreateLocalAudioTrack());
   }
 
-  rtc::scoped_refptr<RtpSenderInterface> AddVideoTrack() {
+  scoped_refptr<RtpSenderInterface> AddVideoTrack() {
     return AddTrack(CreateLocalVideoTrack());
   }
 
-  rtc::scoped_refptr<AudioTrackInterface> CreateLocalAudioTrack() {
+  scoped_refptr<AudioTrackInterface> CreateLocalAudioTrack() {
     AudioOptions options;
     // Disable highpass filter so that we can get all the test audio frames.
     options.highpass_filter = false;
-    rtc::scoped_refptr<AudioSourceInterface> source =
+    scoped_refptr<AudioSourceInterface> source =
         peer_connection_factory_->CreateAudioSource(options);
     // TODO(perkj): Test audio source when it is implemented. Currently audio
     // always use the default input.
@@ -359,18 +359,18 @@
                                                       source.get());
   }
 
-  rtc::scoped_refptr<VideoTrackInterface> CreateLocalVideoTrack() {
+  scoped_refptr<VideoTrackInterface> CreateLocalVideoTrack() {
     FakePeriodicVideoSource::Config config;
     config.timestamp_offset_ms = TimeMillis();
     return CreateLocalVideoTrackInternal(config);
   }
 
-  rtc::scoped_refptr<VideoTrackInterface> CreateLocalVideoTrackWithConfig(
+  scoped_refptr<VideoTrackInterface> CreateLocalVideoTrackWithConfig(
       FakePeriodicVideoSource::Config config) {
     return CreateLocalVideoTrackInternal(config);
   }
 
-  rtc::scoped_refptr<VideoTrackInterface> CreateLocalVideoTrackWithRotation(
+  scoped_refptr<VideoTrackInterface> CreateLocalVideoTrackWithRotation(
       VideoRotation rotation) {
     FakePeriodicVideoSource::Config config;
     config.rotation = rotation;
@@ -378,8 +378,8 @@
     return CreateLocalVideoTrackInternal(config);
   }
 
-  rtc::scoped_refptr<RtpSenderInterface> AddTrack(
-      rtc::scoped_refptr<MediaStreamTrackInterface> track,
+  scoped_refptr<RtpSenderInterface> AddTrack(
+      scoped_refptr<MediaStreamTrackInterface> track,
       const std::vector<std::string>& stream_ids = {}) {
     EXPECT_TRUE(track);
     if (!track) {
@@ -394,9 +394,9 @@
     }
   }
 
-  std::vector<rtc::scoped_refptr<RtpReceiverInterface>> GetReceiversOfType(
+  std::vector<scoped_refptr<RtpReceiverInterface>> GetReceiversOfType(
       webrtc::MediaType media_type) {
-    std::vector<rtc::scoped_refptr<RtpReceiverInterface>> receivers;
+    std::vector<scoped_refptr<RtpReceiverInterface>> receivers;
     for (const auto& receiver : pc()->GetReceivers()) {
       if (receiver->media_type() == media_type) {
         receivers.push_back(receiver);
@@ -405,7 +405,7 @@
     return receivers;
   }
 
-  rtc::scoped_refptr<RtpTransceiverInterface> GetFirstTransceiverOfType(
+  scoped_refptr<RtpTransceiverInterface> GetFirstTransceiverOfType(
       webrtc::MediaType media_type) {
     for (auto transceiver : pc()->GetTransceivers()) {
       if (transceiver->receiver()->media_type() == media_type) {
@@ -448,7 +448,7 @@
     return data_channels_.back().get();
   }
   // Return all data channels.
-  std::vector<rtc::scoped_refptr<DataChannelInterface>>& data_channels() {
+  std::vector<scoped_refptr<DataChannelInterface>>& data_channels() {
     return data_channels_;
   }
 
@@ -492,9 +492,9 @@
 
   // Returns a MockStatsObserver in a state after stats gathering finished,
   // which can be used to access the gathered stats.
-  rtc::scoped_refptr<MockStatsObserver> OldGetStatsForTrack(
+  scoped_refptr<MockStatsObserver> OldGetStatsForTrack(
       MediaStreamTrackInterface* track) {
-    auto observer = rtc::make_ref_counted<MockStatsObserver>();
+    auto observer = make_ref_counted<MockStatsObserver>();
     EXPECT_TRUE(peer_connection_->GetStats(
         observer.get(), nullptr,
         PeerConnectionInterface::kStatsOutputLevelStandard));
@@ -505,14 +505,14 @@
   }
 
   // Version that doesn't take a track "filter", and gathers all stats.
-  rtc::scoped_refptr<MockStatsObserver> OldGetStats() {
+  scoped_refptr<MockStatsObserver> OldGetStats() {
     return OldGetStatsForTrack(nullptr);
   }
 
   // Synchronously gets stats and returns them. If it times out, fails the test
   // and returns null.
-  rtc::scoped_refptr<const RTCStatsReport> NewGetStats() {
-    auto callback = rtc::make_ref_counted<MockRTCStatsCollectorCallback>();
+  scoped_refptr<const RTCStatsReport> NewGetStats() {
+    auto callback = make_ref_counted<MockRTCStatsCollectorCallback>();
     peer_connection_->GetStats(callback.get());
     EXPECT_THAT(
         WaitUntil([&] { return callback->called(); }, ::testing::IsTrue()),
@@ -615,7 +615,7 @@
 
   void ResetRtpReceiverObservers() {
     rtp_receiver_observers_.clear();
-    for (const rtc::scoped_refptr<RtpReceiverInterface>& receiver :
+    for (const scoped_refptr<RtpReceiverInterface>& receiver :
          pc()->GetReceivers()) {
       std::unique_ptr<MockRtpReceiverObserver> observer(
           new MockRtpReceiverObserver(receiver->media_type()));
@@ -631,8 +631,7 @@
 
   void ResetRtpSenderObservers() {
     rtp_sender_observers_.clear();
-    for (const rtc::scoped_refptr<RtpSenderInterface>& sender :
-         pc()->GetSenders()) {
+    for (const scoped_refptr<RtpSenderInterface>& sender : pc()->GetSenders()) {
       std::unique_ptr<MockRtpSenderObserver> observer(
           new MockRtpSenderObserver(sender->media_type()));
       sender->SetObserver(observer.get());
@@ -667,8 +666,7 @@
 
   // Returns null on failure.
   std::unique_ptr<SessionDescriptionInterface> CreateOfferAndWait() {
-    auto observer =
-        rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+    auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
     pc()->CreateOffer(observer.get(), offer_answer_options_);
     return WaitForDescriptionFromObserver(observer.get());
   }
@@ -688,7 +686,7 @@
   }
 
   bool SetRemoteDescription(std::unique_ptr<SessionDescriptionInterface> desc) {
-    auto observer = rtc::make_ref_counted<FakeSetRemoteDescriptionObserver>();
+    auto observer = make_ref_counted<FakeSetRemoteDescriptionObserver>();
     std::string sdp;
     EXPECT_TRUE(desc->ToString(&sdp));
     RTC_LOG(LS_INFO) << debug_name_
@@ -724,7 +722,7 @@
   }
 
   uint32_t GetCorruptionScoreCount() {
-    rtc::scoped_refptr<const RTCStatsReport> report = NewGetStats();
+    scoped_refptr<const RTCStatsReport> report = NewGetStats();
     auto inbound_stream_stats =
         report->GetStatsOfType<RTCInboundRtpStreamStats>();
     for (const auto& stat : inbound_stream_stats) {
@@ -763,7 +761,7 @@
   // don't outrace the description.
   bool SetLocalDescriptionAndSendSdpMessage(
       std::unique_ptr<SessionDescriptionInterface> desc) {
-    auto observer = rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+    auto observer = make_ref_counted<MockSetSessionDescriptionObserver>();
     RTC_LOG(LS_INFO) << debug_name_ << ": SetLocalDescriptionAndSendSdpMessage";
     SdpType type = desc->GetType();
     std::string sdp;
@@ -799,7 +797,7 @@
             bool reset_decoder_factory,
             bool create_media_engine);
 
-  rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
+  scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
       const PeerConnectionInterface::RTCConfiguration* config,
       PeerConnectionDependencies dependencies) {
     PeerConnectionInterface::RTCConfiguration modified_config;
@@ -829,16 +827,16 @@
     signal_ice_candidates_ = signal;
   }
 
-  rtc::scoped_refptr<VideoTrackInterface> CreateLocalVideoTrackInternal(
+  scoped_refptr<VideoTrackInterface> CreateLocalVideoTrackInternal(
       FakePeriodicVideoSource::Config config) {
     // Set max frame rate to 10fps to reduce the risk of test flakiness.
     // TODO(deadbeef): Do something more robust.
     config.frame_interval_ms = 100;
 
     video_track_sources_.emplace_back(
-        rtc::make_ref_counted<FakePeriodicVideoTrackSource>(
-            config, false /* remote */));
-    rtc::scoped_refptr<VideoTrackInterface> track =
+        make_ref_counted<FakePeriodicVideoTrackSource>(config,
+                                                       false /* remote */));
+    scoped_refptr<VideoTrackInterface> track =
         peer_connection_factory_->CreateVideoTrack(video_track_sources_.back(),
                                                    CreateRandomUuid());
     if (!local_video_renderer_) {
@@ -887,8 +885,7 @@
 
   // Returns null on failure.
   std::unique_ptr<SessionDescriptionInterface> CreateAnswer() {
-    auto observer =
-        rtc::make_ref_counted<MockCreateSessionDescriptionObserver>();
+    auto observer = make_ref_counted<MockCreateSessionDescriptionObserver>();
     pc()->CreateAnswer(observer.get(), offer_answer_options_);
     return WaitForDescriptionFromObserver(observer.get());
   }
@@ -1020,11 +1017,11 @@
     EXPECT_EQ(pc()->signaling_state(), new_state);
     peer_connection_signaling_state_history_.push_back(new_state);
   }
-  void OnAddTrack(rtc::scoped_refptr<RtpReceiverInterface> receiver,
-                  const std::vector<rtc::scoped_refptr<MediaStreamInterface>>&
+  void OnAddTrack(scoped_refptr<RtpReceiverInterface> receiver,
+                  const std::vector<scoped_refptr<MediaStreamInterface>>&
                       streams) override {
     if (receiver->media_type() == webrtc::MediaType::VIDEO) {
-      rtc::scoped_refptr<VideoTrackInterface> video_track(
+      scoped_refptr<VideoTrackInterface> video_track(
           static_cast<VideoTrackInterface*>(receiver->track().get()));
       ASSERT_TRUE(fake_video_renderers_.find(video_track->id()) ==
                   fake_video_renderers_.end());
@@ -1032,8 +1029,7 @@
           std::make_unique<FakeVideoTrackRenderer>(video_track.get());
     }
   }
-  void OnRemoveTrack(
-      rtc::scoped_refptr<RtpReceiverInterface> receiver) override {
+  void OnRemoveTrack(scoped_refptr<RtpReceiverInterface> receiver) override {
     if (receiver->media_type() == webrtc::MediaType::VIDEO) {
       auto it = fake_video_renderers_.find(receiver->track()->id());
       if (it != fake_video_renderers_.end()) {
@@ -1120,13 +1116,13 @@
         IceCandidateErrorEvent(address, port, url, error_code, error_text);
   }
   void OnDataChannel(
-      rtc::scoped_refptr<DataChannelInterface> data_channel) override {
+      scoped_refptr<DataChannelInterface> data_channel) override {
     RTC_LOG(LS_INFO) << debug_name_ << ": OnDataChannel";
     data_channels_.push_back(data_channel);
     data_observers_.push_back(
         std::make_unique<MockDataChannelObserver>(data_channel.get()));
   }
-  bool IdExists(const cricket::RtpHeaderExtensions& extensions, int id) {
+  bool IdExists(const RtpHeaderExtensions& extensions, int id) {
     for (const auto& extension : extensions) {
       if (extension.id == id) {
         return true;
@@ -1144,11 +1140,11 @@
   // Reference to the mDNS responder owned by `fake_network_manager_` after set.
   FakeMdnsResponder* mdns_responder_ = nullptr;
 
-  rtc::scoped_refptr<PeerConnectionInterface> peer_connection_;
-  rtc::scoped_refptr<PeerConnectionFactoryInterface> peer_connection_factory_;
+  scoped_refptr<PeerConnectionInterface> peer_connection_;
+  scoped_refptr<PeerConnectionFactoryInterface> peer_connection_factory_;
 
   // Needed to keep track of number of frames sent.
-  rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
+  scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
   // Needed to keep track of number of frames received.
   std::map<std::string, std::unique_ptr<FakeVideoTrackRenderer>>
       fake_video_renderers_;
@@ -1165,7 +1161,7 @@
 
   // Store references to the video sources we've created, so that we can stop
   // them, if required.
-  std::vector<rtc::scoped_refptr<VideoTrackSource>> video_track_sources_;
+  std::vector<scoped_refptr<VideoTrackSource>> video_track_sources_;
   // `local_video_renderer_` attached to the first created local video track.
   std::unique_ptr<FakeVideoTrackRenderer> local_video_renderer_;
 
@@ -1182,7 +1178,7 @@
   SocketAddress remote_async_dns_resolved_addr_;
 
   // All data channels either created or observed on this peerconnection
-  std::vector<rtc::scoped_refptr<DataChannelInterface>> data_channels_;
+  std::vector<scoped_refptr<DataChannelInterface>> data_channels_;
   std::vector<std::unique_ptr<MockDataChannelObserver>> data_observers_;
 
   std::vector<std::unique_ptr<MockRtpReceiverObserver>> rtp_receiver_observers_;
@@ -1348,12 +1344,12 @@
 class MockIceTransportFactory : public IceTransportFactory {
  public:
   ~MockIceTransportFactory() override = default;
-  rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
+  scoped_refptr<IceTransportInterface> CreateIceTransport(
       const std::string& transport_name,
       int component,
       IceTransportInit init) {
     RecordIceTransportCreated();
-    return rtc::make_ref_counted<MockIceTransport>(transport_name, component);
+    return make_ref_counted<MockIceTransport>(transport_name, component);
   }
   MOCK_METHOD(void, RecordIceTransportCreated, ());
 };
diff --git a/pc/test/mock_channel_interface.h b/pc/test/mock_channel_interface.h
index 2fdfdd0..06a8bff 100644
--- a/pc/test/mock_channel_interface.h
+++ b/pc/test/mock_channel_interface.h
@@ -29,7 +29,7 @@
 // Mock class for BaseChannel.
 // Use this class in unit tests to avoid dependency on a specific
 // implementation of BaseChannel.
-class MockChannelInterface : public cricket::ChannelInterface {
+class MockChannelInterface : public ChannelInterface {
  public:
   MOCK_METHOD(MediaType, media_type, (), (const, override));
   MOCK_METHOD(VideoChannel*, AsVideoChannel, (), (override));
@@ -75,11 +75,11 @@
               (const webrtc::MediaContentDescription*, SdpType, std::string&),
               (override));
   MOCK_METHOD(bool, SetPayloadTypeDemuxingEnabled, (bool), (override));
-  MOCK_METHOD(const std::vector<cricket::StreamParams>&,
+  MOCK_METHOD(const std::vector<StreamParams>&,
               local_streams,
               (),
               (const, override));
-  MOCK_METHOD(const std::vector<cricket::StreamParams>&,
+  MOCK_METHOD(const std::vector<StreamParams>&,
               remote_streams,
               (),
               (const, override));
diff --git a/pc/test/mock_peer_connection_internal.h b/pc/test/mock_peer_connection_internal.h
index dc236bf..a52c9a4 100644
--- a/pc/test/mock_peer_connection_internal.h
+++ b/pc/test/mock_peer_connection_internal.h
@@ -71,61 +71,61 @@
   MockPeerConnectionInternal() {}
   ~MockPeerConnectionInternal() = default;
   // PeerConnectionInterface
-  MOCK_METHOD(rtc::scoped_refptr<StreamCollectionInterface>,
+  MOCK_METHOD(scoped_refptr<StreamCollectionInterface>,
               local_streams,
               (),
               (override));
-  MOCK_METHOD(rtc::scoped_refptr<StreamCollectionInterface>,
+  MOCK_METHOD(scoped_refptr<StreamCollectionInterface>,
               remote_streams,
               (),
               (override));
   MOCK_METHOD(bool, AddStream, (MediaStreamInterface*), (override));
   MOCK_METHOD(void, RemoveStream, (MediaStreamInterface*), (override));
-  MOCK_METHOD(RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>,
+  MOCK_METHOD(RTCErrorOr<scoped_refptr<RtpSenderInterface>>,
               AddTrack,
-              (rtc::scoped_refptr<MediaStreamTrackInterface>,
+              (webrtc::scoped_refptr<MediaStreamTrackInterface>,
                const std::vector<std::string>&),
               (override));
-  MOCK_METHOD(RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>>,
+  MOCK_METHOD(RTCErrorOr<scoped_refptr<RtpSenderInterface>>,
               AddTrack,
-              (rtc::scoped_refptr<MediaStreamTrackInterface>,
+              (webrtc::scoped_refptr<MediaStreamTrackInterface>,
                const std::vector<std::string>&,
                const std::vector<RtpEncodingParameters>&),
               (override));
   MOCK_METHOD(RTCError,
               RemoveTrackOrError,
-              (rtc::scoped_refptr<RtpSenderInterface>),
+              (webrtc::scoped_refptr<RtpSenderInterface>),
               (override));
-  MOCK_METHOD(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
+  MOCK_METHOD(RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>,
               AddTransceiver,
-              (rtc::scoped_refptr<MediaStreamTrackInterface>),
+              (webrtc::scoped_refptr<MediaStreamTrackInterface>),
               (override));
-  MOCK_METHOD(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
+  MOCK_METHOD(RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>,
               AddTransceiver,
-              (rtc::scoped_refptr<MediaStreamTrackInterface>,
+              (webrtc::scoped_refptr<MediaStreamTrackInterface>,
                const RtpTransceiverInit&),
               (override));
-  MOCK_METHOD(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
+  MOCK_METHOD(RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>,
               AddTransceiver,
               (webrtc::MediaType),
               (override));
-  MOCK_METHOD(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
+  MOCK_METHOD(RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>,
               AddTransceiver,
               (webrtc::MediaType, const RtpTransceiverInit&),
               (override));
-  MOCK_METHOD(rtc::scoped_refptr<RtpSenderInterface>,
+  MOCK_METHOD(scoped_refptr<RtpSenderInterface>,
               CreateSender,
               (const std::string&, const std::string&),
               (override));
-  MOCK_METHOD(std::vector<rtc::scoped_refptr<RtpSenderInterface>>,
+  MOCK_METHOD(std::vector<scoped_refptr<RtpSenderInterface>>,
               GetSenders,
               (),
               (const, override));
-  MOCK_METHOD(std::vector<rtc::scoped_refptr<RtpReceiverInterface>>,
+  MOCK_METHOD(std::vector<scoped_refptr<RtpReceiverInterface>>,
               GetReceivers,
               (),
               (const, override));
-  MOCK_METHOD(std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>,
+  MOCK_METHOD(std::vector<scoped_refptr<RtpTransceiverInterface>>,
               GetTransceivers,
               (),
               (const, override));
@@ -136,16 +136,16 @@
   MOCK_METHOD(void, GetStats, (RTCStatsCollectorCallback*), (override));
   MOCK_METHOD(void,
               GetStats,
-              (rtc::scoped_refptr<RtpSenderInterface>,
-               rtc::scoped_refptr<RTCStatsCollectorCallback>),
+              (webrtc::scoped_refptr<RtpSenderInterface>,
+               webrtc::scoped_refptr<RTCStatsCollectorCallback>),
               (override));
   MOCK_METHOD(void,
               GetStats,
-              (rtc::scoped_refptr<RtpReceiverInterface>,
-               rtc::scoped_refptr<RTCStatsCollectorCallback>),
+              (webrtc::scoped_refptr<RtpReceiverInterface>,
+               webrtc::scoped_refptr<RTCStatsCollectorCallback>),
               (override));
   MOCK_METHOD(void, ClearStatsCache, (), (override));
-  MOCK_METHOD(RTCErrorOr<rtc::scoped_refptr<DataChannelInterface>>,
+  MOCK_METHOD(RTCErrorOr<scoped_refptr<DataChannelInterface>>,
               CreateDataChannelOrError,
               (const std::string&, const DataChannelInit*),
               (override));
@@ -194,7 +194,7 @@
   MOCK_METHOD(void,
               SetRemoteDescription,
               (std::unique_ptr<SessionDescriptionInterface>,
-               rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>),
+               webrtc::scoped_refptr<SetRemoteDescriptionObserverInterface>),
               (override));
   MOCK_METHOD(bool,
               ShouldFireNegotiationNeededEvent,
@@ -214,7 +214,7 @@
               (override));
   MOCK_METHOD(bool,
               RemoveIceCandidates,
-              (const std::vector<cricket::Candidate>&),
+              (const std::vector<webrtc::Candidate>&),
               (override));
   MOCK_METHOD(RTCError, SetBitrate, (const BitrateSettings&), (override));
   MOCK_METHOD(void,
@@ -223,11 +223,11 @@
               (override));
   MOCK_METHOD(void, SetAudioPlayout, (bool), (override));
   MOCK_METHOD(void, SetAudioRecording, (bool), (override));
-  MOCK_METHOD(rtc::scoped_refptr<DtlsTransportInterface>,
+  MOCK_METHOD(scoped_refptr<DtlsTransportInterface>,
               LookupDtlsTransportByMid,
               (const std::string&),
               (override));
-  MOCK_METHOD(rtc::scoped_refptr<SctpTransportInterface>,
+  MOCK_METHOD(scoped_refptr<SctpTransportInterface>,
               GetSctpTransport,
               (),
               (const, override));
@@ -241,7 +241,7 @@
   MOCK_METHOD(IceGatheringState, ice_gathering_state, (), (override));
   MOCK_METHOD(void,
               AddAdaptationResource,
-              (rtc::scoped_refptr<Resource>),
+              (webrtc::scoped_refptr<Resource>),
               (override));
   MOCK_METHOD(std::optional<bool>, can_trickle_ice_candidates, (), (override));
   MOCK_METHOD(bool,
@@ -287,7 +287,7 @@
   MOCK_METHOD(JsepTransportController*, transport_controller_s, (), (override));
   MOCK_METHOD(JsepTransportController*, transport_controller_n, (), (override));
   MOCK_METHOD(DataChannelController*, data_channel_controller, (), (override));
-  MOCK_METHOD(cricket::PortAllocator*, port_allocator, (), (override));
+  MOCK_METHOD(PortAllocator*, port_allocator, (), (override));
   MOCK_METHOD(LegacyStatsCollector*, legacy_stats, (), (override));
   MOCK_METHOD(PeerConnectionObserver*, Observer, (), (const, override));
   MOCK_METHOD(std::optional<SSLRole>, GetSctpSslRole_n, (), (override));
@@ -304,20 +304,20 @@
   MOCK_METHOD(bool, IsUnifiedPlan, (), (const, override));
   MOCK_METHOD(bool,
               ValidateBundleSettings,
-              (const cricket::SessionDescription*,
-               (const std::map<std::string, const cricket::ContentGroup*>&)),
+              (const webrtc::SessionDescription*,
+               (const std::map<std::string, const webrtc::ContentGroup*>&)),
               (override));
-  MOCK_METHOD(RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>,
+  MOCK_METHOD(RTCErrorOr<scoped_refptr<RtpTransceiverInterface>>,
               AddTransceiver,
               (webrtc::MediaType,
-               rtc::scoped_refptr<MediaStreamTrackInterface>,
+               webrtc::scoped_refptr<MediaStreamTrackInterface>,
                const RtpTransceiverInit&,
                bool),
               (override));
   MOCK_METHOD(RTCError, StartSctpTransport, (const SctpOptions&), (override));
   MOCK_METHOD(void,
               AddRemoteCandidate,
-              (absl::string_view, const cricket::Candidate&),
+              (absl::string_view, const webrtc::Candidate&),
               (override));
   MOCK_METHOD(Call*, call_ptr, (), (override));
   MOCK_METHOD(bool, SrtpRequired, (), (const, override));
@@ -334,7 +334,7 @@
   MOCK_METHOD(bool, initial_offerer, (), (const, override));
   MOCK_METHOD(
       std::vector<
-          rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>,
+          scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>>,
       GetTransceiversInternal,
       (),
       (const, override));
@@ -346,11 +346,11 @@
               sctp_transport_name,
               (),
               (const, override));
-  MOCK_METHOD(cricket::CandidateStatsList,
+  MOCK_METHOD(CandidateStatsList,
               GetPooledCandidateStats,
               (),
               (const, override));
-  MOCK_METHOD((std::map<std::string, cricket::TransportStats>),
+  MOCK_METHOD((std::map<std::string, TransportStats>),
               GetTransportStatsByNames,
               (const std::set<std::string>&),
               (override));
@@ -361,9 +361,10 @@
               (override));
   MOCK_METHOD(bool,
               GetLocalCertificate,
-              (const std::string&, rtc::scoped_refptr<rtc::RTCCertificate>*),
+              (const std::string&,
+               webrtc::scoped_refptr<webrtc::RTCCertificate>*),
               (override));
-  MOCK_METHOD(std::unique_ptr<rtc::SSLCertChain>,
+  MOCK_METHOD(std::unique_ptr<SSLCertChain>,
               GetRemoteSSLCertChain,
               (const std::string&),
               (override));
diff --git a/pc/test/mock_peer_connection_observers.h b/pc/test/mock_peer_connection_observers.h
index bbf0e97..6bd7743 100644
--- a/pc/test/mock_peer_connection_observers.h
+++ b/pc/test/mock_peer_connection_observers.h
@@ -52,12 +52,12 @@
  public:
   struct AddTrackEvent {
     explicit AddTrackEvent(
-        rtc::scoped_refptr<RtpReceiverInterface> event_receiver,
-        std::vector<rtc::scoped_refptr<MediaStreamInterface>> event_streams)
+        scoped_refptr<RtpReceiverInterface> event_receiver,
+        std::vector<scoped_refptr<MediaStreamInterface>> event_streams)
         : receiver(std::move(event_receiver)),
           streams(std::move(event_streams)) {
       for (auto stream : streams) {
-        std::vector<rtc::scoped_refptr<MediaStreamTrackInterface>> tracks;
+        std::vector<scoped_refptr<MediaStreamTrackInterface>> tracks;
         for (auto audio_track : stream->GetAudioTracks()) {
           tracks.push_back(audio_track);
         }
@@ -68,12 +68,12 @@
       }
     }
 
-    rtc::scoped_refptr<RtpReceiverInterface> receiver;
-    std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams;
+    scoped_refptr<RtpReceiverInterface> receiver;
+    std::vector<scoped_refptr<MediaStreamInterface>> streams;
     // This map records the tracks present in each stream at the time the
     // OnAddTrack callback was issued.
-    std::map<rtc::scoped_refptr<MediaStreamInterface>,
-             std::vector<rtc::scoped_refptr<MediaStreamTrackInterface>>>
+    std::map<scoped_refptr<MediaStreamInterface>,
+             std::vector<scoped_refptr<MediaStreamTrackInterface>>>
         snapshotted_stream_tracks;
   };
 
@@ -98,12 +98,11 @@
   StreamCollectionInterface* remote_streams() const {
     return remote_streams_.get();
   }
-  void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) override {
+  void OnAddStream(scoped_refptr<MediaStreamInterface> stream) override {
     last_added_stream_ = stream;
     remote_streams_->AddStream(stream);
   }
-  void OnRemoveStream(
-      rtc::scoped_refptr<MediaStreamInterface> stream) override {
+  void OnRemoveStream(scoped_refptr<MediaStreamInterface> stream) override {
     last_removed_stream_ = stream;
     remote_streams_->RemoveStream(stream.get());
   }
@@ -112,7 +111,7 @@
     latest_negotiation_needed_event_ = event_id;
   }
   void OnDataChannel(
-      rtc::scoped_refptr<DataChannelInterface> data_channel) override {
+      scoped_refptr<DataChannelInterface> data_channel) override {
     last_datachannel_ = data_channel;
   }
 
@@ -155,8 +154,8 @@
     callback_triggered_ = true;
   }
 
-  void OnAddTrack(rtc::scoped_refptr<RtpReceiverInterface> receiver,
-                  const std::vector<rtc::scoped_refptr<MediaStreamInterface>>&
+  void OnAddTrack(scoped_refptr<RtpReceiverInterface> receiver,
+                  const std::vector<scoped_refptr<MediaStreamInterface>>&
                       streams) override {
     RTC_DCHECK(receiver);
     num_added_tracks_++;
@@ -164,18 +163,16 @@
     add_track_events_.push_back(AddTrackEvent(receiver, streams));
   }
 
-  void OnTrack(
-      rtc::scoped_refptr<RtpTransceiverInterface> transceiver) override {
+  void OnTrack(scoped_refptr<RtpTransceiverInterface> transceiver) override {
     on_track_transceivers_.push_back(transceiver);
   }
 
-  void OnRemoveTrack(
-      rtc::scoped_refptr<RtpReceiverInterface> receiver) override {
+  void OnRemoveTrack(scoped_refptr<RtpReceiverInterface> receiver) override {
     remove_track_events_.push_back(receiver);
   }
 
-  std::vector<rtc::scoped_refptr<RtpReceiverInterface>> GetAddTrackReceivers() {
-    std::vector<rtc::scoped_refptr<RtpReceiverInterface>> receivers;
+  std::vector<scoped_refptr<RtpReceiverInterface>> GetAddTrackReceivers() {
+    std::vector<scoped_refptr<RtpReceiverInterface>> receivers;
     for (const AddTrackEvent& event : add_track_events_) {
       receivers.push_back(event.receiver);
     }
@@ -251,11 +248,11 @@
     latest_negotiation_needed_event_ = std::nullopt;
   }
 
-  rtc::scoped_refptr<PeerConnectionInterface> pc_;
+  scoped_refptr<PeerConnectionInterface> pc_;
   PeerConnectionInterface::SignalingState state_;
   std::vector<std::unique_ptr<IceCandidateInterface>> candidates_;
-  rtc::scoped_refptr<DataChannelInterface> last_datachannel_;
-  rtc::scoped_refptr<StreamCollection> remote_streams_;
+  scoped_refptr<DataChannelInterface> last_datachannel_;
+  scoped_refptr<StreamCollection> remote_streams_;
   bool renegotiation_needed_ = false;
   std::optional<uint32_t> latest_negotiation_needed_event_;
   bool ice_gathering_complete_ = false;
@@ -264,14 +261,13 @@
   int num_added_tracks_ = 0;
   std::string last_added_track_label_;
   std::vector<AddTrackEvent> add_track_events_;
-  std::vector<rtc::scoped_refptr<RtpReceiverInterface>> remove_track_events_;
-  std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>
-      on_track_transceivers_;
+  std::vector<scoped_refptr<RtpReceiverInterface>> remove_track_events_;
+  std::vector<scoped_refptr<RtpTransceiverInterface>> on_track_transceivers_;
   int num_candidates_removed_ = 0;
 
  private:
-  rtc::scoped_refptr<MediaStreamInterface> last_added_stream_;
-  rtc::scoped_refptr<MediaStreamInterface> last_removed_stream_;
+  scoped_refptr<MediaStreamInterface> last_added_stream_;
+  scoped_refptr<MediaStreamInterface> last_removed_stream_;
 };
 
 class MockCreateSessionDescriptionObserver
@@ -318,8 +314,8 @@
 
 class MockSetSessionDescriptionObserver : public SetSessionDescriptionObserver {
  public:
-  static rtc::scoped_refptr<MockSetSessionDescriptionObserver> Create() {
-    return rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+  static scoped_refptr<MockSetSessionDescriptionObserver> Create() {
+    return make_ref_counted<MockSetSessionDescriptionObserver>();
   }
 
   MockSetSessionDescriptionObserver()
@@ -450,7 +446,7 @@
   }
 
  private:
-  rtc::scoped_refptr<DataChannelInterface> channel_;
+  scoped_refptr<DataChannelInterface> channel_;
   std::vector<DataChannelInterface::DataState> states_;
   std::vector<Message> messages_;
   std::function<void(DataChannelInterface::DataState)> state_change_callback_;
@@ -610,20 +606,20 @@
 // Helper class that just stores the report from the callback.
 class MockRTCStatsCollectorCallback : public RTCStatsCollectorCallback {
  public:
-  rtc::scoped_refptr<const RTCStatsReport> report() { return report_; }
+  scoped_refptr<const RTCStatsReport> report() { return report_; }
 
   bool called() const { return called_; }
 
  protected:
   void OnStatsDelivered(
-      const rtc::scoped_refptr<const RTCStatsReport>& report) override {
+      const scoped_refptr<const RTCStatsReport>& report) override {
     report_ = report;
     called_ = true;
   }
 
  private:
   bool called_ = false;
-  rtc::scoped_refptr<const RTCStatsReport> report_;
+  scoped_refptr<const RTCStatsReport> report_;
 };
 
 }  // namespace webrtc
diff --git a/pc/test/mock_rtp_receiver_internal.h b/pc/test/mock_rtp_receiver_internal.h
index f29a736..046e7f7 100644
--- a/pc/test/mock_rtp_receiver_internal.h
+++ b/pc/test/mock_rtp_receiver_internal.h
@@ -34,16 +34,16 @@
 class MockRtpReceiverInternal : public RtpReceiverInternal {
  public:
   // RtpReceiverInterface methods.
-  MOCK_METHOD(rtc::scoped_refptr<MediaStreamTrackInterface>,
+  MOCK_METHOD(scoped_refptr<MediaStreamTrackInterface>,
               track,
               (),
               (const, override));
-  MOCK_METHOD(rtc::scoped_refptr<DtlsTransportInterface>,
+  MOCK_METHOD(scoped_refptr<DtlsTransportInterface>,
               dtls_transport,
               (),
               (const, override));
   MOCK_METHOD(std::vector<std::string>, stream_ids, (), (const, override));
-  MOCK_METHOD(std::vector<rtc::scoped_refptr<MediaStreamInterface>>,
+  MOCK_METHOD(std::vector<scoped_refptr<MediaStreamInterface>>,
               streams,
               (),
               (const, override));
@@ -58,9 +58,9 @@
   MOCK_METHOD(std::vector<RtpSource>, GetSources, (), (const, override));
   MOCK_METHOD(void,
               SetFrameDecryptor,
-              (rtc::scoped_refptr<FrameDecryptorInterface>),
+              (webrtc::scoped_refptr<FrameDecryptorInterface>),
               (override));
-  MOCK_METHOD(rtc::scoped_refptr<FrameDecryptorInterface>,
+  MOCK_METHOD(scoped_refptr<FrameDecryptorInterface>,
               GetFrameDecryptor,
               (),
               (const, override));
@@ -78,11 +78,11 @@
   MOCK_METHOD(void, set_stream_ids, (std::vector<std::string>), (override));
   MOCK_METHOD(void,
               set_transport,
-              (rtc::scoped_refptr<DtlsTransportInterface>),
+              (webrtc::scoped_refptr<DtlsTransportInterface>),
               (override));
   MOCK_METHOD(void,
               SetStreams,
-              (const std::vector<rtc::scoped_refptr<MediaStreamInterface>>&),
+              (const std::vector<webrtc::scoped_refptr<MediaStreamInterface>>&),
               (override));
   MOCK_METHOD(int, AttachmentId, (), (const, override));
 };
diff --git a/pc/test/mock_rtp_sender_internal.h b/pc/test/mock_rtp_sender_internal.h
index 317851a..4743d7f 100644
--- a/pc/test/mock_rtp_sender_internal.h
+++ b/pc/test/mock_rtp_sender_internal.h
@@ -39,12 +39,12 @@
  public:
   // RtpSenderInterface methods.
   MOCK_METHOD(bool, SetTrack, (MediaStreamTrackInterface*), (override));
-  MOCK_METHOD(rtc::scoped_refptr<MediaStreamTrackInterface>,
+  MOCK_METHOD(scoped_refptr<MediaStreamTrackInterface>,
               track,
               (),
               (const, override));
   MOCK_METHOD(uint32_t, ssrc, (), (const, override));
-  MOCK_METHOD(rtc::scoped_refptr<DtlsTransportInterface>,
+  MOCK_METHOD(scoped_refptr<DtlsTransportInterface>,
               dtls_transport,
               (),
               (const, override));
@@ -57,7 +57,7 @@
               (const, override));
   MOCK_METHOD(void,
               set_transport,
-              (rtc::scoped_refptr<DtlsTransportInterface>),
+              (webrtc::scoped_refptr<DtlsTransportInterface>),
               (override));
   MOCK_METHOD(RtpParameters, GetParameters, (), (const, override));
   MOCK_METHOD(RtpParameters, GetParametersInternal, (), (const, override));
@@ -84,21 +84,21 @@
               (override));
   MOCK_METHOD(void, SetSendCodecs, (std::vector<Codec>), (override));
   MOCK_METHOD(std::vector<Codec>, GetSendCodecs, (), (const, override));
-  MOCK_METHOD(rtc::scoped_refptr<DtmfSenderInterface>,
+  MOCK_METHOD(scoped_refptr<DtmfSenderInterface>,
               GetDtmfSender,
               (),
               (const, override));
   MOCK_METHOD(void,
               SetFrameEncryptor,
-              (rtc::scoped_refptr<FrameEncryptorInterface>),
+              (webrtc::scoped_refptr<FrameEncryptorInterface>),
               (override));
-  MOCK_METHOD(rtc::scoped_refptr<FrameEncryptorInterface>,
+  MOCK_METHOD(scoped_refptr<FrameEncryptorInterface>,
               GetFrameEncryptor,
               (),
               (const, override));
   MOCK_METHOD(void,
               SetFrameTransformer,
-              (rtc::scoped_refptr<FrameTransformerInterface>),
+              (webrtc::scoped_refptr<FrameTransformerInterface>),
               (override));
   MOCK_METHOD(void,
               SetEncoderSelector,
diff --git a/pc/test/mock_voice_media_receive_channel_interface.h b/pc/test/mock_voice_media_receive_channel_interface.h
index f61025d..87aff5d 100644
--- a/pc/test/mock_voice_media_receive_channel_interface.h
+++ b/pc/test/mock_voice_media_receive_channel_interface.h
@@ -33,7 +33,7 @@
 namespace webrtc {
 
 class MockVoiceMediaReceiveChannelInterface
-    : public cricket::VoiceMediaReceiveChannelInterface {
+    : public VoiceMediaReceiveChannelInterface {
  public:
   MockVoiceMediaReceiveChannelInterface() {
     ON_CALL(*this, AsVoiceReceiveChannel).WillByDefault(testing::Return(this));
@@ -42,7 +42,7 @@
   // VoiceMediaReceiveChannelInterface
   MOCK_METHOD(bool,
               SetReceiverParameters,
-              (const cricket::AudioReceiverParameters& params),
+              (const webrtc::AudioReceiverParameters& params),
               (override));
   MOCK_METHOD(RtpParameters,
               GetRtpReceiverParameters,
@@ -72,7 +72,7 @@
               (override));
   MOCK_METHOD(bool,
               GetStats,
-              (cricket::VoiceMediaReceiveInfo * stats, bool reset_legacy),
+              (webrtc::VoiceMediaReceiveInfo * stats, bool reset_legacy),
               (override));
   MOCK_METHOD(::webrtc::RtcpMode, RtcpMode, (), (const, override));
   MOCK_METHOD(void, SetRtcpMode, (::webrtc::RtcpMode mode), (override));
@@ -80,24 +80,24 @@
   MOCK_METHOD(void, SetReceiveNonSenderRttEnabled, (bool enabled), (override));
 
   // MediaReceiveChannelInterface
-  MOCK_METHOD(cricket::VideoMediaReceiveChannelInterface*,
+  MOCK_METHOD(VideoMediaReceiveChannelInterface*,
               AsVideoReceiveChannel,
               (),
               (override));
-  MOCK_METHOD(cricket::VoiceMediaReceiveChannelInterface*,
+  MOCK_METHOD(VoiceMediaReceiveChannelInterface*,
               AsVoiceReceiveChannel,
               (),
               (override));
   MOCK_METHOD(MediaType, media_type, (), (const, override));
   MOCK_METHOD(bool,
               AddRecvStream,
-              (const cricket::StreamParams& sp),
+              (const webrtc::StreamParams& sp),
               (override));
   MOCK_METHOD(bool, RemoveRecvStream, (uint32_t ssrc), (override));
   MOCK_METHOD(void, ResetUnsignaledRecvStream, (), (override));
   MOCK_METHOD(void,
               SetInterface,
-              (cricket::MediaChannelNetworkInterface * iface),
+              (webrtc::MediaChannelNetworkInterface * iface),
               (override));
   MOCK_METHOD(void,
               OnPacketReceived,
diff --git a/pc/test/peer_connection_test_wrapper.cc b/pc/test/peer_connection_test_wrapper.cc
index 95393f1..94f9b65 100644
--- a/pc/test/peer_connection_test_wrapper.cc
+++ b/pc/test/peer_connection_test_wrapper.cc
@@ -170,8 +170,8 @@
 
 bool PeerConnectionTestWrapper::CreatePc(
     const webrtc::PeerConnectionInterface::RTCConfiguration& config,
-    rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
-    rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
+    webrtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
+    webrtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
     std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory,
     std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory,
     std::unique_ptr<webrtc::FieldTrialsView> field_trials) {
@@ -187,7 +187,8 @@
 
   peer_connection_factory_ = webrtc::CreatePeerConnectionFactory(
       network_thread_, worker_thread_, webrtc::Thread::Current(),
-      rtc::scoped_refptr<webrtc::AudioDeviceModule>(fake_audio_capture_module_),
+      webrtc::scoped_refptr<webrtc::AudioDeviceModule>(
+          fake_audio_capture_module_),
       audio_encoder_factory, audio_decoder_factory,
       std::move(video_encoder_factory), std::move(video_decoder_factory),
       nullptr /* audio_mixer */, nullptr /* audio_processing */, nullptr,
@@ -213,8 +214,8 @@
 
 bool PeerConnectionTestWrapper::CreatePc(
     const webrtc::PeerConnectionInterface::RTCConfiguration& config,
-    rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
-    rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
+    webrtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
+    webrtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
     std::unique_ptr<webrtc::FieldTrialsView> field_trials) {
   return CreatePc(config, std::move(audio_encoder_factory),
                   std::move(audio_decoder_factory),
@@ -227,7 +228,7 @@
                   std::move(field_trials));
 }
 
-rtc::scoped_refptr<webrtc::DataChannelInterface>
+webrtc::scoped_refptr<webrtc::DataChannelInterface>
 PeerConnectionTestWrapper::CreateDataChannel(
     const std::string& label,
     const webrtc::DataChannelInit& init) {
@@ -270,8 +271,8 @@
 }
 
 void PeerConnectionTestWrapper::OnAddTrack(
-    rtc::scoped_refptr<RtpReceiverInterface> receiver,
-    const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams) {
+    webrtc::scoped_refptr<RtpReceiverInterface> receiver,
+    const std::vector<webrtc::scoped_refptr<MediaStreamInterface>>& streams) {
   RTC_LOG(LS_INFO) << "PeerConnectionTestWrapper " << name_ << ": OnAddTrack";
   if (receiver->track()->kind() == MediaStreamTrackInterface::kVideoKind) {
     auto* video_track =
@@ -289,7 +290,7 @@
 }
 
 void PeerConnectionTestWrapper::OnDataChannel(
-    rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel) {
+    webrtc::scoped_refptr<webrtc::DataChannelInterface> data_channel) {
   SignalOnDataChannel(data_channel.get());
 }
 
@@ -338,7 +339,7 @@
                    << ": SetLocalDescription " << webrtc::SdpTypeToString(type)
                    << " " << sdp;
 
-  auto observer = rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+  auto observer = webrtc::make_ref_counted<MockSetSessionDescriptionObserver>();
   peer_connection_->SetLocalDescription(
       observer.get(), webrtc::CreateSessionDescription(type, sdp).release());
 }
@@ -349,7 +350,7 @@
                    << ": SetRemoteDescription " << webrtc::SdpTypeToString(type)
                    << " " << sdp;
 
-  auto observer = rtc::make_ref_counted<MockSetSessionDescriptionObserver>();
+  auto observer = webrtc::make_ref_counted<MockSetSessionDescriptionObserver>();
   peer_connection_->SetRemoteDescription(
       observer.get(), webrtc::CreateSessionDescription(type, sdp).release());
 }
@@ -433,7 +434,7 @@
     bool audio,
     const webrtc::AudioOptions& audio_options,
     bool video) {
-  rtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
+  webrtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
       GetUserMedia(audio, audio_options, video);
   for (const auto& audio_track : stream->GetAudioTracks()) {
     EXPECT_TRUE(peer_connection_->AddTrack(audio_track, {stream->id()}).ok());
@@ -443,7 +444,7 @@
   }
 }
 
-rtc::scoped_refptr<webrtc::MediaStreamInterface>
+webrtc::scoped_refptr<webrtc::MediaStreamInterface>
 PeerConnectionTestWrapper::GetUserMedia(
     bool audio,
     const webrtc::AudioOptions& audio_options,
@@ -451,16 +452,16 @@
     webrtc::Resolution resolution) {
   std::string stream_id =
       kStreamIdBase + absl::StrCat(num_get_user_media_calls_++);
-  rtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
+  webrtc::scoped_refptr<webrtc::MediaStreamInterface> stream =
       peer_connection_factory_->CreateLocalMediaStream(stream_id);
 
   if (audio) {
     webrtc::AudioOptions options = audio_options;
     // Disable highpass filter so that we can get all the test audio frames.
     options.highpass_filter = false;
-    rtc::scoped_refptr<webrtc::AudioSourceInterface> source =
+    webrtc::scoped_refptr<webrtc::AudioSourceInterface> source =
         peer_connection_factory_->CreateAudioSource(options);
-    rtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
+    webrtc::scoped_refptr<webrtc::AudioTrackInterface> audio_track(
         peer_connection_factory_->CreateAudioTrack(kAudioTrackLabelBase,
                                                    source.get()));
     stream->AddTrack(audio_track);
@@ -474,12 +475,13 @@
     config.width = resolution.width;
     config.height = resolution.height;
 
-    auto source = rtc::make_ref_counted<webrtc::FakePeriodicVideoTrackSource>(
-        config, /* remote */ false);
+    auto source =
+        webrtc::make_ref_counted<webrtc::FakePeriodicVideoTrackSource>(
+            config, /* remote */ false);
     fake_video_sources_.push_back(source);
 
     std::string videotrack_label = stream_id + kVideoTrackLabelBase;
-    rtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
+    webrtc::scoped_refptr<webrtc::VideoTrackInterface> video_track(
         peer_connection_factory_->CreateVideoTrack(source, videotrack_label));
 
     stream->AddTrack(video_track);
diff --git a/pc/test/peer_connection_test_wrapper.h b/pc/test/peer_connection_test_wrapper.h
index 7cf6f9e..30fa5c4 100644
--- a/pc/test/peer_connection_test_wrapper.h
+++ b/pc/test/peer_connection_test_wrapper.h
@@ -57,24 +57,24 @@
 
   bool CreatePc(
       const webrtc::PeerConnectionInterface::RTCConfiguration& config,
-      rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
-      rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
+      webrtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
+      webrtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
       std::unique_ptr<webrtc::FieldTrialsView> field_trials = nullptr);
   bool CreatePc(
       const webrtc::PeerConnectionInterface::RTCConfiguration& config,
-      rtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
-      rtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
+      webrtc::scoped_refptr<webrtc::AudioEncoderFactory> audio_encoder_factory,
+      webrtc::scoped_refptr<webrtc::AudioDecoderFactory> audio_decoder_factory,
       std::unique_ptr<webrtc::VideoEncoderFactory> video_encoder_factory,
       std::unique_ptr<webrtc::VideoDecoderFactory> video_decoder_factory,
       std::unique_ptr<webrtc::FieldTrialsView> field_trials = nullptr);
 
-  rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory()
+  webrtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> pc_factory()
       const {
     return peer_connection_factory_;
   }
   webrtc::PeerConnectionInterface* pc() { return peer_connection_.get(); }
 
-  rtc::scoped_refptr<webrtc::DataChannelInterface> CreateDataChannel(
+  webrtc::scoped_refptr<webrtc::DataChannelInterface> CreateDataChannel(
       const std::string& label,
       const webrtc::DataChannelInit& init);
 
@@ -88,11 +88,11 @@
   void OnSignalingChange(
       webrtc::PeerConnectionInterface::SignalingState new_state) override;
   void OnAddTrack(
-      rtc::scoped_refptr<webrtc::RtpReceiverInterface> receiver,
-      const std::vector<rtc::scoped_refptr<webrtc::MediaStreamInterface>>&
+      webrtc::scoped_refptr<webrtc::RtpReceiverInterface> receiver,
+      const std::vector<webrtc::scoped_refptr<webrtc::MediaStreamInterface>>&
           streams) override;
-  void OnDataChannel(
-      rtc::scoped_refptr<webrtc::DataChannelInterface> data_channel) override;
+  void OnDataChannel(webrtc::scoped_refptr<webrtc::DataChannelInterface>
+                         data_channel) override;
   void OnRenegotiationNeeded() override {}
   void OnIceConnectionChange(
       webrtc::PeerConnectionInterface::IceConnectionState new_state) override {}
@@ -127,7 +127,7 @@
   sigslot::signal1<const std::string&> SignalOnSdpReady;
   sigslot::signal1<webrtc::DataChannelInterface*> SignalOnDataChannel;
 
-  rtc::scoped_refptr<webrtc::MediaStreamInterface> GetUserMedia(
+  webrtc::scoped_refptr<webrtc::MediaStreamInterface> GetUserMedia(
       bool audio,
       const webrtc::AudioOptions& audio_options,
       bool video,
@@ -148,14 +148,14 @@
   webrtc::Thread* const network_thread_;
   webrtc::Thread* const worker_thread_;
   webrtc::SequenceChecker pc_thread_checker_;
-  rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
-  rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
+  webrtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
+  webrtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface>
       peer_connection_factory_;
-  rtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
+  webrtc::scoped_refptr<FakeAudioCaptureModule> fake_audio_capture_module_;
   std::unique_ptr<webrtc::FakeVideoTrackRenderer> renderer_;
   int num_get_user_media_calls_ = 0;
   bool pending_negotiation_;
-  std::vector<rtc::scoped_refptr<webrtc::FakePeriodicVideoTrackSource>>
+  std::vector<webrtc::scoped_refptr<webrtc::FakePeriodicVideoTrackSource>>
       fake_video_sources_;
 };
 
diff --git a/pc/test/rtc_stats_obtainer.h b/pc/test/rtc_stats_obtainer.h
index e0d0786..2013539 100644
--- a/pc/test/rtc_stats_obtainer.h
+++ b/pc/test/rtc_stats_obtainer.h
@@ -22,33 +22,32 @@
 
 class RTCStatsObtainer : public RTCStatsCollectorCallback {
  public:
-  static rtc::scoped_refptr<RTCStatsObtainer> Create(
-      rtc::scoped_refptr<const RTCStatsReport>* report_ptr = nullptr) {
-    return rtc::make_ref_counted<RTCStatsObtainer>(report_ptr);
+  static scoped_refptr<RTCStatsObtainer> Create(
+      scoped_refptr<const RTCStatsReport>* report_ptr = nullptr) {
+    return make_ref_counted<RTCStatsObtainer>(report_ptr);
   }
 
   void OnStatsDelivered(
-      const rtc::scoped_refptr<const RTCStatsReport>& report) override {
+      const scoped_refptr<const RTCStatsReport>& report) override {
     EXPECT_TRUE(thread_checker_.IsCurrent());
     report_ = report;
     if (report_ptr_)
       *report_ptr_ = report_;
   }
 
-  rtc::scoped_refptr<const RTCStatsReport> report() const {
+  scoped_refptr<const RTCStatsReport> report() const {
     EXPECT_TRUE(thread_checker_.IsCurrent());
     return report_;
   }
 
  protected:
-  explicit RTCStatsObtainer(
-      rtc::scoped_refptr<const RTCStatsReport>* report_ptr)
+  explicit RTCStatsObtainer(scoped_refptr<const RTCStatsReport>* report_ptr)
       : report_ptr_(report_ptr) {}
 
  private:
   SequenceChecker thread_checker_;
-  rtc::scoped_refptr<const RTCStatsReport> report_;
-  rtc::scoped_refptr<const RTCStatsReport>* report_ptr_;
+  scoped_refptr<const RTCStatsReport> report_;
+  scoped_refptr<const RTCStatsReport>* report_ptr_;
 };
 
 }  // namespace webrtc
diff --git a/pc/test/rtp_transport_test_util.h b/pc/test/rtp_transport_test_util.h
index 69d4c97..82d2505 100644
--- a/pc/test/rtp_transport_test_util.h
+++ b/pc/test/rtp_transport_test_util.h
@@ -31,7 +31,7 @@
 
   explicit TransportObserver(RtpTransportInternal* rtp_transport) {
     rtp_transport->SubscribeRtcpPacketReceived(
-        this, [this](rtc::CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
+        this, [this](CopyOnWriteBuffer* buffer, int64_t packet_time_ms) {
           OnRtcpPacketReceived(buffer, packet_time_ms);
         });
     rtp_transport->SubscribeReadyToSend(
@@ -39,7 +39,7 @@
     rtp_transport->SetUnDemuxableRtpPacketReceivedHandler(
         [this](RtpPacketReceived& packet) { OnUndemuxableRtpPacket(packet); });
     rtp_transport->SubscribeSentPacket(this,
-                                       [this](const rtc::SentPacket& packet) {
+                                       [this](const SentPacketInfo& packet) {
                                          sent_packet_count_++;
                                          if (action_on_sent_packet_) {
                                            action_on_sent_packet_();
@@ -57,8 +57,7 @@
     un_demuxable_rtp_count_++;
   }
 
-  void OnRtcpPacketReceived(rtc::CopyOnWriteBuffer* packet,
-                            int64_t packet_time_us) {
+  void OnRtcpPacketReceived(CopyOnWriteBuffer* packet, int64_t packet_time_us) {
     rtcp_count_++;
     last_recv_rtcp_packet_ = *packet;
   }
@@ -72,9 +71,7 @@
     return last_recv_rtp_packet_;
   }
 
-  rtc::CopyOnWriteBuffer last_recv_rtcp_packet() {
-    return last_recv_rtcp_packet_;
-  }
+  CopyOnWriteBuffer last_recv_rtcp_packet() { return last_recv_rtcp_packet_; }
 
   void OnReadyToSend(bool ready) {
     if (action_on_ready_to_send_) {
@@ -103,7 +100,7 @@
   int sent_packet_count_ = 0;
   int ready_to_send_signal_count_ = 0;
   RtpPacketReceived last_recv_rtp_packet_;
-  rtc::CopyOnWriteBuffer last_recv_rtcp_packet_;
+  CopyOnWriteBuffer last_recv_rtcp_packet_;
   absl::AnyInvocable<void(bool)> action_on_ready_to_send_;
   absl::AnyInvocable<void()> action_on_sent_packet_;
 };
diff --git a/pc/test/simulcast_layer_util.cc b/pc/test/simulcast_layer_util.cc
index 60fff5d..aebc713 100644
--- a/pc/test/simulcast_layer_util.cc
+++ b/pc/test/simulcast_layer_util.cc
@@ -43,7 +43,7 @@
 RtpTransceiverInit CreateTransceiverInit(
     const std::vector<SimulcastLayer>& layers) {
   RtpTransceiverInit init;
-  for (const cricket::SimulcastLayer& layer : layers) {
+  for (const SimulcastLayer& layer : layers) {
     RtpEncodingParameters encoding;
     encoding.rid = layer.rid;
     encoding.active = !layer.is_paused;
diff --git a/pc/test/srtp_test_util.h b/pc/test/srtp_test_util.h
index ba0c355..3f8c6c1 100644
--- a/pc/test/srtp_test_util.h
+++ b/pc/test/srtp_test_util.h
@@ -19,9 +19,9 @@
 
 namespace webrtc {
 
-static const rtc::ZeroOnFreeBuffer<uint8_t> kTestKey1{
+static const ZeroOnFreeBuffer<uint8_t> kTestKey1{
     "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234", 30};
-static const rtc::ZeroOnFreeBuffer<uint8_t> kTestKey2{
+static const ZeroOnFreeBuffer<uint8_t> kTestKey2{
     "4321ZYXWVUTSRQPONMLKJIHGFEDCBA", 30};
 
 static int rtp_auth_tag_len(int crypto_suite) {
diff --git a/pc/test/svc_e2e_tests.cc b/pc/test/svc_e2e_tests.cc
index 8193bd0..60469c7 100644
--- a/pc/test/svc_e2e_tests.cc
+++ b/pc/test/svc_e2e_tests.cc
@@ -213,7 +213,7 @@
 
   void OnStatsReports(
       absl::string_view pc_label,
-      const rtc::scoped_refptr<const RTCStatsReport>& report) override {
+      const scoped_refptr<const RTCStatsReport>& report) override {
     // Extract the scalability mode reported in the stats.
     auto outbound_stats = report->GetStatsOfType<RTCOutboundRtpStreamStats>();
     for (const auto& stat : outbound_stats) {
diff --git a/pc/track_media_info_map.cc b/pc/track_media_info_map.cc
index 6d849b9..a1eef98 100644
--- a/pc/track_media_info_map.cc
+++ b/pc/track_media_info_map.cc
@@ -45,8 +45,8 @@
 }
 
 void GetAudioAndVideoTrackBySsrc(
-    rtc::ArrayView<rtc::scoped_refptr<RtpSenderInternal>> rtp_senders,
-    rtc::ArrayView<rtc::scoped_refptr<RtpReceiverInternal>> rtp_receivers,
+    ArrayView<scoped_refptr<RtpSenderInternal>> rtp_senders,
+    ArrayView<scoped_refptr<RtpReceiverInternal>> rtp_receivers,
     std::map<uint32_t, AudioTrackInterface*>* local_audio_track_by_ssrc,
     std::map<uint32_t, VideoTrackInterface*>* local_video_track_by_ssrc,
     std::map<uint32_t, AudioTrackInterface*>* remote_audio_track_by_ssrc,
@@ -116,8 +116,8 @@
 void TrackMediaInfoMap::Initialize(
     std::optional<VoiceMediaInfo> voice_media_info,
     std::optional<VideoMediaInfo> video_media_info,
-    rtc::ArrayView<rtc::scoped_refptr<RtpSenderInternal>> rtp_senders,
-    rtc::ArrayView<rtc::scoped_refptr<RtpReceiverInternal>> rtp_receivers) {
+    ArrayView<scoped_refptr<RtpSenderInternal>> rtp_senders,
+    ArrayView<scoped_refptr<RtpReceiverInternal>> rtp_receivers) {
   Thread::ScopedDisallowBlockingCalls no_blocking_calls;
   RTC_DCHECK(!is_initialized_);
   is_initialized_ = true;
@@ -245,25 +245,25 @@
   return FindValueOrNull(video_info_by_receiver_ssrc_, ssrc);
 }
 
-rtc::scoped_refptr<AudioTrackInterface> TrackMediaInfoMap::GetAudioTrack(
+scoped_refptr<AudioTrackInterface> TrackMediaInfoMap::GetAudioTrack(
     const VoiceSenderInfo& voice_sender_info) const {
   RTC_DCHECK(is_initialized_);
   return FindValueOrNull(audio_track_by_sender_info_, &voice_sender_info);
 }
 
-rtc::scoped_refptr<AudioTrackInterface> TrackMediaInfoMap::GetAudioTrack(
+scoped_refptr<AudioTrackInterface> TrackMediaInfoMap::GetAudioTrack(
     const VoiceReceiverInfo& voice_receiver_info) const {
   RTC_DCHECK(is_initialized_);
   return FindValueOrNull(audio_track_by_receiver_info_, &voice_receiver_info);
 }
 
-rtc::scoped_refptr<VideoTrackInterface> TrackMediaInfoMap::GetVideoTrack(
+scoped_refptr<VideoTrackInterface> TrackMediaInfoMap::GetVideoTrack(
     const VideoSenderInfo& video_sender_info) const {
   RTC_DCHECK(is_initialized_);
   return FindValueOrNull(video_track_by_sender_info_, &video_sender_info);
 }
 
-rtc::scoped_refptr<VideoTrackInterface> TrackMediaInfoMap::GetVideoTrack(
+scoped_refptr<VideoTrackInterface> TrackMediaInfoMap::GetVideoTrack(
     const VideoReceiverInfo& video_receiver_info) const {
   RTC_DCHECK(is_initialized_);
   return FindValueOrNull(video_track_by_receiver_info_, &video_receiver_info);
diff --git a/pc/track_media_info_map.h b/pc/track_media_info_map.h
index ea19b00..eb20255 100644
--- a/pc/track_media_info_map.h
+++ b/pc/track_media_info_map.h
@@ -40,11 +40,10 @@
   // Takes ownership of the "infos". Does not affect the lifetime of the senders
   // or receivers, but TrackMediaInfoMap will keep their associated tracks alive
   // through reference counting until the map is destroyed.
-  void Initialize(
-      std::optional<VoiceMediaInfo> voice_media_info,
-      std::optional<VideoMediaInfo> video_media_info,
-      rtc::ArrayView<rtc::scoped_refptr<RtpSenderInternal>> rtp_senders,
-      rtc::ArrayView<rtc::scoped_refptr<RtpReceiverInternal>> rtp_receivers);
+  void Initialize(std::optional<VoiceMediaInfo> voice_media_info,
+                  std::optional<VideoMediaInfo> video_media_info,
+                  ArrayView<scoped_refptr<RtpSenderInternal>> rtp_senders,
+                  ArrayView<scoped_refptr<RtpReceiverInternal>> rtp_receivers);
 
   const std::optional<VoiceMediaInfo>& voice_media_info() const {
     RTC_DCHECK(is_initialized_);
@@ -60,13 +59,13 @@
   const VideoSenderInfo* GetVideoSenderInfoBySsrc(uint32_t ssrc) const;
   const VideoReceiverInfo* GetVideoReceiverInfoBySsrc(uint32_t ssrc) const;
 
-  rtc::scoped_refptr<AudioTrackInterface> GetAudioTrack(
+  scoped_refptr<AudioTrackInterface> GetAudioTrack(
       const VoiceSenderInfo& voice_sender_info) const;
-  rtc::scoped_refptr<AudioTrackInterface> GetAudioTrack(
+  scoped_refptr<AudioTrackInterface> GetAudioTrack(
       const VoiceReceiverInfo& voice_receiver_info) const;
-  rtc::scoped_refptr<VideoTrackInterface> GetVideoTrack(
+  scoped_refptr<VideoTrackInterface> GetVideoTrack(
       const VideoSenderInfo& video_sender_info) const;
-  rtc::scoped_refptr<VideoTrackInterface> GetVideoTrack(
+  scoped_refptr<VideoTrackInterface> GetVideoTrack(
       const VideoReceiverInfo& video_receiver_info) const;
 
   // TODO(hta): Remove this function, and redesign the callers not to need it.
@@ -84,13 +83,13 @@
   // the inverse of the maps above. One info object always maps to only one
   // track. The use of scoped_refptr<> here ensures the tracks outlive
   // TrackMediaInfoMap.
-  std::map<const VoiceSenderInfo*, rtc::scoped_refptr<AudioTrackInterface>>
+  std::map<const VoiceSenderInfo*, scoped_refptr<AudioTrackInterface>>
       audio_track_by_sender_info_;
-  std::map<const VoiceReceiverInfo*, rtc::scoped_refptr<AudioTrackInterface>>
+  std::map<const VoiceReceiverInfo*, scoped_refptr<AudioTrackInterface>>
       audio_track_by_receiver_info_;
-  std::map<const VideoSenderInfo*, rtc::scoped_refptr<VideoTrackInterface>>
+  std::map<const VideoSenderInfo*, scoped_refptr<VideoTrackInterface>>
       video_track_by_sender_info_;
-  std::map<const VideoReceiverInfo*, rtc::scoped_refptr<VideoTrackInterface>>
+  std::map<const VideoReceiverInfo*, scoped_refptr<VideoTrackInterface>>
       video_track_by_receiver_info_;
   // Map of tracks to attachment IDs.
   // Necessary because senders and receivers live on the signaling thread,
diff --git a/pc/track_media_info_map_unittest.cc b/pc/track_media_info_map_unittest.cc
index 5fe7da0..a9487cc 100644
--- a/pc/track_media_info_map_unittest.cc
+++ b/pc/track_media_info_map_unittest.cc
@@ -54,17 +54,17 @@
   return params;
 }
 
-rtc::scoped_refptr<MockRtpSenderInternal> CreateMockRtpSender(
+scoped_refptr<MockRtpSenderInternal> CreateMockRtpSender(
     webrtc::MediaType media_type,
     std::initializer_list<uint32_t> ssrcs,
-    rtc::scoped_refptr<MediaStreamTrackInterface> track) {
+    scoped_refptr<MediaStreamTrackInterface> track) {
   uint32_t first_ssrc;
   if (ssrcs.size()) {
     first_ssrc = *ssrcs.begin();
   } else {
     first_ssrc = 0;
   }
-  auto sender = rtc::make_ref_counted<MockRtpSenderInternal>();
+  auto sender = make_ref_counted<MockRtpSenderInternal>();
   EXPECT_CALL(*sender, track())
       .WillRepeatedly(::testing::Return(std::move(track)));
   EXPECT_CALL(*sender, ssrc()).WillRepeatedly(::testing::Return(first_ssrc));
@@ -76,11 +76,11 @@
   return sender;
 }
 
-rtc::scoped_refptr<MockRtpReceiverInternal> CreateMockRtpReceiver(
+scoped_refptr<MockRtpReceiverInternal> CreateMockRtpReceiver(
     webrtc::MediaType media_type,
     std::initializer_list<uint32_t> ssrcs,
-    rtc::scoped_refptr<MediaStreamTrackInterface> track) {
-  auto receiver = rtc::make_ref_counted<MockRtpReceiverInternal>();
+    scoped_refptr<MediaStreamTrackInterface> track) {
+  auto receiver = make_ref_counted<MockRtpReceiverInternal>();
   EXPECT_CALL(*receiver, track())
       .WillRepeatedly(::testing::Return(std::move(track)));
   EXPECT_CALL(*receiver, media_type())
@@ -91,14 +91,12 @@
   return receiver;
 }
 
-rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack(
-    const std::string& id) {
+scoped_refptr<VideoTrackInterface> CreateVideoTrack(const std::string& id) {
   return VideoTrack::Create(id, FakeVideoTrackSource::Create(false),
                             Thread::Current());
 }
 
-rtc::scoped_refptr<VideoTrackInterface> CreateMockVideoTrack(
-    const std::string& id) {
+scoped_refptr<VideoTrackInterface> CreateMockVideoTrack(const std::string& id) {
   auto track = MockVideoTrack::Create();
   EXPECT_CALL(*track, kind())
       .WillRepeatedly(::testing::Return(VideoTrack::kVideoKind));
@@ -121,11 +119,11 @@
 
   void AddRtpSenderWithSsrcs(std::initializer_list<uint32_t> ssrcs,
                              MediaStreamTrackInterface* local_track) {
-    rtc::scoped_refptr<MockRtpSenderInternal> rtp_sender = CreateMockRtpSender(
+    scoped_refptr<MockRtpSenderInternal> rtp_sender = CreateMockRtpSender(
         local_track->kind() == MediaStreamTrackInterface::kAudioKind
             ? webrtc::MediaType::AUDIO
             : webrtc::MediaType::VIDEO,
-        ssrcs, rtc::scoped_refptr<MediaStreamTrackInterface>(local_track));
+        ssrcs, scoped_refptr<MediaStreamTrackInterface>(local_track));
     rtp_senders_.push_back(rtp_sender);
 
     if (local_track->kind() == MediaStreamTrackInterface::kAudioKind) {
@@ -154,7 +152,7 @@
         remote_track->kind() == MediaStreamTrackInterface::kAudioKind
             ? webrtc::MediaType::AUDIO
             : webrtc::MediaType::VIDEO,
-        ssrcs, rtc::scoped_refptr<MediaStreamTrackInterface>(remote_track));
+        ssrcs, scoped_refptr<MediaStreamTrackInterface>(remote_track));
     rtp_receivers_.push_back(rtp_receiver);
 
     if (remote_track->kind() == MediaStreamTrackInterface::kAudioKind) {
@@ -189,13 +187,13 @@
   VideoMediaInfo video_media_info_;
 
  protected:
-  std::vector<rtc::scoped_refptr<RtpSenderInternal>> rtp_senders_;
-  std::vector<rtc::scoped_refptr<RtpReceiverInternal>> rtp_receivers_;
+  std::vector<scoped_refptr<RtpSenderInternal>> rtp_senders_;
+  std::vector<scoped_refptr<RtpReceiverInternal>> rtp_receivers_;
   TrackMediaInfoMap map_;
-  rtc::scoped_refptr<AudioTrack> local_audio_track_;
-  rtc::scoped_refptr<AudioTrack> remote_audio_track_;
-  rtc::scoped_refptr<VideoTrackInterface> local_video_track_;
-  rtc::scoped_refptr<VideoTrackInterface> remote_video_track_;
+  scoped_refptr<AudioTrack> local_audio_track_;
+  scoped_refptr<AudioTrack> remote_audio_track_;
+  scoped_refptr<VideoTrackInterface> local_video_track_;
+  scoped_refptr<VideoTrackInterface> remote_video_track_;
 };
 
 }  // namespace
diff --git a/pc/transceiver_list.cc b/pc/transceiver_list.cc
index 60474f0..4e7df5e 100644
--- a/pc/transceiver_list.cc
+++ b/pc/transceiver_list.cc
@@ -61,7 +61,7 @@
 }
 
 RtpTransceiverProxyRefPtr TransceiverList::FindBySender(
-    rtc::scoped_refptr<RtpSenderInterface> sender) const {
+    scoped_refptr<RtpSenderInterface> sender) const {
   RTC_DCHECK_RUN_ON(&sequence_checker_);
   for (auto transceiver : transceivers_) {
     if (transceiver->sender() == sender) {
diff --git a/pc/transceiver_list.h b/pc/transceiver_list.h
index 9e03171..1abb7d2 100644
--- a/pc/transceiver_list.h
+++ b/pc/transceiver_list.h
@@ -32,7 +32,7 @@
 
 namespace webrtc {
 
-typedef rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
+typedef scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
     RtpTransceiverProxyRefPtr;
 
 // Captures partial state to be used for rollback. Applicable only in
@@ -94,7 +94,7 @@
 class TransceiverList {
  public:
   // Returns a copy of the currently active list of transceivers. The
-  // list consists of rtc::scoped_refptrs, which will keep the transceivers
+  // list consists of webrtc::scoped_refptrs, which will keep the transceivers
   // from being deallocated, even if they are removed from the TransceiverList.
   std::vector<RtpTransceiverProxyRefPtr> List() const {
     RTC_DCHECK_RUN_ON(&sequence_checker_);
@@ -122,7 +122,7 @@
         transceivers_.end());
   }
   RtpTransceiverProxyRefPtr FindBySender(
-      rtc::scoped_refptr<RtpSenderInterface> sender) const;
+      scoped_refptr<RtpSenderInterface> sender) const;
   RtpTransceiverProxyRefPtr FindByMid(const std::string& mid) const;
   RtpTransceiverProxyRefPtr FindByMLineIndex(size_t mline_index) const;
 
diff --git a/pc/video_rtp_receiver.cc b/pc/video_rtp_receiver.cc
index c6acc60..0e18ade 100644
--- a/pc/video_rtp_receiver.cc
+++ b/pc/video_rtp_receiver.cc
@@ -51,10 +51,10 @@
 VideoRtpReceiver::VideoRtpReceiver(
     Thread* worker_thread,
     const std::string& receiver_id,
-    const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams)
+    const std::vector<scoped_refptr<MediaStreamInterface>>& streams)
     : worker_thread_(worker_thread),
       id_(receiver_id),
-      source_(rtc::make_ref_counted<VideoRtpTrackSource>(&source_callback_)),
+      source_(make_ref_counted<VideoRtpTrackSource>(&source_callback_)),
       track_(VideoTrackProxyWithInternal<VideoTrack>::Create(
           Thread::Current(),
           worker_thread,
@@ -78,14 +78,13 @@
   return stream_ids;
 }
 
-rtc::scoped_refptr<DtlsTransportInterface> VideoRtpReceiver::dtls_transport()
-    const {
+scoped_refptr<DtlsTransportInterface> VideoRtpReceiver::dtls_transport() const {
   RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
   return dtls_transport_;
 }
 
-std::vector<rtc::scoped_refptr<MediaStreamInterface>>
-VideoRtpReceiver::streams() const {
+std::vector<scoped_refptr<MediaStreamInterface>> VideoRtpReceiver::streams()
+    const {
   RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
   return streams_;
 }
@@ -101,7 +100,7 @@
 }
 
 void VideoRtpReceiver::SetFrameDecryptor(
-    rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor) {
+    scoped_refptr<FrameDecryptorInterface> frame_decryptor) {
   RTC_DCHECK_RUN_ON(worker_thread_);
   frame_decryptor_ = std::move(frame_decryptor);
   // Special Case: Set the frame decryptor to any value on any existing channel.
@@ -110,14 +109,14 @@
   }
 }
 
-rtc::scoped_refptr<FrameDecryptorInterface>
-VideoRtpReceiver::GetFrameDecryptor() const {
+scoped_refptr<FrameDecryptorInterface> VideoRtpReceiver::GetFrameDecryptor()
+    const {
   RTC_DCHECK_RUN_ON(worker_thread_);
   return frame_decryptor_;
 }
 
 void VideoRtpReceiver::SetFrameTransformer(
-    rtc::scoped_refptr<FrameTransformerInterface> frame_transformer) {
+    scoped_refptr<FrameTransformerInterface> frame_transformer) {
   RTC_DCHECK_RUN_ON(worker_thread_);
   frame_transformer_ = std::move(frame_transformer);
   if (media_channel_) {
@@ -219,13 +218,13 @@
 }
 
 void VideoRtpReceiver::set_transport(
-    rtc::scoped_refptr<DtlsTransportInterface> dtls_transport) {
+    scoped_refptr<DtlsTransportInterface> dtls_transport) {
   RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
   dtls_transport_ = std::move(dtls_transport);
 }
 
 void VideoRtpReceiver::SetStreams(
-    const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams) {
+    const std::vector<scoped_refptr<MediaStreamInterface>>& streams) {
   RTC_DCHECK_RUN_ON(&signaling_thread_checker_);
   // Remove remote track from any streams that are going away.
   for (const auto& existing_stream : streams_) {
diff --git a/pc/video_rtp_receiver.h b/pc/video_rtp_receiver.h
index 1a13116..5bd2e6a 100644
--- a/pc/video_rtp_receiver.h
+++ b/pc/video_rtp_receiver.h
@@ -54,20 +54,19 @@
   VideoRtpReceiver(
       Thread* worker_thread,
       const std::string& receiver_id,
-      const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams);
+      const std::vector<scoped_refptr<MediaStreamInterface>>& streams);
 
   virtual ~VideoRtpReceiver();
 
-  rtc::scoped_refptr<VideoTrackInterface> video_track() const { return track_; }
+  scoped_refptr<VideoTrackInterface> video_track() const { return track_; }
 
   // RtpReceiverInterface implementation
-  rtc::scoped_refptr<MediaStreamTrackInterface> track() const override {
+  scoped_refptr<MediaStreamTrackInterface> track() const override {
     return track_;
   }
-  rtc::scoped_refptr<DtlsTransportInterface> dtls_transport() const override;
+  scoped_refptr<DtlsTransportInterface> dtls_transport() const override;
   std::vector<std::string> stream_ids() const override;
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams()
-      const override;
+  std::vector<scoped_refptr<MediaStreamInterface>> streams() const override;
   webrtc::MediaType media_type() const override {
     return webrtc::MediaType::VIDEO;
   }
@@ -77,13 +76,12 @@
   RtpParameters GetParameters() const override;
 
   void SetFrameDecryptor(
-      rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor) override;
+      scoped_refptr<FrameDecryptorInterface> frame_decryptor) override;
 
-  rtc::scoped_refptr<FrameDecryptorInterface> GetFrameDecryptor()
-      const override;
+  scoped_refptr<FrameDecryptorInterface> GetFrameDecryptor() const override;
 
   void SetFrameTransformer(
-      rtc::scoped_refptr<FrameTransformerInterface> frame_transformer) override;
+      scoped_refptr<FrameTransformerInterface> frame_transformer) override;
 
   // RtpReceiverInternal implementation.
   void Stop() override;
@@ -93,9 +91,9 @@
   void NotifyFirstPacketReceived() override;
   void set_stream_ids(std::vector<std::string> stream_ids) override;
   void set_transport(
-      rtc::scoped_refptr<DtlsTransportInterface> dtls_transport) override;
-  void SetStreams(const std::vector<rtc::scoped_refptr<MediaStreamInterface>>&
-                      streams) override;
+      scoped_refptr<DtlsTransportInterface> dtls_transport) override;
+  void SetStreams(
+      const std::vector<scoped_refptr<MediaStreamInterface>>& streams) override;
 
   void SetObserver(RtpReceiverObserverInterface* observer) override;
 
@@ -152,20 +150,20 @@
   std::optional<uint32_t> signaled_ssrc_ RTC_GUARDED_BY(worker_thread_);
   // `source_` is held here to be able to change the state of the source when
   // the VideoRtpReceiver is stopped.
-  const rtc::scoped_refptr<VideoRtpTrackSource> source_;
-  const rtc::scoped_refptr<VideoTrackProxyWithInternal<VideoTrack>> track_;
-  std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams_
+  const scoped_refptr<VideoRtpTrackSource> source_;
+  const scoped_refptr<VideoTrackProxyWithInternal<VideoTrack>> track_;
+  std::vector<scoped_refptr<MediaStreamInterface>> streams_
       RTC_GUARDED_BY(&signaling_thread_checker_);
   RtpReceiverObserverInterface* observer_
       RTC_GUARDED_BY(&signaling_thread_checker_) = nullptr;
   bool received_first_packet_ RTC_GUARDED_BY(&signaling_thread_checker_) =
       false;
   const int attachment_id_;
-  rtc::scoped_refptr<FrameDecryptorInterface> frame_decryptor_
+  scoped_refptr<FrameDecryptorInterface> frame_decryptor_
       RTC_GUARDED_BY(worker_thread_);
-  rtc::scoped_refptr<DtlsTransportInterface> dtls_transport_
+  scoped_refptr<DtlsTransportInterface> dtls_transport_
       RTC_GUARDED_BY(&signaling_thread_checker_);
-  rtc::scoped_refptr<FrameTransformerInterface> frame_transformer_
+  scoped_refptr<FrameTransformerInterface> frame_transformer_
       RTC_GUARDED_BY(worker_thread_);
   // Stores the minimum jitter buffer delay. Handles caching cases
   // if `SetJitterBufferMinimumDelay` is called before start.
diff --git a/pc/video_rtp_receiver_unittest.cc b/pc/video_rtp_receiver_unittest.cc
index 5db0acd..b5131ad 100644
--- a/pc/video_rtp_receiver_unittest.cc
+++ b/pc/video_rtp_receiver_unittest.cc
@@ -79,7 +79,7 @@
   VideoRtpReceiverTest()
       : worker_thread_(Thread::Create()),
         channel_(VideoOptions()),
-        receiver_(rtc::make_ref_counted<VideoRtpReceiver>(
+        receiver_(make_ref_counted<VideoRtpReceiver>(
             worker_thread_.get(),
             std::string("receiver"),
             std::vector<std::string>({"stream"}))) {
@@ -107,7 +107,7 @@
   AutoThread main_thread_;
   std::unique_ptr<Thread> worker_thread_;
   NiceMock<MockVideoMediaReceiveChannel> channel_;
-  rtc::scoped_refptr<VideoRtpReceiver> receiver_;
+  scoped_refptr<VideoRtpReceiver> receiver_;
 };
 
 TEST_F(VideoRtpReceiverTest, SupportsEncodedOutput) {
diff --git a/pc/video_rtp_track_source.cc b/pc/video_rtp_track_source.cc
index 5979836..7537de9 100644
--- a/pc/video_rtp_track_source.cc
+++ b/pc/video_rtp_track_source.cc
@@ -43,7 +43,7 @@
 void VideoRtpTrackSource::BroadcastRecordableEncodedFrame(
     const RecordableEncodedFrame& frame) const {
   MutexLock lock(&mu_);
-  for (rtc::VideoSinkInterface<RecordableEncodedFrame>* sink : encoded_sinks_) {
+  for (VideoSinkInterface<RecordableEncodedFrame>* sink : encoded_sinks_) {
     sink->OnFrame(frame);
   }
 }
diff --git a/pc/video_rtp_track_source_unittest.cc b/pc/video_rtp_track_source_unittest.cc
index f95376c..4aefb17 100644
--- a/pc/video_rtp_track_source_unittest.cc
+++ b/pc/video_rtp_track_source_unittest.cc
@@ -37,9 +37,9 @@
   MOCK_METHOD(void, OnFrame, (const RecordableEncodedFrame&), (override));
 };
 
-rtc::scoped_refptr<VideoRtpTrackSource> MakeSource(
+scoped_refptr<VideoRtpTrackSource> MakeSource(
     VideoRtpTrackSource::Callback* callback) {
-  return rtc::make_ref_counted<VideoRtpTrackSource>(callback);
+  return make_ref_counted<VideoRtpTrackSource>(callback);
 }
 
 TEST(VideoRtpTrackSourceTest, CreatesWithRemoteAtttributeSet) {
@@ -113,7 +113,7 @@
 
 class TestFrame : public RecordableEncodedFrame {
  public:
-  rtc::scoped_refptr<const EncodedImageBufferInterface> encoded_buffer()
+  scoped_refptr<const EncodedImageBufferInterface> encoded_buffer()
       const override {
     return nullptr;
   }
diff --git a/pc/video_track.cc b/pc/video_track.cc
index 94bb5e7..ad2ce05 100644
--- a/pc/video_track.cc
+++ b/pc/video_track.cc
@@ -31,8 +31,8 @@
 
 VideoTrack::VideoTrack(
     absl::string_view label,
-    rtc::scoped_refptr<
-        VideoTrackSourceProxyWithInternal<VideoTrackSourceInterface>> source,
+    scoped_refptr<VideoTrackSourceProxyWithInternal<VideoTrackSourceInterface>>
+        source,
     Thread* worker_thread)
     : MediaStreamTrack<VideoTrackInterface>(label),
       worker_thread_(worker_thread),
@@ -57,7 +57,7 @@
 
 // AddOrUpdateSink and RemoveSink should be called on the worker
 // thread.
-void VideoTrack::AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink,
+void VideoTrack::AddOrUpdateSink(VideoSinkInterface<VideoFrame>* sink,
                                  const VideoSinkWants& wants) {
   RTC_DCHECK_RUN_ON(worker_thread_);
   VideoSourceBaseGuarded::AddOrUpdateSink(sink, wants);
@@ -66,7 +66,7 @@
   video_source_->internal()->AddOrUpdateSink(sink, modified_wants);
 }
 
-void VideoTrack::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
+void VideoTrack::RemoveSink(VideoSinkInterface<VideoFrame>* sink) {
   RTC_DCHECK_RUN_ON(worker_thread_);
   VideoSourceBaseGuarded::RemoveSink(sink);
   video_source_->internal()->RemoveSink(sink);
@@ -138,17 +138,16 @@
   set_state(state == MediaSourceInterface::kEnded ? kEnded : kLive);
 }
 
-rtc::scoped_refptr<VideoTrack> VideoTrack::Create(
+scoped_refptr<VideoTrack> VideoTrack::Create(
     absl::string_view id,
-    rtc::scoped_refptr<VideoTrackSourceInterface> source,
+    scoped_refptr<VideoTrackSourceInterface> source,
     Thread* worker_thread) {
-  rtc::scoped_refptr<
-      VideoTrackSourceProxyWithInternal<VideoTrackSourceInterface>>
+  scoped_refptr<VideoTrackSourceProxyWithInternal<VideoTrackSourceInterface>>
       source_proxy = VideoTrackSourceProxy::Create(
           Thread::Current(), worker_thread, std::move(source));
 
-  return rtc::make_ref_counted<VideoTrack>(id, std::move(source_proxy),
-                                           worker_thread);
+  return make_ref_counted<VideoTrack>(id, std::move(source_proxy),
+                                      worker_thread);
 }
 
 }  // namespace webrtc
diff --git a/pc/video_track.h b/pc/video_track.h
index 75eec0b..4c41550 100644
--- a/pc/video_track.h
+++ b/pc/video_track.h
@@ -37,9 +37,9 @@
                    public VideoSourceBaseGuarded,
                    public ObserverInterface {
  public:
-  static rtc::scoped_refptr<VideoTrack> Create(
+  static scoped_refptr<VideoTrack> Create(
       absl::string_view label,
-      rtc::scoped_refptr<VideoTrackSourceInterface> source,
+      scoped_refptr<VideoTrackSourceInterface> source,
       Thread* worker_thread);
 
   void AddOrUpdateSink(VideoSinkInterface<VideoFrame>* sink,
@@ -61,7 +61,7 @@
  protected:
   VideoTrack(
       absl::string_view id,
-      rtc::scoped_refptr<
+      scoped_refptr<
           VideoTrackSourceProxyWithInternal<VideoTrackSourceInterface>> source,
       Thread* worker_thread);
   ~VideoTrack();
@@ -72,7 +72,7 @@
 
   RTC_NO_UNIQUE_ADDRESS SequenceChecker signaling_thread_;
   Thread* const worker_thread_;
-  const rtc::scoped_refptr<
+  const scoped_refptr<
       VideoTrackSourceProxyWithInternal<VideoTrackSourceInterface>>
       video_source_;
   ContentHint content_hint_ RTC_GUARDED_BY(&signaling_thread_);
diff --git a/pc/video_track_source.cc b/pc/video_track_source.cc
index d7d26c0..d9b5f19 100644
--- a/pc/video_track_source.cc
+++ b/pc/video_track_source.cc
@@ -30,14 +30,13 @@
   }
 }
 
-void VideoTrackSource::AddOrUpdateSink(
-    rtc::VideoSinkInterface<VideoFrame>* sink,
-    const VideoSinkWants& wants) {
+void VideoTrackSource::AddOrUpdateSink(VideoSinkInterface<VideoFrame>* sink,
+                                       const VideoSinkWants& wants) {
   RTC_DCHECK(worker_thread_checker_.IsCurrent());
   source()->AddOrUpdateSink(sink, wants);
 }
 
-void VideoTrackSource::RemoveSink(rtc::VideoSinkInterface<VideoFrame>* sink) {
+void VideoTrackSource::RemoveSink(VideoSinkInterface<VideoFrame>* sink) {
   RTC_DCHECK(worker_thread_checker_.IsCurrent());
   source()->RemoveSink(sink);
 }
diff --git a/pc/video_track_source_proxy.cc b/pc/video_track_source_proxy.cc
index 95edcfe..d772f59 100644
--- a/pc/video_track_source_proxy.cc
+++ b/pc/video_track_source_proxy.cc
@@ -17,13 +17,13 @@
 
 namespace webrtc {
 
-rtc::scoped_refptr<VideoTrackSourceInterface> CreateVideoTrackSourceProxy(
+scoped_refptr<VideoTrackSourceInterface> CreateVideoTrackSourceProxy(
     Thread* signaling_thread,
     Thread* worker_thread,
     VideoTrackSourceInterface* source) {
   return VideoTrackSourceProxy::Create(
       signaling_thread, worker_thread,
-      rtc::scoped_refptr<VideoTrackSourceInterface>(source));
+      scoped_refptr<VideoTrackSourceInterface>(source));
 }
 
 }  // namespace webrtc
diff --git a/pc/video_track_unittest.cc b/pc/video_track_unittest.cc
index 7a93fb3..c003a51 100644
--- a/pc/video_track_unittest.cc
+++ b/pc/video_track_unittest.cc
@@ -35,7 +35,7 @@
  public:
   VideoTrackTest() : frame_source_(640, 480, webrtc::kNumMicrosecsPerSec / 30) {
     static const char kVideoTrackId[] = "track_id";
-    video_track_source_ = rtc::make_ref_counted<FakeVideoTrackSource>(
+    video_track_source_ = webrtc::make_ref_counted<FakeVideoTrackSource>(
         /*is_screencast=*/false);
     video_track_ = VideoTrack::Create(kVideoTrackId, video_track_source_,
                                       webrtc::Thread::Current());
@@ -43,8 +43,8 @@
 
  protected:
   webrtc::AutoThread main_thread_;
-  rtc::scoped_refptr<FakeVideoTrackSource> video_track_source_;
-  rtc::scoped_refptr<VideoTrack> video_track_;
+  webrtc::scoped_refptr<FakeVideoTrackSource> video_track_source_;
+  webrtc::scoped_refptr<VideoTrack> video_track_;
   webrtc::FakeFrameSource frame_source_;
 };
 
diff --git a/pc/webrtc_sdp.cc b/pc/webrtc_sdp.cc
index 4b0240b..a87a82c 100644
--- a/pc/webrtc_sdp.cc
+++ b/pc/webrtc_sdp.cc
@@ -68,8 +68,8 @@
 #include "rtc_base/string_encode.h"
 #include "rtc_base/strings/string_builder.h"
 
-using cricket::Candidate;
 using ::webrtc::AudioContentDescription;
+using webrtc::Candidate;
 using ::webrtc::Candidates;
 using ::webrtc::ContentInfo;
 using ::webrtc::ICE_CANDIDATE_COMPONENT_RTCP;
@@ -203,9 +203,10 @@
 static const char kCandidateRelay[] = "relay";
 static const char kTcpCandidateType[] = "tcptype";
 
-// rtc::StringBuilder doesn't have a << overload for chars, while rtc::split and
-// rtc::tokenize_first both take a char delimiter. To handle both cases these
-// constants come in pairs of a chars and length-one strings.
+// webrtc::StringBuilder doesn't have a << overload for chars, while
+// webrtc::split and webrtc::tokenize_first both take a char delimiter. To
+// handle both cases these constants come in pairs of a chars and length-one
+// strings.
 static const char kSdpDelimiterEqual[] = "=";
 static const char kSdpDelimiterEqualChar = '=';
 static const char kSdpDelimiterSpace[] = " ";
@@ -653,7 +654,7 @@
                                absl::string_view s,
                                T* t,
                                SdpParseError* error) {
-  if (!rtc::FromString(s, t)) {
+  if (!FromString(s, t)) {
     StringBuilder description;
     description << "Invalid value: " << s << ".";
     return ParseFailed(line, description.Release(), error);
@@ -873,7 +874,7 @@
   // BUNDLE Groups
   std::vector<const ContentGroup*> groups =
       desc->GetGroupsByName(GROUP_TYPE_BUNDLE);
-  for (const cricket::ContentGroup* group : groups) {
+  for (const ContentGroup* group : groups) {
     std::string group_line = kAttrGroup;
     RTC_DCHECK(group != NULL);
     for (const std::string& content_name : group->content_names()) {
@@ -890,7 +891,7 @@
   }
 
   // MediaStream semantics.
-  // TODO(bugs.webrtc.org/10421): Change to & cricket::kMsidSignalingSemantic
+  // TODO(bugs.webrtc.org/10421): Change to & webrtc::kMsidSignalingSemantic
   // when we think it's safe to do so, so that we gradually fade out this old
   // line that was removed from the specification.
   if (desc->msid_signaling() != kMsidSignalingNotUsed) {
@@ -920,7 +921,7 @@
   // TODO(deadbeef): It's weird that we need to iterate TransportInfos for
   // this, when it's a session-level attribute. It really should be moved to a
   // session-level structure like SessionDescription.
-  for (const cricket::TransportInfo& transport : desc->transport_infos()) {
+  for (const TransportInfo& transport : desc->transport_infos()) {
     if (transport.description.ice_mode == ICEMODE_LITE) {
       InitAttrLine(kAttributeIceLite, &os);
       AddLine(os.str(), &message);
@@ -2629,9 +2630,8 @@
 
 bool HasDuplicateMsidLines(SessionDescription* desc) {
   std::set<std::pair<std::string, std::string>> seen_msids;
-  for (const cricket::ContentInfo& content : desc->contents()) {
-    for (const cricket::StreamParams& stream :
-         content.media_description()->streams()) {
+  for (const ContentInfo& content : desc->contents()) {
+    for (const StreamParams& stream : content.media_description()->streams()) {
       auto msid = std::pair(stream.first_stream_id(), stream.id);
       if (seen_msids.find(msid) != seen_msids.end()) {
         return true;
diff --git a/pc/webrtc_sdp_unittest.cc b/pc/webrtc_sdp_unittest.cc
index 103ef8d..ba696d4 100644
--- a/pc/webrtc_sdp_unittest.cc
+++ b/pc/webrtc_sdp_unittest.cc
@@ -56,11 +56,11 @@
 #endif
 #include "pc/webrtc_sdp.h"
 
-using cricket::Candidate;
 using ::testing::ElementsAre;
 using ::testing::Field;
 using ::testing::Property;
 using ::webrtc::AudioContentDescription;
+using webrtc::Candidate;
 using ::webrtc::ContentGroup;
 using ::webrtc::ContentInfo;
 using ::webrtc::ICE_CANDIDATE_COMPONENT_RTCP;
@@ -1452,8 +1452,8 @@
     }
 
     // group
-    const cricket::ContentGroups groups1 = desc1.groups();
-    const cricket::ContentGroups groups2 = desc2.groups();
+    const webrtc::ContentGroups groups1 = desc1.groups();
+    const webrtc::ContentGroups groups2 = desc2.groups();
     EXPECT_EQ(groups1.size(), groups1.size());
     if (groups1.size() != groups2.size()) {
       ADD_FAILURE();
@@ -1463,23 +1463,23 @@
       const webrtc::ContentGroup group1 = groups1.at(i);
       const webrtc::ContentGroup group2 = groups2.at(i);
       EXPECT_EQ(group1.semantics(), group2.semantics());
-      const cricket::ContentNames names1 = group1.content_names();
-      const cricket::ContentNames names2 = group2.content_names();
+      const webrtc::ContentNames names1 = group1.content_names();
+      const webrtc::ContentNames names2 = group2.content_names();
       EXPECT_EQ(names1.size(), names2.size());
       if (names1.size() != names2.size()) {
         ADD_FAILURE();
         return;
       }
-      cricket::ContentNames::const_iterator iter1 = names1.begin();
-      cricket::ContentNames::const_iterator iter2 = names2.begin();
+      webrtc::ContentNames::const_iterator iter1 = names1.begin();
+      webrtc::ContentNames::const_iterator iter2 = names2.begin();
       while (iter1 != names1.end()) {
         EXPECT_EQ(*iter1++, *iter2++);
       }
     }
 
     // transport info
-    const cricket::TransportInfos transports1 = desc1.transport_infos();
-    const cricket::TransportInfos transports2 = desc2.transport_infos();
+    const webrtc::TransportInfos transports1 = desc1.transport_infos();
+    const webrtc::TransportInfos transports2 = desc2.transport_infos();
     EXPECT_EQ(transports1.size(), transports2.size());
     if (transports1.size() != transports2.size()) {
       ADD_FAILURE();
@@ -1620,8 +1620,7 @@
   // Removes everything in StreamParams from the session description that is
   // used for a=ssrc lines.
   void RemoveSsrcSignalingFromStreamParams() {
-    for (cricket::ContentInfo& content_info :
-         jdesc_.description()->contents()) {
+    for (webrtc::ContentInfo& content_info : jdesc_.description()->contents()) {
       // With Unified Plan there should be one StreamParams per m= section.
       StreamParams& stream =
           content_info.media_description()->mutable_streams()[0];
@@ -2659,7 +2658,7 @@
 
   sdp = kSdpTcpActiveCandidate;
   EXPECT_TRUE(SdpDeserializeCandidate(sdp, &jcandidate));
-  // Make a cricket::Candidate equivalent to kSdpTcpCandidate string.
+  // Make a webrtc::Candidate equivalent to kSdpTcpCandidate string.
   Candidate candidate(webrtc::ICE_CANDIDATE_COMPONENT_RTP, "tcp",
                       webrtc::SocketAddress("192.168.1.5", 9),
                       kCandidatePriority, "", "", IceCandidateType::kHost,
@@ -4472,7 +4471,7 @@
   JsepSessionDescription output(kDummyType);
   SdpParseError error;
   EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
-  const cricket::ContentInfos& contents = output.description()->contents();
+  const webrtc::ContentInfos& contents = output.description()->contents();
   const webrtc::MediaContentDescription* media =
       contents.back().media_description();
   EXPECT_TRUE(media->HasSimulcast());
@@ -4493,7 +4492,7 @@
   JsepSessionDescription output(kDummyType);
   SdpParseError error;
   EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
-  const cricket::ContentInfos& contents = output.description()->contents();
+  const webrtc::ContentInfos& contents = output.description()->contents();
   const webrtc::MediaContentDescription* media =
       contents.back().media_description();
   EXPECT_TRUE(media->HasSimulcast());
@@ -4531,7 +4530,7 @@
   JsepSessionDescription output(kDummyType);
   SdpParseError error;
   EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
-  const cricket::ContentInfos& contents = output.description()->contents();
+  const webrtc::ContentInfos& contents = output.description()->contents();
   const webrtc::MediaContentDescription* media =
       contents.back().media_description();
   EXPECT_TRUE(media->HasSimulcast());
@@ -4557,7 +4556,7 @@
   JsepSessionDescription output(kDummyType);
   SdpParseError error;
   EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
-  const cricket::ContentInfos& contents = output.description()->contents();
+  const webrtc::ContentInfos& contents = output.description()->contents();
   const webrtc::MediaContentDescription* media =
       contents.back().media_description();
   EXPECT_TRUE(media->HasSimulcast());
@@ -4583,7 +4582,7 @@
   JsepSessionDescription output(kDummyType);
   SdpParseError error;
   EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
-  const cricket::ContentInfos& contents = output.description()->contents();
+  const webrtc::ContentInfos& contents = output.description()->contents();
   const webrtc::MediaContentDescription* media =
       contents.back().media_description();
   EXPECT_TRUE(media->HasSimulcast());
@@ -4606,7 +4605,7 @@
   JsepSessionDescription output(kDummyType);
   SdpParseError error;
   EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
-  const cricket::ContentInfos& contents = output.description()->contents();
+  const webrtc::ContentInfos& contents = output.description()->contents();
   const webrtc::MediaContentDescription* media =
       contents.back().media_description();
   EXPECT_TRUE(media->HasSimulcast());
@@ -4637,7 +4636,7 @@
   JsepSessionDescription output(kDummyType);
   SdpParseError error;
   EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
-  const cricket::ContentInfos& contents = output.description()->contents();
+  const webrtc::ContentInfos& contents = output.description()->contents();
   const webrtc::MediaContentDescription* media =
       contents.back().media_description();
   EXPECT_TRUE(media->HasSimulcast());
@@ -4660,7 +4659,7 @@
   JsepSessionDescription output(kDummyType);
   SdpParseError error;
   EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
-  const cricket::ContentInfos& contents = output.description()->contents();
+  const webrtc::ContentInfos& contents = output.description()->contents();
   const webrtc::MediaContentDescription* media =
       contents.back().media_description();
   EXPECT_FALSE(media->HasSimulcast());
@@ -4674,7 +4673,7 @@
   JsepSessionDescription output(kDummyType);
   SdpParseError error;
   EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
-  const cricket::ContentInfos& contents = output.description()->contents();
+  const webrtc::ContentInfos& contents = output.description()->contents();
   const webrtc::MediaContentDescription* media =
       contents.back().media_description();
   EXPECT_FALSE(media->HasSimulcast());
@@ -4692,7 +4691,7 @@
   JsepSessionDescription output(kDummyType);
   SdpParseError error;
   EXPECT_TRUE(webrtc::SdpDeserialize(sdp, &output, &error));
-  const cricket::ContentInfos& contents = output.description()->contents();
+  const webrtc::ContentInfos& contents = output.description()->contents();
   const webrtc::MediaContentDescription* media =
       contents.back().media_description();
   EXPECT_TRUE(media->HasSimulcast());
diff --git a/pc/webrtc_session_description_factory.cc b/pc/webrtc_session_description_factory.cc
index eccfcbf..0ca42e4 100644
--- a/pc/webrtc_session_description_factory.cc
+++ b/pc/webrtc_session_description_factory.cc
@@ -45,8 +45,8 @@
 #include "rtc_base/ssl_stream_adapter.h"
 #include "rtc_base/unique_id_generator.h"
 
-using rtc::UniqueRandomIdGenerator;
 using ::webrtc::MediaSessionOptions;
+using webrtc::UniqueRandomIdGenerator;
 
 namespace webrtc {
 namespace {
@@ -61,7 +61,7 @@
 static bool ValidMediaSessionOptions(
     const MediaSessionOptions& session_options) {
   std::vector<SenderOptions> sorted_senders;
-  for (const cricket::MediaDescriptionOptions& media_description_options :
+  for (const MediaDescriptionOptions& media_description_options :
        session_options.media_description_options) {
     sorted_senders.insert(sorted_senders.end(),
                           media_description_options.sender_options.begin(),
@@ -87,8 +87,7 @@
   if (!source_desc) {
     return;
   }
-  const cricket::ContentInfos& contents =
-      source_desc->description()->contents();
+  const ContentInfos& contents = source_desc->description()->contents();
   const ContentInfo* cinfo =
       source_desc->description()->GetContentByName(content_name);
   if (!cinfo) {
@@ -116,8 +115,8 @@
     const std::string& session_id,
     bool dtls_enabled,
     std::unique_ptr<RTCCertificateGeneratorInterface> cert_generator,
-    rtc::scoped_refptr<RTCCertificate> certificate,
-    std::function<void(const rtc::scoped_refptr<webrtc::RTCCertificate>&)>
+    scoped_refptr<RTCCertificate> certificate,
+    std::function<void(const webrtc::scoped_refptr<webrtc::RTCCertificate>&)>
         on_certificate_ready,
     CodecLookupHelper* codec_lookup_helper,
     const FieldTrialsView& field_trials)
@@ -159,7 +158,7 @@
   certificate_request_state_ = CERTIFICATE_WAITING;
 
   auto callback = [weak_ptr = weak_factory_.GetWeakPtr()](
-                      rtc::scoped_refptr<rtc::RTCCertificate> certificate) {
+                      scoped_refptr<RTCCertificate> certificate) {
     if (!weak_ptr) {
       return;
     }
@@ -274,7 +273,7 @@
   if (sdp_info_->local_description()) {
     // If the needs-ice-restart flag is set as described by JSEP, we should
     // generate an offer with a new ufrag/password to trigger an ICE restart.
-    for (cricket::MediaDescriptionOptions& options :
+    for (MediaDescriptionOptions& options :
          request.options.media_description_options) {
       if (sdp_info_->NeedsIceRestart(options.mid)) {
         options.transport_options.ice_restart = true;
@@ -307,7 +306,7 @@
       SdpType::kOffer, std::move(desc), session_id_,
       absl::StrCat(session_version_++));
   if (sdp_info_->local_description()) {
-    for (const cricket::MediaDescriptionOptions& options :
+    for (const MediaDescriptionOptions& options :
          request.options.media_description_options) {
       if (!options.transport_options.ice_restart) {
         CopyCandidatesFromSessionDescription(sdp_info_->local_description(),
@@ -322,7 +321,7 @@
 void WebRtcSessionDescriptionFactory::InternalCreateAnswer(
     CreateSessionDescriptionRequest request) {
   if (sdp_info_->remote_description()) {
-    for (cricket::MediaDescriptionOptions& options :
+    for (MediaDescriptionOptions& options :
          request.options.media_description_options) {
       // According to http://tools.ietf.org/html/rfc5245#section-9.2.1.1
       // an answer should also contain new ICE ufrag and password if an offer
@@ -331,11 +330,10 @@
           sdp_info_->IceRestartPending(options.mid);
       // We should pass the current DTLS role to the transport description
       // factory, if there is already an existing ongoing session.
-      std::optional<rtc::SSLRole> dtls_role =
-          sdp_info_->GetDtlsRole(options.mid);
+      std::optional<SSLRole> dtls_role = sdp_info_->GetDtlsRole(options.mid);
       if (dtls_role) {
         options.transport_options.prefer_passive_role =
-            (rtc::SSL_SERVER == *dtls_role);
+            (SSL_SERVER == *dtls_role);
       }
     }
   }
@@ -369,7 +367,7 @@
   if (sdp_info_->local_description()) {
     // Include all local ICE candidates in the SessionDescription unless
     // the remote peer has requested an ICE restart.
-    for (const cricket::MediaDescriptionOptions& options :
+    for (const MediaDescriptionOptions& options :
          request.options.media_description_options) {
       if (!options.transport_options.ice_restart) {
         CopyCandidatesFromSessionDescription(sdp_info_->local_description(),
@@ -401,8 +399,7 @@
 void WebRtcSessionDescriptionFactory::PostCreateSessionDescriptionFailed(
     CreateSessionDescriptionObserver* observer,
     RTCError error) {
-  Post([observer =
-            rtc::scoped_refptr<CreateSessionDescriptionObserver>(observer),
+  Post([observer = scoped_refptr<CreateSessionDescriptionObserver>(observer),
         error]() mutable { observer->OnFailure(error); });
   RTC_LOG(LS_ERROR) << "CreateSessionDescription failed: " << error.message();
 }
@@ -410,8 +407,7 @@
 void WebRtcSessionDescriptionFactory::PostCreateSessionDescriptionSucceeded(
     CreateSessionDescriptionObserver* observer,
     std::unique_ptr<SessionDescriptionInterface> description) {
-  Post([observer =
-            rtc::scoped_refptr<CreateSessionDescriptionObserver>(observer),
+  Post([observer = scoped_refptr<CreateSessionDescriptionObserver>(observer),
         description = std::move(description)]() mutable {
     observer->OnSuccess(description.release());
   });
@@ -443,7 +439,7 @@
 }
 
 void WebRtcSessionDescriptionFactory::SetCertificate(
-    rtc::scoped_refptr<RTCCertificate> certificate) {
+    scoped_refptr<RTCCertificate> certificate) {
   RTC_DCHECK(certificate);
   RTC_LOG(LS_VERBOSE) << "Setting new certificate.";
 
diff --git a/pc/webrtc_session_description_factory.h b/pc/webrtc_session_description_factory.h
index 580864e..3f3e6b6 100644
--- a/pc/webrtc_session_description_factory.h
+++ b/pc/webrtc_session_description_factory.h
@@ -52,8 +52,8 @@
       const std::string& session_id,
       bool dtls_enabled,
       std::unique_ptr<RTCCertificateGeneratorInterface> cert_generator,
-      rtc::scoped_refptr<RTCCertificate> certificate,
-      std::function<void(const rtc::scoped_refptr<webrtc::RTCCertificate>&)>
+      scoped_refptr<RTCCertificate> certificate,
+      std::function<void(const webrtc::scoped_refptr<webrtc::RTCCertificate>&)>
           on_certificate_ready,
       CodecLookupHelper* codec_lookup_helper,
       const FieldTrialsView& field_trials);
@@ -112,7 +112,7 @@
         : type(type), observer(observer), options(options) {}
 
     Type type;
-    rtc::scoped_refptr<CreateSessionDescriptionObserver> observer;
+    scoped_refptr<CreateSessionDescriptionObserver> observer;
     MediaSessionOptions options;
   };
 
@@ -131,7 +131,7 @@
   void Post(absl::AnyInvocable<void() &&> callback);
 
   void OnCertificateRequestFailed();
-  void SetCertificate(rtc::scoped_refptr<RTCCertificate> certificate);
+  void SetCertificate(scoped_refptr<RTCCertificate> certificate);
 
   std::queue<CreateSessionDescriptionRequest>
       create_session_description_requests_;
@@ -145,7 +145,7 @@
   CertificateRequestState certificate_request_state_;
   std::queue<absl::AnyInvocable<void() &&>> callbacks_;
 
-  std::function<void(const rtc::scoped_refptr<webrtc::RTCCertificate>&)>
+  std::function<void(const webrtc::scoped_refptr<webrtc::RTCCertificate>&)>
       on_certificate_ready_;
 
   WeakPtrFactory<WebRtcSessionDescriptionFactory> weak_factory_{this};