Replace scoped_ptr with unique_ptr everywhere

But keep #including scoped_ptr.h in .h files, so as not to break
WebRTC users who expect those .h files to give them rtc::scoped_ptr.

BUG=webrtc:5520

Review-Url: https://codereview.webrtc.org/1937693002
Cr-Commit-Position: refs/heads/master@{#12581}
diff --git a/webrtc/api/quicdatachannel_unittest.cc b/webrtc/api/quicdatachannel_unittest.cc
index 1c5fc02..e701c29 100644
--- a/webrtc/api/quicdatachannel_unittest.cc
+++ b/webrtc/api/quicdatachannel_unittest.cc
@@ -11,13 +11,13 @@
 #include "webrtc/api/quicdatachannel.h"
 
 #include <map>
+#include <memory>
 #include <sstream>
 #include <string>
 #include <vector>
 
 #include "webrtc/base/bind.h"
 #include "webrtc/base/gunit.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/scoped_ref_ptr.h"
 #include "webrtc/p2p/base/faketransportcontroller.h"
 #include "webrtc/p2p/quic/quictransportchannel.h"
@@ -66,7 +66,7 @@
 static rtc::SSLFingerprint* CreateFingerprint(rtc::RTCCertificate* cert) {
   std::string digest_algorithm;
   cert->ssl_certificate().GetSignatureDigestAlgorithm(&digest_algorithm);
-  rtc::scoped_ptr<rtc::SSLFingerprint> fingerprint(
+  std::unique_ptr<rtc::SSLFingerprint> fingerprint(
       rtc::SSLFingerprint::Create(digest_algorithm, cert->identity()));
   return fingerprint.release();
 }
@@ -176,7 +176,7 @@
 
   void GenerateCertificateAndFingerprint() {
     rtc::scoped_refptr<rtc::RTCCertificate> local_cert =
-        rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>(
+        rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>(
             rtc::SSLIdentity::Generate("cert_name", rtc::KT_DEFAULT)));
     quic_transport_channel_.SetLocalCertificate(local_cert);
     local_fingerprint_.reset(CreateFingerprint(local_cert.get()));
@@ -206,7 +206,7 @@
     ice_transport_channel_->SetDestination(other_peer->ice_transport_channel_);
   }
 
-  rtc::scoped_ptr<rtc::SSLFingerprint>& local_fingerprint() {
+  std::unique_ptr<rtc::SSLFingerprint>& local_fingerprint() {
     return local_fingerprint_;
   }
 
@@ -222,7 +222,7 @@
   FakeTransportChannel* ice_transport_channel_;
   QuicTransportChannel quic_transport_channel_;
 
-  rtc::scoped_ptr<rtc::SSLFingerprint> local_fingerprint_;
+  std::unique_ptr<rtc::SSLFingerprint> local_fingerprint_;
 
   FakeQuicDataTransport fake_quic_data_transport_;
 };
@@ -248,9 +248,9 @@
     peer1_.quic_transport_channel()->SetSslRole(rtc::SSL_CLIENT);
     peer2_.quic_transport_channel()->SetSslRole(rtc::SSL_SERVER);
 
-    rtc::scoped_ptr<rtc::SSLFingerprint>& peer1_fingerprint =
+    std::unique_ptr<rtc::SSLFingerprint>& peer1_fingerprint =
         peer1_.local_fingerprint();
-    rtc::scoped_ptr<rtc::SSLFingerprint>& peer2_fingerprint =
+    std::unique_ptr<rtc::SSLFingerprint>& peer2_fingerprint =
         peer2_.local_fingerprint();
 
     peer1_.quic_transport_channel()->SetRemoteFingerprint(
diff --git a/webrtc/api/quicdatatransport_unittest.cc b/webrtc/api/quicdatatransport_unittest.cc
index ef9af36..d668c55b 100644
--- a/webrtc/api/quicdatatransport_unittest.cc
+++ b/webrtc/api/quicdatatransport_unittest.cc
@@ -10,6 +10,7 @@
 
 #include "webrtc/api/quicdatatransport.h"
 
+#include <memory>
 #include <set>
 #include <string>
 #include <unordered_map>
@@ -71,7 +72,7 @@
 
   void GenerateCertificateAndFingerprint() {
     rtc::scoped_refptr<rtc::RTCCertificate> local_cert =
-        rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>(
+        rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>(
             rtc::SSLIdentity::Generate("cert_name", rtc::KT_DEFAULT)));
     quic_transport_channel_.SetLocalCertificate(local_cert);
     local_fingerprint_.reset(CreateFingerprint(local_cert.get()));
@@ -84,7 +85,7 @@
     ice_transport_channel_->SetDestination(other_peer->ice_transport_channel_);
   }
 
-  rtc::scoped_ptr<rtc::SSLFingerprint>& local_fingerprint() {
+  std::unique_ptr<rtc::SSLFingerprint>& local_fingerprint() {
     return local_fingerprint_;
   }
 
@@ -116,7 +117,7 @@
   rtc::SSLFingerprint* CreateFingerprint(rtc::RTCCertificate* cert) {
     std::string digest_algorithm;
     cert->ssl_certificate().GetSignatureDigestAlgorithm(&digest_algorithm);
-    rtc::scoped_ptr<rtc::SSLFingerprint> fingerprint(
+    std::unique_ptr<rtc::SSLFingerprint> fingerprint(
         rtc::SSLFingerprint::Create(digest_algorithm, cert->identity()));
     return fingerprint.release();
   }
@@ -124,7 +125,7 @@
   QuicDataTransport quic_data_transport_;
   FakeTransportChannel* ice_transport_channel_;
   QuicTransportChannel quic_transport_channel_;
-  rtc::scoped_ptr<rtc::SSLFingerprint> local_fingerprint_;
+  std::unique_ptr<rtc::SSLFingerprint> local_fingerprint_;
 };
 
 class QuicDataTransportTest : public testing::Test {
@@ -154,9 +155,9 @@
     peer1_.quic_transport_channel()->SetSslRole(rtc::SSL_CLIENT);
     peer2_.quic_transport_channel()->SetSslRole(rtc::SSL_SERVER);
 
-    rtc::scoped_ptr<rtc::SSLFingerprint>& peer1_fingerprint =
+    std::unique_ptr<rtc::SSLFingerprint>& peer1_fingerprint =
         peer1_.local_fingerprint();
-    rtc::scoped_ptr<rtc::SSLFingerprint>& peer2_fingerprint =
+    std::unique_ptr<rtc::SSLFingerprint>& peer2_fingerprint =
         peer2_.local_fingerprint();
 
     peer1_.quic_transport_channel()->SetRemoteFingerprint(
diff --git a/webrtc/audio_send_stream.h b/webrtc/audio_send_stream.h
index 24c3d77..18e7125 100644
--- a/webrtc/audio_send_stream.h
+++ b/webrtc/audio_send_stream.h
@@ -11,6 +11,7 @@
 #ifndef WEBRTC_AUDIO_SEND_STREAM_H_
 #define WEBRTC_AUDIO_SEND_STREAM_H_
 
+#include <memory>
 #include <string>
 #include <vector>
 
@@ -84,7 +85,7 @@
     // Ownership of the encoder object is transferred to Call when the config is
     // passed to Call::CreateAudioSendStream().
     // TODO(solenberg): Implement, once we configure codecs through the new API.
-    // rtc::scoped_ptr<AudioEncoder> encoder;
+    // std::unique_ptr<AudioEncoder> encoder;
     int cng_payload_type = -1;  // pt, or -1 to disable Comfort Noise Generator.
     int red_payload_type = -1;  // pt, or -1 to disable REDundant coding.
   };
diff --git a/webrtc/base/optional.h b/webrtc/base/optional.h
index f250865..7320533 100644
--- a/webrtc/base/optional.h
+++ b/webrtc/base/optional.h
@@ -12,6 +12,7 @@
 #define WEBRTC_BASE_OPTIONAL_H_
 
 #include <algorithm>
+#include <memory>
 #include <utility>
 
 #include "webrtc/base/checks.h"
@@ -21,7 +22,7 @@
 // Simple std::experimental::optional-wannabe. It either contains a T or not.
 // In order to keep the implementation simple and portable, this implementation
 // actually contains a (default-constructed) T even when it supposedly doesn't
-// contain a value; use e.g. rtc::scoped_ptr<T> instead if that's too
+// contain a value; use e.g. std::unique_ptr<T> instead if that's too
 // expensive.
 //
 // A moved-from Optional<T> may only be destroyed, and assigned to if T allows
diff --git a/webrtc/base/scoped_ptr.h b/webrtc/base/scoped_ptr.h
index db5ef9e..af515f6 100644
--- a/webrtc/base/scoped_ptr.h
+++ b/webrtc/base/scoped_ptr.h
@@ -33,7 +33,7 @@
 template <typename T, typename Deleter = std::default_delete<T>>
 using scoped_ptr = std::unique_ptr<T, Deleter>;
 
-// These used to convert between rtc::scoped_ptr and std::unique_ptr. Now they
+// These used to convert between std::unique_ptr and std::unique_ptr. Now they
 // are no-ops.
 template <typename T>
 std::unique_ptr<T> ScopedToUnique(std::unique_ptr<T> up) {
diff --git a/webrtc/base/thread.h b/webrtc/base/thread.h
index 7623424..1a0c447 100644
--- a/webrtc/base/thread.h
+++ b/webrtc/base/thread.h
@@ -13,6 +13,7 @@
 
 #include <algorithm>
 #include <list>
+#include <memory>
 #include <string>
 #include <vector>
 
diff --git a/webrtc/base/thread_unittest.cc b/webrtc/base/thread_unittest.cc
index d733058..bf3cbd0 100644
--- a/webrtc/base/thread_unittest.cc
+++ b/webrtc/base/thread_unittest.cc
@@ -8,6 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <memory>
+
 #include "webrtc/base/asyncinvoker.h"
 #include "webrtc/base/asyncudpsocket.h"
 #include "webrtc/base/event.h"
diff --git a/webrtc/common_audio/audio_ring_buffer.h b/webrtc/common_audio/audio_ring_buffer.h
index ae825a3..6bf3a19 100644
--- a/webrtc/common_audio/audio_ring_buffer.h
+++ b/webrtc/common_audio/audio_ring_buffer.h
@@ -11,6 +11,8 @@
 #define WEBRTC_COMMON_AUDIO_AUDIO_RING_BUFFER_H_
 
 #include <stddef.h>
+
+#include <memory>
 #include <vector>
 
 struct RingBuffer;
diff --git a/webrtc/common_audio/real_fourier.cc b/webrtc/common_audio/real_fourier.cc
index 55ec49c..67f942d 100644
--- a/webrtc/common_audio/real_fourier.cc
+++ b/webrtc/common_audio/real_fourier.cc
@@ -21,11 +21,11 @@
 
 const size_t RealFourier::kFftBufferAlignment = 32;
 
-rtc::scoped_ptr<RealFourier> RealFourier::Create(int fft_order) {
+std::unique_ptr<RealFourier> RealFourier::Create(int fft_order) {
 #if defined(RTC_USE_OPENMAX_DL)
-  return rtc::scoped_ptr<RealFourier>(new RealFourierOpenmax(fft_order));
+  return std::unique_ptr<RealFourier>(new RealFourierOpenmax(fft_order));
 #else
-  return rtc::scoped_ptr<RealFourier>(new RealFourierOoura(fft_order));
+  return std::unique_ptr<RealFourier>(new RealFourierOoura(fft_order));
 #endif
 }
 
diff --git a/webrtc/common_audio/real_fourier.h b/webrtc/common_audio/real_fourier.h
index 0be56a5..8dbb98f 100644
--- a/webrtc/common_audio/real_fourier.h
+++ b/webrtc/common_audio/real_fourier.h
@@ -12,6 +12,7 @@
 #define WEBRTC_COMMON_AUDIO_REAL_FOURIER_H_
 
 #include <complex>
+#include <memory>
 
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/system_wrappers/include/aligned_malloc.h"
@@ -25,8 +26,8 @@
 class RealFourier {
  public:
   // Shorthand typenames for the scopers used by the buffer allocation helpers.
-  typedef rtc::scoped_ptr<float[], AlignedFreeDeleter> fft_real_scoper;
-  typedef rtc::scoped_ptr<std::complex<float>[], AlignedFreeDeleter>
+  typedef std::unique_ptr<float[], AlignedFreeDeleter> fft_real_scoper;
+  typedef std::unique_ptr<std::complex<float>[], AlignedFreeDeleter>
       fft_cplx_scoper;
 
   // The alignment required for all input and output buffers, in bytes.
@@ -34,7 +35,7 @@
 
   // Construct a wrapper instance for the given input order, which must be
   // between 1 and kMaxFftOrder, inclusively.
-  static rtc::scoped_ptr<RealFourier> Create(int fft_order);
+  static std::unique_ptr<RealFourier> Create(int fft_order);
   virtual ~RealFourier() {};
 
   // Helper to compute the smallest FFT order (a power of 2) which will contain
diff --git a/webrtc/common_audio/vad/vad.cc b/webrtc/common_audio/vad/vad.cc
index 99d6ffe..77de516 100644
--- a/webrtc/common_audio/vad/vad.cc
+++ b/webrtc/common_audio/vad/vad.cc
@@ -10,6 +10,8 @@
 
 #include "webrtc/common_audio/vad/include/vad.h"
 
+#include <memory>
+
 #include "webrtc/base/checks.h"
 
 namespace webrtc {
diff --git a/webrtc/examples/peerconnection/client/conductor.cc b/webrtc/examples/peerconnection/client/conductor.cc
index e26d403..8ec6ed9 100644
--- a/webrtc/examples/peerconnection/client/conductor.cc
+++ b/webrtc/examples/peerconnection/client/conductor.cc
@@ -10,6 +10,7 @@
 
 #include "webrtc/examples/peerconnection/client/conductor.h"
 
+#include <memory>
 #include <utility>
 #include <vector>
 
@@ -308,7 +309,7 @@
       return;
     }
     webrtc::SdpParseError error;
-    rtc::scoped_ptr<webrtc::IceCandidateInterface> candidate(
+    std::unique_ptr<webrtc::IceCandidateInterface> candidate(
         webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, sdp, &error));
     if (!candidate.get()) {
       LOG(WARNING) << "Can't parse received candidate message. "
diff --git a/webrtc/examples/peerconnection/client/linux/main_wnd.h b/webrtc/examples/peerconnection/client/linux/main_wnd.h
index e756fc9..3c71857 100644
--- a/webrtc/examples/peerconnection/client/linux/main_wnd.h
+++ b/webrtc/examples/peerconnection/client/linux/main_wnd.h
@@ -11,6 +11,7 @@
 #ifndef WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_LINUX_MAIN_WND_H_
 #define WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_LINUX_MAIN_WND_H_
 
+#include <memory>
 #include <string>
 
 #include "webrtc/examples/peerconnection/client/main_wnd.h"
@@ -92,7 +93,7 @@
 
    protected:
     void SetSize(int width, int height);
-    rtc::scoped_ptr<uint8_t[]> image_;
+    std::unique_ptr<uint8_t[]> image_;
     int width_;
     int height_;
     GtkMainWnd* main_wnd_;
@@ -111,9 +112,9 @@
   std::string port_;
   bool autoconnect_;
   bool autocall_;
-  rtc::scoped_ptr<VideoRenderer> local_renderer_;
-  rtc::scoped_ptr<VideoRenderer> remote_renderer_;
-  rtc::scoped_ptr<uint8_t[]> draw_buffer_;
+  std::unique_ptr<VideoRenderer> local_renderer_;
+  std::unique_ptr<VideoRenderer> remote_renderer_;
+  std::unique_ptr<uint8_t[]> draw_buffer_;
   int draw_buffer_size_;
 };
 
diff --git a/webrtc/examples/peerconnection/client/main_wnd.h b/webrtc/examples/peerconnection/client/main_wnd.h
index 80db2a5..03db80d 100644
--- a/webrtc/examples/peerconnection/client/main_wnd.h
+++ b/webrtc/examples/peerconnection/client/main_wnd.h
@@ -13,6 +13,7 @@
 #pragma once
 
 #include <map>
+#include <memory>
 #include <string>
 
 #include "webrtc/api/mediastreaminterface.h"
@@ -131,7 +132,7 @@
 
     HWND wnd_;
     BITMAPINFO bmi_;
-    rtc::scoped_ptr<uint8_t[]> image_;
+    std::unique_ptr<uint8_t[]> image_;
     CRITICAL_SECTION buffer_lock_;
     rtc::scoped_refptr<webrtc::VideoTrackInterface> rendered_track_;
   };
@@ -176,8 +177,8 @@
   void HandleTabbing();
 
  private:
-  rtc::scoped_ptr<VideoRenderer> local_renderer_;
-  rtc::scoped_ptr<VideoRenderer> remote_renderer_;
+  std::unique_ptr<VideoRenderer> local_renderer_;
+  std::unique_ptr<VideoRenderer> remote_renderer_;
   UI ui_;
   HWND wnd_;
   DWORD ui_thread_id_;
diff --git a/webrtc/examples/peerconnection/client/peer_connection_client.h b/webrtc/examples/peerconnection/client/peer_connection_client.h
index b7abfdf..bc8b8cc 100644
--- a/webrtc/examples/peerconnection/client/peer_connection_client.h
+++ b/webrtc/examples/peerconnection/client/peer_connection_client.h
@@ -13,6 +13,7 @@
 #pragma once
 
 #include <map>
+#include <memory>
 #include <string>
 
 #include "webrtc/base/nethelpers.h"
@@ -109,8 +110,8 @@
   PeerConnectionClientObserver* callback_;
   rtc::SocketAddress server_address_;
   rtc::AsyncResolver* resolver_;
-  rtc::scoped_ptr<rtc::AsyncSocket> control_socket_;
-  rtc::scoped_ptr<rtc::AsyncSocket> hanging_get_;
+  std::unique_ptr<rtc::AsyncSocket> control_socket_;
+  std::unique_ptr<rtc::AsyncSocket> hanging_get_;
   std::string onconnect_data_;
   std::string control_data_;
   std::string notification_data_;
diff --git a/webrtc/examples/relayserver/relayserver_main.cc b/webrtc/examples/relayserver/relayserver_main.cc
index 31f43c4..c14ea45 100644
--- a/webrtc/examples/relayserver/relayserver_main.cc
+++ b/webrtc/examples/relayserver/relayserver_main.cc
@@ -9,9 +9,9 @@
  */
 
 #include <iostream>  // NOLINT
+#include <memory>
 
 #include "webrtc/p2p/base/relayserver.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/base/thread.h"
 
 int main(int argc, char **argv) {
@@ -35,7 +35,7 @@
 
   rtc::Thread *pthMain = rtc::Thread::Current();
 
-  rtc::scoped_ptr<rtc::AsyncUDPSocket> int_socket(
+  std::unique_ptr<rtc::AsyncUDPSocket> int_socket(
       rtc::AsyncUDPSocket::Create(pthMain->socketserver(), int_addr));
   if (!int_socket) {
     std::cerr << "Failed to create a UDP socket bound at"
@@ -43,7 +43,7 @@
     return 1;
   }
 
-  rtc::scoped_ptr<rtc::AsyncUDPSocket> ext_socket(
+  std::unique_ptr<rtc::AsyncUDPSocket> ext_socket(
       rtc::AsyncUDPSocket::Create(pthMain->socketserver(), ext_addr));
   if (!ext_socket) {
     std::cerr << "Failed to create a UDP socket bound at"
diff --git a/webrtc/media/base/videoadapter_unittest.cc b/webrtc/media/base/videoadapter_unittest.cc
index 1ad58d1..d793d56 100644
--- a/webrtc/media/base/videoadapter_unittest.cc
+++ b/webrtc/media/base/videoadapter_unittest.cc
@@ -10,6 +10,7 @@
 
 #include <limits.h>  // For INT_MAX
 
+#include <memory>
 #include <string>
 #include <vector>
 
diff --git a/webrtc/media/base/videobroadcaster.h b/webrtc/media/base/videobroadcaster.h
index c89c7ee..764c749 100644
--- a/webrtc/media/base/videobroadcaster.h
+++ b/webrtc/media/base/videobroadcaster.h
@@ -11,6 +11,7 @@
 #ifndef WEBRTC_MEDIA_BASE_VIDEOBROADCASTER_H_
 #define WEBRTC_MEDIA_BASE_VIDEOBROADCASTER_H_
 
+#include <memory>
 #include <utility>
 #include <vector>
 
@@ -55,7 +56,7 @@
   rtc::CriticalSection sinks_and_wants_lock_;
 
   VideoSinkWants current_wants_ GUARDED_BY(sinks_and_wants_lock_);
-  rtc::scoped_ptr<cricket::WebRtcVideoFrame> black_frame_;
+  std::unique_ptr<cricket::WebRtcVideoFrame> black_frame_;
 };
 
 }  // namespace rtc
diff --git a/webrtc/media/base/videocapturer_unittest.cc b/webrtc/media/base/videocapturer_unittest.cc
index bd145e3..6a3ebb0 100644
--- a/webrtc/media/base/videocapturer_unittest.cc
+++ b/webrtc/media/base/videocapturer_unittest.cc
@@ -9,6 +9,8 @@
  */
 
 #include <stdio.h>
+
+#include <memory>
 #include <vector>
 
 #include "webrtc/base/gunit.h"
@@ -40,7 +42,7 @@
 
  protected:
   void InitCapturer(bool is_screencast) {
-    capturer_ = rtc::scoped_ptr<FakeVideoCapturer>(
+    capturer_ = std::unique_ptr<FakeVideoCapturer>(
         new FakeVideoCapturer(is_screencast));
     capturer_->SignalStateChange.connect(this,
                                          &VideoCapturerTest::OnStateChange);
@@ -56,7 +58,7 @@
   cricket::CaptureState capture_state() { return capture_state_; }
   int num_state_changes() { return num_state_changes_; }
 
-  rtc::scoped_ptr<cricket::FakeVideoCapturer> capturer_;
+  std::unique_ptr<cricket::FakeVideoCapturer> capturer_;
   cricket::CaptureState capture_state_;
   int num_state_changes_;
   cricket::FakeVideoRenderer renderer_;
diff --git a/webrtc/media/engine/webrtcvoe.h b/webrtc/media/engine/webrtcvoe.h
index c6d1caf..238b4ce 100644
--- a/webrtc/media/engine/webrtcvoe.h
+++ b/webrtc/media/engine/webrtcvoe.h
@@ -11,6 +11,8 @@
 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVOE_H_
 #define WEBRTC_MEDIA_ENGINE_WEBRTCVOE_H_
 
+#include <memory>
+
 #include "webrtc/base/common.h"
 #include "webrtc/media/engine/webrtccommon.h"
 
diff --git a/webrtc/modules/audio_coding/codecs/audio_decoder_factory_unittest.cc b/webrtc/modules/audio_coding/codecs/audio_decoder_factory_unittest.cc
index a1ae05d..d278b84 100644
--- a/webrtc/modules/audio_coding/codecs/audio_decoder_factory_unittest.cc
+++ b/webrtc/modules/audio_coding/codecs/audio_decoder_factory_unittest.cc
@@ -8,6 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <memory>
+
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webrtc/modules/audio_coding/codecs/builtin_audio_decoder_factory.h"
 
diff --git a/webrtc/modules/audio_coding/neteq/delay_peak_detector.h b/webrtc/modules/audio_coding/neteq/delay_peak_detector.h
index 060e2e1..f57d3bd 100644
--- a/webrtc/modules/audio_coding/neteq/delay_peak_detector.h
+++ b/webrtc/modules/audio_coding/neteq/delay_peak_detector.h
@@ -14,6 +14,7 @@
 #include <string.h>  // size_t
 
 #include <list>
+#include <memory>
 
 #include "webrtc/base/constructormagic.h"
 #include "webrtc/modules/audio_coding/neteq/tick_timer.h"
diff --git a/webrtc/p2p/base/transport.cc b/webrtc/p2p/base/transport.cc
index 3e45d20..9688e4a 100644
--- a/webrtc/p2p/base/transport.cc
+++ b/webrtc/p2p/base/transport.cc
@@ -412,7 +412,7 @@
     return BadTransportDescription(
         "Fingerprint provided but no identity available.", error_desc);
   }
-  rtc::scoped_ptr<rtc::SSLFingerprint> fp_tmp(rtc::SSLFingerprint::Create(
+  std::unique_ptr<rtc::SSLFingerprint> fp_tmp(rtc::SSLFingerprint::Create(
       fingerprint->algorithm, certificate->identity()));
   ASSERT(fp_tmp.get() != NULL);
   if (*fp_tmp == *fingerprint) {
diff --git a/webrtc/p2p/base/transport_unittest.cc b/webrtc/p2p/base/transport_unittest.cc
index fba72b4..cde60ce 100644
--- a/webrtc/p2p/base/transport_unittest.cc
+++ b/webrtc/p2p/base/transport_unittest.cc
@@ -245,7 +245,7 @@
 
   for (auto& key_type : key_types) {
     rtc::scoped_refptr<rtc::RTCCertificate> certificate =
-        rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>(
+        rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>(
             rtc::SSLIdentity::Generate("testing", key_type)));
     ASSERT_NE(nullptr, certificate);
 
@@ -253,7 +253,7 @@
     ASSERT_TRUE(certificate->ssl_certificate().GetSignatureDigestAlgorithm(
         &digest_algorithm));
     ASSERT_FALSE(digest_algorithm.empty());
-    rtc::scoped_ptr<rtc::SSLFingerprint> good_fingerprint(
+    std::unique_ptr<rtc::SSLFingerprint> good_fingerprint(
         rtc::SSLFingerprint::Create(digest_algorithm, certificate->identity()));
     ASSERT_NE(nullptr, good_fingerprint);
 
diff --git a/webrtc/p2p/quic/quictransport.h b/webrtc/p2p/quic/quictransport.h
index 053ba61..14bd13f 100644
--- a/webrtc/p2p/quic/quictransport.h
+++ b/webrtc/p2p/quic/quictransport.h
@@ -13,6 +13,7 @@
 
 #include <string>
 #include <map>
+#include <memory>
 
 #include "webrtc/p2p/base/transport.h"
 #include "webrtc/p2p/quic/quictransportchannel.h"
@@ -55,7 +56,7 @@
  private:
   rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_;
   rtc::SSLRole local_role_ = rtc::SSL_CLIENT;
-  rtc::scoped_ptr<rtc::SSLFingerprint> remote_fingerprint_;
+  std::unique_ptr<rtc::SSLFingerprint> remote_fingerprint_;
 };
 
 }  // namespace cricket
diff --git a/webrtc/p2p/quic/quictransport_unittest.cc b/webrtc/p2p/quic/quictransport_unittest.cc
index bc99f6b..1fd48f7 100644
--- a/webrtc/p2p/quic/quictransport_unittest.cc
+++ b/webrtc/p2p/quic/quictransport_unittest.cc
@@ -10,6 +10,7 @@
 
 #include "webrtc/p2p/quic/quictransport.h"
 
+#include <memory>
 #include <string>
 #include <vector>
 
@@ -30,15 +31,15 @@
 
 static rtc::scoped_refptr<rtc::RTCCertificate> CreateCertificate(
     std::string name) {
-  return rtc::RTCCertificate::Create(rtc::scoped_ptr<rtc::SSLIdentity>(
+  return rtc::RTCCertificate::Create(std::unique_ptr<rtc::SSLIdentity>(
       rtc::SSLIdentity::Generate(name, rtc::KT_DEFAULT)));
 }
 
-static rtc::scoped_ptr<rtc::SSLFingerprint> CreateFingerprint(
+static std::unique_ptr<rtc::SSLFingerprint> CreateFingerprint(
     rtc::RTCCertificate* cert) {
   std::string digest_algorithm;
   cert->ssl_certificate().GetSignatureDigestAlgorithm(&digest_algorithm);
-  return rtc::scoped_ptr<rtc::SSLFingerprint>(
+  return std::unique_ptr<rtc::SSLFingerprint>(
       rtc::SSLFingerprint::Create(digest_algorithm, cert->identity()));
 }
 
@@ -59,7 +60,7 @@
     ASSERT_NE(nullptr, local_certificate);
     transport_.SetLocalCertificate(local_certificate);
 
-    rtc::scoped_ptr<rtc::SSLFingerprint> local_fingerprint =
+    std::unique_ptr<rtc::SSLFingerprint> local_fingerprint =
         CreateFingerprint(local_certificate.get());
     ASSERT_NE(nullptr, local_fingerprint);
     TransportDescription local_desc(std::vector<std::string>(), kIceUfrag1,
@@ -73,11 +74,11 @@
         channel->GetLocalCertificate();
     ASSERT_NE(nullptr, channel_local_certificate);
     EXPECT_EQ(local_certificate, channel_local_certificate);
-    rtc::scoped_ptr<rtc::SSLFingerprint> remote_fingerprint =
+    std::unique_ptr<rtc::SSLFingerprint> remote_fingerprint =
         CreateFingerprint(CreateCertificate("remote").get());
     // NegotiateTransportDescription was not called yet. The SSL role should
     // not be set and neither should the remote fingerprint.
-    rtc::scoped_ptr<rtc::SSLRole> role(new rtc::SSLRole());
+    std::unique_ptr<rtc::SSLRole> role(new rtc::SSLRole());
     EXPECT_FALSE(channel->GetSslRole(role.get()));
     // Setting the remote description should set the SSL role.
     ASSERT_NE(nullptr, remote_fingerprint);
diff --git a/webrtc/pc/yuvscaler_unittest.cc b/webrtc/pc/yuvscaler_unittest.cc
index 9e0f8ed..a33d495 100644
--- a/webrtc/pc/yuvscaler_unittest.cc
+++ b/webrtc/pc/yuvscaler_unittest.cc
@@ -8,6 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <memory>
 #include <sstream>
 
 #include "libyuv/cpu_id.h"
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCDataChannel.mm b/webrtc/sdk/objc/Framework/Classes/RTCDataChannel.mm
index cdc7e98..9948615 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCDataChannel.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCDataChannel.mm
@@ -12,7 +12,7 @@
 
 #import "NSString+StdString.h"
 
-#include "webrtc/base/scoped_ptr.h"
+#include <memory>
 
 namespace webrtc {
 
@@ -46,7 +46,7 @@
 
 
 @implementation RTCDataBuffer {
-  rtc::scoped_ptr<webrtc::DataBuffer> _dataBuffer;
+  std::unique_ptr<webrtc::DataBuffer> _dataBuffer;
 }
 
 - (instancetype)initWithData:(NSData *)data isBinary:(BOOL)isBinary {
@@ -86,7 +86,7 @@
 
 @implementation RTCDataChannel {
   rtc::scoped_refptr<webrtc::DataChannelInterface> _nativeDataChannel;
-  rtc::scoped_ptr<webrtc::DataChannelDelegateAdapter> _observer;
+  std::unique_ptr<webrtc::DataChannelDelegateAdapter> _observer;
   BOOL _isObserverRegistered;
 }
 
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCFileLogger.mm b/webrtc/sdk/objc/Framework/Classes/RTCFileLogger.mm
index 73335f3..c1fbd74 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCFileLogger.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCFileLogger.mm
@@ -10,11 +10,12 @@
 
 #import "WebRTC/RTCFileLogger.h"
 
+#include <memory>
+
 #include "webrtc/base/checks.h"
 #include "webrtc/base/filerotatingstream.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/logsinks.h"
-#include "webrtc/base/scoped_ptr.h"
 
 NSString *const kDefaultLogDirName = @"webrtc_logs";
 NSUInteger const kDefaultMaxFileSize = 10 * 1024 * 1024; // 10MB.
@@ -24,7 +25,7 @@
   BOOL _hasStarted;
   NSString *_dirPath;
   NSUInteger _maxFileSize;
-  rtc::scoped_ptr<rtc::FileRotatingLogSink> _logSink;
+  std::unique_ptr<rtc::FileRotatingLogSink> _logSink;
 }
 
 @synthesize severity = _severity;
@@ -129,7 +130,7 @@
     return nil;
   }
   NSMutableData* logData = [NSMutableData data];
-  rtc::scoped_ptr<rtc::FileRotatingStream> stream;
+  std::unique_ptr<rtc::FileRotatingStream> stream;
   switch(_rotationType) {
     case RTCFileLoggerTypeApp:
       stream.reset(
@@ -150,7 +151,7 @@
   size_t read = 0;
   // Allocate memory using malloc so we can pass it direcly to NSData without
   // copying.
-  rtc::scoped_ptr<uint8_t[]> buffer(static_cast<uint8_t*>(malloc(bufferSize)));
+  std::unique_ptr<uint8_t[]> buffer(static_cast<uint8_t*>(malloc(bufferSize)));
   stream->ReadAll(buffer.get(), bufferSize, &read, nullptr);
   logData = [[NSMutableData alloc] initWithBytesNoCopy:buffer.release()
                                                 length:read];
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCIceCandidate+Private.h b/webrtc/sdk/objc/Framework/Classes/RTCIceCandidate+Private.h
index ba3ffb6..04858cf 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCIceCandidate+Private.h
+++ b/webrtc/sdk/objc/Framework/Classes/RTCIceCandidate+Private.h
@@ -10,6 +10,8 @@
 
 #import "WebRTC/RTCIceCandidate.h"
 
+#include <memory>
+
 #include "webrtc/api/jsep.h"
 #include "webrtc/base/scoped_ptr.h"
 
@@ -22,7 +24,7 @@
  * object. This is needed to pass to the underlying C++ APIs.
  */
 @property(nonatomic, readonly)
-    rtc::scoped_ptr<webrtc::IceCandidateInterface> nativeCandidate;
+    std::unique_ptr<webrtc::IceCandidateInterface> nativeCandidate;
 
 /**
  * Initialize an RTCIceCandidate from a native IceCandidateInterface. No
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCIceCandidate.mm b/webrtc/sdk/objc/Framework/Classes/RTCIceCandidate.mm
index 7b1e655..193403d 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCIceCandidate.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCIceCandidate.mm
@@ -10,6 +10,8 @@
 
 #import "RTCIceCandidate+Private.h"
 
+#include <memory>
+
 #import "NSString+StdString.h"
 #import "WebRTC/RTCLogging.h"
 
@@ -51,7 +53,7 @@
                     sdpMid:[NSString stringForStdString:candidate->sdp_mid()]];
 }
 
-- (rtc::scoped_ptr<webrtc::IceCandidateInterface>)nativeCandidate {
+- (std::unique_ptr<webrtc::IceCandidateInterface>)nativeCandidate {
   webrtc::SdpParseError error;
 
   webrtc::IceCandidateInterface *candidate = webrtc::CreateIceCandidate(
@@ -63,7 +65,7 @@
            error.line.c_str());
   }
 
-  return rtc::scoped_ptr<webrtc::IceCandidateInterface>(candidate);
+  return std::unique_ptr<webrtc::IceCandidateInterface>(candidate);
 }
 
 @end
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints+Private.h b/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints+Private.h
index 3662c44..6ad3b6d 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints+Private.h
+++ b/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints+Private.h
@@ -10,6 +10,8 @@
 
 #import "WebRTC/RTCMediaConstraints.h"
 
+#include <memory>
+
 #include "webrtc/api/mediaconstraintsinterface.h"
 #include "webrtc/base/scoped_ptr.h"
 
@@ -41,7 +43,7 @@
  * A MediaConstraints representation of this RTCMediaConstraints object. This is
  * needed to pass to the underlying C++ APIs.
  */
-- (rtc::scoped_ptr<webrtc::MediaConstraints>)nativeConstraints;
+- (std::unique_ptr<webrtc::MediaConstraints>)nativeConstraints;
 
 /** Return a native Constraints object representing these constraints */
 + (webrtc::MediaConstraintsInterface::Constraints)
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints.mm b/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints.mm
index 7a7cdf1..11be2ec 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCMediaConstraints.mm
@@ -12,6 +12,8 @@
 
 #import "NSString+StdString.h"
 
+#include <memory>
+
 namespace webrtc {
 
 MediaConstraints::~MediaConstraints() {}
@@ -62,7 +64,7 @@
 
 #pragma mark - Private
 
-- (rtc::scoped_ptr<webrtc::MediaConstraints>)nativeConstraints {
+- (std::unique_ptr<webrtc::MediaConstraints>)nativeConstraints {
   webrtc::MediaConstraintsInterface::Constraints mandatory =
       [[self class] nativeConstraintsForConstraints:_mandatory];
   webrtc::MediaConstraintsInterface::Constraints optional =
@@ -70,7 +72,7 @@
 
   webrtc::MediaConstraints *nativeConstraints =
       new webrtc::MediaConstraints(mandatory, optional);
-  return rtc::scoped_ptr<webrtc::MediaConstraints>(nativeConstraints);
+  return std::unique_ptr<webrtc::MediaConstraints>(nativeConstraints);
 }
 
 + (webrtc::MediaConstraintsInterface::Constraints)
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCOpenGLVideoRenderer.mm b/webrtc/sdk/objc/Framework/Classes/RTCOpenGLVideoRenderer.mm
index ab45ca4..7d7b416 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCOpenGLVideoRenderer.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCOpenGLVideoRenderer.mm
@@ -16,10 +16,10 @@
 #import <OpenGL/gl3.h>
 #endif
 #include <string.h>
+#include <memory>
 
 #import "WebRTC/RTCVideoFrame.h"
 
-#include "webrtc/base/scoped_ptr.h"
 
 // TODO(tkchin): check and log openGL errors. Methods here return BOOLs in
 // anticipation of that happening in the future.
@@ -162,7 +162,7 @@
   GLint _vSampler;
   // Used to create a non-padded plane for GPU upload when we receive padded
   // frames.
-  rtc::scoped_ptr<uint8_t[]> _planeBuffer;
+  std::unique_ptr<uint8_t[]> _planeBuffer;
 }
 
 @synthesize lastDrawnFrame = _lastDrawnFrame;
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm b/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm
index 46ea52a..3b7632c 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCPeerConnection.mm
@@ -22,6 +22,8 @@
 #import "RTCStatsReport+Private.h"
 #import "WebRTC/RTCLogging.h"
 
+#include <memory>
+
 #include "webrtc/base/checks.h"
 
 NSString * const kRTCPeerConnectionErrorDomain =
@@ -45,8 +47,8 @@
 
   void OnSuccess(SessionDescriptionInterface *desc) override {
     RTC_DCHECK(completion_handler_);
-    rtc::scoped_ptr<webrtc::SessionDescriptionInterface> description =
-        rtc::scoped_ptr<webrtc::SessionDescriptionInterface>(desc);
+    std::unique_ptr<webrtc::SessionDescriptionInterface> description =
+        std::unique_ptr<webrtc::SessionDescriptionInterface>(desc);
     RTCSessionDescription* session =
         [[RTCSessionDescription alloc] initWithNativeDescription:
             description.get()];
@@ -184,7 +186,7 @@
 
 @implementation RTCPeerConnection {
   NSMutableArray *_localStreams;
-  rtc::scoped_ptr<webrtc::PeerConnectionDelegateAdapter> _observer;
+  std::unique_ptr<webrtc::PeerConnectionDelegateAdapter> _observer;
   rtc::scoped_refptr<webrtc::PeerConnectionInterface> _peerConnection;
 }
 
@@ -199,7 +201,7 @@
     _observer.reset(new webrtc::PeerConnectionDelegateAdapter(self));
     webrtc::PeerConnectionInterface::RTCConfiguration config =
         configuration.nativeConfiguration;
-    rtc::scoped_ptr<webrtc::MediaConstraints> nativeConstraints =
+    std::unique_ptr<webrtc::MediaConstraints> nativeConstraints =
         constraints.nativeConstraints;
     _peerConnection =
         factory.nativeFactory->CreatePeerConnection(config,
@@ -257,7 +259,7 @@
 }
 
 - (void)addIceCandidate:(RTCIceCandidate *)candidate {
-  rtc::scoped_ptr<const webrtc::IceCandidateInterface> iceCandidate(
+  std::unique_ptr<const webrtc::IceCandidateInterface> iceCandidate(
       candidate.nativeCandidate);
   _peerConnection->AddIceCandidate(iceCandidate.get());
 }
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCPeerConnectionFactory.mm b/webrtc/sdk/objc/Framework/Classes/RTCPeerConnectionFactory.mm
index 04aa121..82d7707 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCPeerConnectionFactory.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCPeerConnectionFactory.mm
@@ -20,9 +20,11 @@
 #import "RTCVideoSource+Private.h"
 #import "RTCVideoTrack+Private.h"
 
+#include <memory>
+
 @implementation RTCPeerConnectionFactory {
-  rtc::scoped_ptr<rtc::Thread> _signalingThread;
-  rtc::scoped_ptr<rtc::Thread> _workerThread;
+  std::unique_ptr<rtc::Thread> _signalingThread;
+  std::unique_ptr<rtc::Thread> _workerThread;
 }
 
 @synthesize nativeFactory = _nativeFactory;
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCVideoFrame.mm b/webrtc/sdk/objc/Framework/Classes/RTCVideoFrame.mm
index 8a99d4e..1fb2695 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCVideoFrame.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCVideoFrame.mm
@@ -10,10 +10,10 @@
 
 #import "RTCVideoFrame+Private.h"
 
-#include "webrtc/base/scoped_ptr.h"
+#include <memory>
 
 @implementation RTCVideoFrame {
-  rtc::scoped_ptr<cricket::VideoFrame> _videoFrame;
+  std::unique_ptr<cricket::VideoFrame> _videoFrame;
   rtc::scoped_refptr<webrtc::VideoFrameBuffer> _i420Buffer;
 }
 
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCVideoRendererAdapter.mm b/webrtc/sdk/objc/Framework/Classes/RTCVideoRendererAdapter.mm
index 1d64cd8..4976ba9 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCVideoRendererAdapter.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCVideoRendererAdapter.mm
@@ -12,6 +12,8 @@
 
 #import "RTCVideoFrame+Private.h"
 
+#include <memory>
+
 #include "webrtc/media/engine/webrtcvideoframe.h"
 
 namespace webrtc {
@@ -60,7 +62,7 @@
 }
 
 @implementation RTCVideoRendererAdapter {
-  rtc::scoped_ptr<webrtc::VideoRendererAdapter> _adapter;
+  std::unique_ptr<webrtc::VideoRendererAdapter> _adapter;
 }
 
 @synthesize videoRenderer = _videoRenderer;
diff --git a/webrtc/sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm b/webrtc/sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm
index 6d751cc..20a9d73 100644
--- a/webrtc/sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm
+++ b/webrtc/sdk/objc/Framework/UnitTests/RTCIceCandidateTest.mm
@@ -10,6 +10,8 @@
 
 #import <Foundation/Foundation.h>
 
+#include <memory>
+
 #include "webrtc/base/gunit.h"
 
 #import "NSString+StdString.h"
@@ -32,7 +34,7 @@
                                                       sdpMLineIndex:0
                                                              sdpMid:@"audio"];
 
-  rtc::scoped_ptr<webrtc::IceCandidateInterface> nativeCandidate =
+  std::unique_ptr<webrtc::IceCandidateInterface> nativeCandidate =
       candidate.nativeCandidate;
   EXPECT_EQ("audio", nativeCandidate->sdp_mid());
   EXPECT_EQ(0, nativeCandidate->sdp_mline_index());
diff --git a/webrtc/sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm b/webrtc/sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm
index 2c99cfe..3413dfc 100644
--- a/webrtc/sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm
+++ b/webrtc/sdk/objc/Framework/UnitTests/RTCMediaConstraintsTest.mm
@@ -10,6 +10,8 @@
 
 #import <Foundation/Foundation.h>
 
+#include <memory>
+
 #include "webrtc/base/gunit.h"
 
 #import "NSString+StdString.h"
@@ -29,7 +31,7 @@
   RTCMediaConstraints *constraints = [[RTCMediaConstraints alloc]
       initWithMandatoryConstraints:mandatory
                optionalConstraints:optional];
-  rtc::scoped_ptr<webrtc::MediaConstraints> nativeConstraints =
+  std::unique_ptr<webrtc::MediaConstraints> nativeConstraints =
       [constraints nativeConstraints];
 
   webrtc::MediaConstraintsInterface::Constraints nativeMandatory =
diff --git a/webrtc/system_wrappers/include/aligned_malloc.h b/webrtc/system_wrappers/include/aligned_malloc.h
index 277abec..bdd82cc 100644
--- a/webrtc/system_wrappers/include/aligned_malloc.h
+++ b/webrtc/system_wrappers/include/aligned_malloc.h
@@ -46,8 +46,8 @@
   return reinterpret_cast<T*>(AlignedMalloc(size, alignment));
 }
 
-// Deleter for use with scoped_ptr. E.g., use as
-//   scoped_ptr<Foo, AlignedFreeDeleter> foo;
+// Deleter for use with unique_ptr. E.g., use as
+//   std::unique_ptr<Foo, AlignedFreeDeleter> foo;
 struct AlignedFreeDeleter {
   inline void operator()(void* ptr) const {
     AlignedFree(ptr);
diff --git a/webrtc/system_wrappers/include/clock.h b/webrtc/system_wrappers/include/clock.h
index f443057..8245ecd 100644
--- a/webrtc/system_wrappers/include/clock.h
+++ b/webrtc/system_wrappers/include/clock.h
@@ -11,6 +11,8 @@
 #ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CLOCK_H_
 #define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_CLOCK_H_
 
+#include <memory>
+
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/system_wrappers/include/rw_lock_wrapper.h"
 #include "webrtc/typedefs.h"
@@ -76,7 +78,7 @@
 
  private:
   int64_t time_us_;
-  rtc::scoped_ptr<RWLockWrapper> lock_;
+  std::unique_ptr<RWLockWrapper> lock_;
 };
 
 };  // namespace webrtc
diff --git a/webrtc/system_wrappers/include/data_log_impl.h b/webrtc/system_wrappers/include/data_log_impl.h
index 3551960..c68c829 100644
--- a/webrtc/system_wrappers/include/data_log_impl.h
+++ b/webrtc/system_wrappers/include/data_log_impl.h
@@ -18,6 +18,7 @@
 #define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_DATA_LOG_IMPL_H_
 
 #include <map>
+#include <memory>
 #include <sstream>
 #include <string>
 #include <vector>
@@ -139,16 +140,16 @@
 
   // Collection of tables indexed by the table name as std::string.
   typedef std::map<std::string, LogTable*> TableMap;
-  typedef rtc::scoped_ptr<CriticalSectionWrapper> CritSectScopedPtr;
+  typedef std::unique_ptr<CriticalSectionWrapper> CritSectScopedPtr;
 
   static CritSectScopedPtr  crit_sect_;
   static DataLogImpl*       instance_;
   int                       counter_;
   TableMap                  tables_;
   EventWrapper*             flush_event_;
-  // This is a scoped_ptr so that we don't have to create threads in the no-op
+  // This is a unique_ptr so that we don't have to create threads in the no-op
   // impl.
-  rtc::scoped_ptr<rtc::PlatformThread> file_writer_thread_;
+  std::unique_ptr<rtc::PlatformThread> file_writer_thread_;
   RWLockWrapper*            tables_lock_;
 };
 
diff --git a/webrtc/system_wrappers/include/utf_util_win.h b/webrtc/system_wrappers/include/utf_util_win.h
index 0e3f2d0..730aa46 100644
--- a/webrtc/system_wrappers/include/utf_util_win.h
+++ b/webrtc/system_wrappers/include/utf_util_win.h
@@ -15,6 +15,8 @@
 
 #ifdef WIN32
 #include <windows.h>
+
+#include <memory>
 #include <string>
 
 #include "webrtc/base/scoped_ptr.h"
@@ -24,7 +26,7 @@
 inline std::wstring ToUtf16(const char* utf8, size_t len) {
   int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast<int>(len),
                                     NULL, 0);
-  rtc::scoped_ptr<wchar_t[]> ws(new wchar_t[len16]);
+  std::unique_ptr<wchar_t[]> ws(new wchar_t[len16]);
   ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast<int>(len), ws.get(),
                         len16);
   return std::wstring(ws.get(), len16);
@@ -37,7 +39,7 @@
 inline std::string ToUtf8(const wchar_t* wide, size_t len) {
   int len8 = ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast<int>(len),
                                    NULL, 0, NULL, NULL);
-  rtc::scoped_ptr<char[]> ns(new char[len8]);
+  std::unique_ptr<char[]> ns(new char[len8]);
   ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast<int>(len), ns.get(), len8,
                         NULL, NULL);
   return std::string(ns.get(), len8);
diff --git a/webrtc/system_wrappers/source/aligned_malloc_unittest.cc b/webrtc/system_wrappers/source/aligned_malloc_unittest.cc
index 3933c2a..ed6cd42 100644
--- a/webrtc/system_wrappers/source/aligned_malloc_unittest.cc
+++ b/webrtc/system_wrappers/source/aligned_malloc_unittest.cc
@@ -10,6 +10,8 @@
 
 #include "webrtc/system_wrappers/include/aligned_malloc.h"
 
+#include <memory>
+
 #if _WIN32
 #include <windows.h>
 #else
@@ -17,14 +19,13 @@
 #endif
 
 #include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/typedefs.h"
 
 namespace webrtc {
 
 // Returns true if |size| and |alignment| are valid combinations.
 bool CorrectUsage(size_t size, size_t alignment) {
-  rtc::scoped_ptr<char, AlignedFreeDeleter> scoped(
+  std::unique_ptr<char, AlignedFreeDeleter> scoped(
       static_cast<char*>(AlignedMalloc(size, alignment)));
   if (scoped.get() == NULL) {
     return false;
@@ -37,7 +38,7 @@
   const size_t size = 100;
   const size_t alignment = 32;
   const size_t left_misalignment = 1;
-  rtc::scoped_ptr<char, AlignedFreeDeleter> scoped(
+  std::unique_ptr<char, AlignedFreeDeleter> scoped(
       static_cast<char*>(AlignedMalloc(size, alignment)));
   EXPECT_TRUE(scoped.get() != NULL);
   const uintptr_t aligned_address = reinterpret_cast<uintptr_t> (scoped.get());
diff --git a/webrtc/system_wrappers/source/condition_variable_unittest.cc b/webrtc/system_wrappers/source/condition_variable_unittest.cc
index 4b1b6cc..bf245e6 100644
--- a/webrtc/system_wrappers/source/condition_variable_unittest.cc
+++ b/webrtc/system_wrappers/source/condition_variable_unittest.cc
@@ -17,7 +17,6 @@
 
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webrtc/base/platform_thread.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
 #include "webrtc/system_wrappers/include/tick_util.h"
 #include "webrtc/system_wrappers/include/trace.h"
diff --git a/webrtc/system_wrappers/source/file_impl.h b/webrtc/system_wrappers/source/file_impl.h
index 06ba582..8764f72 100644
--- a/webrtc/system_wrappers/source/file_impl.h
+++ b/webrtc/system_wrappers/source/file_impl.h
@@ -13,6 +13,8 @@
 
 #include <stdio.h>
 
+#include <memory>
+
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/system_wrappers/include/file_wrapper.h"
 
@@ -52,7 +54,7 @@
   int CloseFileImpl();
   int FlushImpl();
 
-  rtc::scoped_ptr<RWLockWrapper> rw_lock_;
+  std::unique_ptr<RWLockWrapper> rw_lock_;
 
   FILE* id_;
   bool managed_file_handle_;
diff --git a/webrtc/system_wrappers/source/logging_unittest.cc b/webrtc/system_wrappers/source/logging_unittest.cc
index 695b03f..118c342 100644
--- a/webrtc/system_wrappers/source/logging_unittest.cc
+++ b/webrtc/system_wrappers/source/logging_unittest.cc
@@ -13,7 +13,6 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webrtc/base/arraysize.h"
 #include "webrtc/base/event.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/system_wrappers/include/trace.h"
 
 namespace webrtc {
diff --git a/webrtc/system_wrappers/source/trace_impl.h b/webrtc/system_wrappers/source/trace_impl.h
index c6d81d5..5e45976 100644
--- a/webrtc/system_wrappers/source/trace_impl.h
+++ b/webrtc/system_wrappers/source/trace_impl.h
@@ -11,6 +11,8 @@
 #ifndef WEBRTC_SYSTEM_WRAPPERS_SOURCE_TRACE_IMPL_H_
 #define WEBRTC_SYSTEM_WRAPPERS_SOURCE_TRACE_IMPL_H_
 
+#include <memory>
+
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/system_wrappers/include/event_wrapper.h"
@@ -97,7 +99,7 @@
   uint32_t row_count_text_ GUARDED_BY(crit_);
   uint32_t file_count_text_ GUARDED_BY(crit_);
 
-  const rtc::scoped_ptr<FileWrapper> trace_file_ GUARDED_BY(crit_);
+  const std::unique_ptr<FileWrapper> trace_file_ GUARDED_BY(crit_);
   rtc::CriticalSection crit_;
 };
 
diff --git a/webrtc/test/call_test.h b/webrtc/test/call_test.h
index 41a6b5a..ebc2bb2 100644
--- a/webrtc/test/call_test.h
+++ b/webrtc/test/call_test.h
@@ -82,22 +82,22 @@
 
   Clock* const clock_;
 
-  rtc::scoped_ptr<Call> sender_call_;
-  rtc::scoped_ptr<PacketTransport> send_transport_;
+  std::unique_ptr<Call> sender_call_;
+  std::unique_ptr<PacketTransport> send_transport_;
   VideoSendStream::Config video_send_config_;
   VideoEncoderConfig video_encoder_config_;
   VideoSendStream* video_send_stream_;
   AudioSendStream::Config audio_send_config_;
   AudioSendStream* audio_send_stream_;
 
-  rtc::scoped_ptr<Call> receiver_call_;
-  rtc::scoped_ptr<PacketTransport> receive_transport_;
+  std::unique_ptr<Call> receiver_call_;
+  std::unique_ptr<PacketTransport> receive_transport_;
   std::vector<VideoReceiveStream::Config> video_receive_configs_;
   std::vector<VideoReceiveStream*> video_receive_streams_;
   std::vector<AudioReceiveStream::Config> audio_receive_configs_;
   std::vector<AudioReceiveStream*> audio_receive_streams_;
 
-  rtc::scoped_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_;
+  std::unique_ptr<test::FrameGeneratorCapturer> frame_generator_capturer_;
   test::FakeEncoder fake_encoder_;
   std::vector<std::unique_ptr<VideoDecoder>> allocated_decoders_;
   size_t num_video_streams_;
@@ -127,8 +127,8 @@
   VoiceEngineState voe_recv_;
 
   // The audio devices must outlive the voice engines.
-  rtc::scoped_ptr<test::FakeAudioDevice> fake_send_audio_device_;
-  rtc::scoped_ptr<test::FakeAudioDevice> fake_recv_audio_device_;
+  std::unique_ptr<test::FakeAudioDevice> fake_send_audio_device_;
+  std::unique_ptr<test::FakeAudioDevice> fake_recv_audio_device_;
 };
 
 class BaseTest : public RtpRtcpObserver {
diff --git a/webrtc/test/configurable_frame_size_encoder.h b/webrtc/test/configurable_frame_size_encoder.h
index 3794e8d..0da5d20 100644
--- a/webrtc/test/configurable_frame_size_encoder.h
+++ b/webrtc/test/configurable_frame_size_encoder.h
@@ -11,6 +11,7 @@
 #ifndef WEBRTC_TEST_CONFIGURABLE_FRAME_SIZE_ENCODER_H_
 #define WEBRTC_TEST_CONFIGURABLE_FRAME_SIZE_ENCODER_H_
 
+#include <memory>
 #include <vector>
 
 #include "webrtc/base/scoped_ptr.h"
@@ -49,7 +50,7 @@
   EncodedImageCallback* callback_;
   const size_t max_frame_size_;
   size_t current_frame_size_;
-  rtc::scoped_ptr<uint8_t[]> buffer_;
+  std::unique_ptr<uint8_t[]> buffer_;
 };
 
 }  // namespace test
diff --git a/webrtc/test/fake_audio_device.h b/webrtc/test/fake_audio_device.h
index 180abf6..39f9310 100644
--- a/webrtc/test/fake_audio_device.h
+++ b/webrtc/test/fake_audio_device.h
@@ -10,6 +10,7 @@
 #ifndef WEBRTC_TEST_FAKE_AUDIO_DEVICE_H_
 #define WEBRTC_TEST_FAKE_AUDIO_DEVICE_H_
 
+#include <memory>
 #include <string>
 
 #include "webrtc/base/criticalsection.h"
@@ -59,11 +60,11 @@
   int64_t last_playout_ms_;
 
   DriftingClock clock_;
-  rtc::scoped_ptr<EventTimerWrapper> tick_;
+  std::unique_ptr<EventTimerWrapper> tick_;
   rtc::CriticalSection lock_;
   rtc::PlatformThread thread_;
-  rtc::scoped_ptr<ModuleFileUtility> file_utility_;
-  rtc::scoped_ptr<FileWrapper> input_stream_;
+  std::unique_ptr<ModuleFileUtility> file_utility_;
+  std::unique_ptr<FileWrapper> input_stream_;
 };
 }  // namespace test
 }  // namespace webrtc
diff --git a/webrtc/test/fake_network_pipe.h b/webrtc/test/fake_network_pipe.h
index d488d49..3c2db86 100644
--- a/webrtc/test/fake_network_pipe.h
+++ b/webrtc/test/fake_network_pipe.h
@@ -11,6 +11,7 @@
 #ifndef WEBRTC_TEST_FAKE_NETWORK_PIPE_H_
 #define WEBRTC_TEST_FAKE_NETWORK_PIPE_H_
 
+#include <memory>
 #include <set>
 #include <string.h>
 #include <queue>
@@ -50,7 +51,7 @@
 
  private:
   // The packet data.
-  rtc::scoped_ptr<uint8_t[]> data_;
+  std::unique_ptr<uint8_t[]> data_;
   // Length of data_.
   size_t data_length_;
   // The time the packet was sent out on the network.
diff --git a/webrtc/test/fake_network_pipe_unittest.cc b/webrtc/test/fake_network_pipe_unittest.cc
index 233c597..0bd46df 100644
--- a/webrtc/test/fake_network_pipe_unittest.cc
+++ b/webrtc/test/fake_network_pipe_unittest.cc
@@ -8,10 +8,11 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <memory>
+
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/call.h"
 #include "webrtc/system_wrappers/include/clock.h"
 #include "webrtc/test/fake_network_pipe.h"
@@ -71,7 +72,7 @@
 
   void SendPackets(FakeNetworkPipe* pipe, int number_packets, int packet_size) {
     RTC_DCHECK_GE(packet_size, static_cast<int>(sizeof(int)));
-    rtc::scoped_ptr<uint8_t[]> packet(new uint8_t[packet_size]);
+    std::unique_ptr<uint8_t[]> packet(new uint8_t[packet_size]);
     for (int i = 0; i < number_packets; ++i) {
       // Set a sequence number for the packets by
       // using the first bytes in the packet.
@@ -85,7 +86,7 @@
   }
 
   SimulatedClock fake_clock_;
-  rtc::scoped_ptr<TestReceiver> receiver_;
+  std::unique_ptr<TestReceiver> receiver_;
 };
 
 void DeleteMemory(uint8_t* data, int length) { delete [] data; }
@@ -95,7 +96,7 @@
   FakeNetworkPipe::Config config;
   config.queue_length_packets = 20;
   config.link_capacity_kbps = 80;
-  rtc::scoped_ptr<FakeNetworkPipe> pipe(
+  std::unique_ptr<FakeNetworkPipe> pipe(
       new FakeNetworkPipe(&fake_clock_, config));
   pipe->SetReceiver(receiver_.get());
 
@@ -135,7 +136,7 @@
   config.queue_length_packets = 20;
   config.queue_delay_ms = 100;
   config.link_capacity_kbps = 80;
-  rtc::scoped_ptr<FakeNetworkPipe> pipe(
+  std::unique_ptr<FakeNetworkPipe> pipe(
       new FakeNetworkPipe(&fake_clock_, config));
   pipe->SetReceiver(receiver_.get());
 
@@ -169,7 +170,7 @@
   FakeNetworkPipe::Config config;
   config.queue_length_packets = 2;
   config.link_capacity_kbps = 80;
-  rtc::scoped_ptr<FakeNetworkPipe> pipe(
+  std::unique_ptr<FakeNetworkPipe> pipe(
       new FakeNetworkPipe(&fake_clock_, config));
   pipe->SetReceiver(receiver_.get());
 
@@ -193,7 +194,7 @@
   config.queue_length_packets = 2;
   config.queue_delay_ms = 20;
   config.link_capacity_kbps = 80;
-  rtc::scoped_ptr<FakeNetworkPipe> pipe(
+  std::unique_ptr<FakeNetworkPipe> pipe(
       new FakeNetworkPipe(&fake_clock_, config));
   pipe->SetReceiver(receiver_.get());
 
@@ -223,7 +224,7 @@
   FakeNetworkPipe::Config config;
   config.queue_length_packets = 20;
   config.link_capacity_kbps = 80;
-  rtc::scoped_ptr<FakeNetworkPipe> pipe(
+  std::unique_ptr<FakeNetworkPipe> pipe(
       new FakeNetworkPipe(&fake_clock_, config));
   pipe->SetReceiver(receiver_.get());
 
@@ -282,7 +283,7 @@
   FakeNetworkPipe::Config config;
   config.queue_length_packets = 20;
   config.link_capacity_kbps = 80;
-  rtc::scoped_ptr<FakeNetworkPipe> pipe(
+  std::unique_ptr<FakeNetworkPipe> pipe(
       new FakeNetworkPipe(&fake_clock_, config));
   pipe->SetReceiver(receiver_.get());
 
@@ -337,7 +338,7 @@
   config.link_capacity_kbps = 800;
   config.queue_delay_ms = 100;
   config.delay_standard_deviation_ms = 10;
-  rtc::scoped_ptr<FakeNetworkPipe> pipe(
+  std::unique_ptr<FakeNetworkPipe> pipe(
       new FakeNetworkPipe(&fake_clock_, config));
   ReorderTestReceiver* receiver = new ReorderTestReceiver();
   receiver_.reset(receiver);
diff --git a/webrtc/test/frame_generator.cc b/webrtc/test/frame_generator.cc
index 3287aba..4da909d 100644
--- a/webrtc/test/frame_generator.cc
+++ b/webrtc/test/frame_generator.cc
@@ -13,6 +13,8 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <memory>
+
 #include "webrtc/base/checks.h"
 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
 #include "webrtc/system_wrappers/include/clock.h"
@@ -121,7 +123,7 @@
   const size_t width_;
   const size_t height_;
   const size_t frame_size_;
-  const rtc::scoped_ptr<uint8_t[]> frame_buffer_;
+  const std::unique_ptr<uint8_t[]> frame_buffer_;
   const int frame_display_count_;
   int current_display_count_;
   VideoFrame last_read_frame_;
diff --git a/webrtc/test/frame_generator_capturer.h b/webrtc/test/frame_generator_capturer.h
index 91ed843..2b34dd2 100644
--- a/webrtc/test/frame_generator_capturer.h
+++ b/webrtc/test/frame_generator_capturer.h
@@ -10,6 +10,7 @@
 #ifndef WEBRTC_TEST_FRAME_GENERATOR_CAPTURER_H_
 #define WEBRTC_TEST_FRAME_GENERATOR_CAPTURER_H_
 
+#include <memory>
 #include <string>
 
 #include "webrtc/base/criticalsection.h"
@@ -64,10 +65,10 @@
   Clock* const clock_;
   bool sending_;
 
-  rtc::scoped_ptr<EventTimerWrapper> tick_;
+  std::unique_ptr<EventTimerWrapper> tick_;
   rtc::CriticalSection lock_;
   rtc::PlatformThread thread_;
-  rtc::scoped_ptr<FrameGenerator> frame_generator_;
+  std::unique_ptr<FrameGenerator> frame_generator_;
 
   int target_fps_;
   VideoRotation fake_rotation_ = kVideoRotation_0;
diff --git a/webrtc/test/frame_generator_unittest.cc b/webrtc/test/frame_generator_unittest.cc
index 6376e2c2..10acd46 100644
--- a/webrtc/test/frame_generator_unittest.cc
+++ b/webrtc/test/frame_generator_unittest.cc
@@ -9,10 +9,11 @@
  */
 
 #include <stdio.h>
+
+#include <memory>
 #include <string>
 
 #include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/test/frame_generator.h"
 #include "webrtc/test/testsupport/fileutils.h"
 
@@ -46,7 +47,7 @@
  protected:
   void WriteYuvFile(FILE* file, uint8_t y, uint8_t u, uint8_t v) {
     assert(file);
-    rtc::scoped_ptr<uint8_t[]> plane_buffer(new uint8_t[y_size]);
+    std::unique_ptr<uint8_t[]> plane_buffer(new uint8_t[y_size]);
     memset(plane_buffer.get(), y, y_size);
     fwrite(plane_buffer.get(), 1, y_size, file);
     memset(plane_buffer.get(), u, uv_size);
@@ -88,7 +89,7 @@
 };
 
 TEST_F(FrameGeneratorTest, SingleFrameFile) {
-  rtc::scoped_ptr<FrameGenerator> generator(FrameGenerator::CreateFromYuvFile(
+  std::unique_ptr<FrameGenerator> generator(FrameGenerator::CreateFromYuvFile(
       std::vector<std::string>(1, one_frame_filename_), kFrameWidth,
       kFrameHeight, 1));
   CheckFrameAndMutate(generator->NextFrame(), 255, 255, 255);
@@ -96,7 +97,7 @@
 }
 
 TEST_F(FrameGeneratorTest, TwoFrameFile) {
-  rtc::scoped_ptr<FrameGenerator> generator(FrameGenerator::CreateFromYuvFile(
+  std::unique_ptr<FrameGenerator> generator(FrameGenerator::CreateFromYuvFile(
       std::vector<std::string>(1, two_frame_filename_), kFrameWidth,
       kFrameHeight, 1));
   CheckFrameAndMutate(generator->NextFrame(), 0, 0, 0);
@@ -109,7 +110,7 @@
   files.push_back(two_frame_filename_);
   files.push_back(one_frame_filename_);
 
-  rtc::scoped_ptr<FrameGenerator> generator(
+  std::unique_ptr<FrameGenerator> generator(
       FrameGenerator::CreateFromYuvFile(files, kFrameWidth, kFrameHeight, 1));
   CheckFrameAndMutate(generator->NextFrame(), 0, 0, 0);
   CheckFrameAndMutate(generator->NextFrame(), 127, 127, 127);
@@ -119,7 +120,7 @@
 
 TEST_F(FrameGeneratorTest, TwoFrameFileWithRepeat) {
   const int kRepeatCount = 3;
-  rtc::scoped_ptr<FrameGenerator> generator(FrameGenerator::CreateFromYuvFile(
+  std::unique_ptr<FrameGenerator> generator(FrameGenerator::CreateFromYuvFile(
       std::vector<std::string>(1, two_frame_filename_), kFrameWidth,
       kFrameHeight, kRepeatCount));
   for (int i = 0; i < kRepeatCount; ++i)
@@ -134,7 +135,7 @@
   std::vector<std::string> files;
   files.push_back(two_frame_filename_);
   files.push_back(one_frame_filename_);
-  rtc::scoped_ptr<FrameGenerator> generator(FrameGenerator::CreateFromYuvFile(
+  std::unique_ptr<FrameGenerator> generator(FrameGenerator::CreateFromYuvFile(
       files, kFrameWidth, kFrameHeight, kRepeatCount));
   for (int i = 0; i < kRepeatCount; ++i)
     CheckFrameAndMutate(generator->NextFrame(), 0, 0, 0);
diff --git a/webrtc/test/fuzzers/producer_fec_fuzzer.cc b/webrtc/test/fuzzers/producer_fec_fuzzer.cc
index abde879..53f7493 100644
--- a/webrtc/test/fuzzers/producer_fec_fuzzer.cc
+++ b/webrtc/test/fuzzers/producer_fec_fuzzer.cc
@@ -7,8 +7,10 @@
  *  in the file PATENTS.  All contributing project authors may
  *  be found in the AUTHORS file in the root of the source tree.
  */
+
+#include <memory>
+
 #include "webrtc/base/checks.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
 #include "webrtc/modules/rtp_rtcp/source/producer_fec.h"
 
@@ -30,14 +32,14 @@
     size_t payload_size = data[i++] % 10;
     if (i + payload_size + rtp_header_length + 2 > size)
       break;
-    rtc::scoped_ptr<uint8_t[]> packet(
+    std::unique_ptr<uint8_t[]> packet(
         new uint8_t[payload_size + rtp_header_length]);
     memcpy(packet.get(), &data[i], payload_size + rtp_header_length);
     ByteWriter<uint16_t>::WriteBigEndian(&packet[2], seq_num++);
     i += payload_size + rtp_header_length;
     // Make sure sequence numbers are increasing.
     const int kRedPayloadType = 98;
-    rtc::scoped_ptr<RedPacket> red_packet(producer.BuildRedPacket(
+    std::unique_ptr<RedPacket> red_packet(producer.BuildRedPacket(
         packet.get(), payload_size, rtp_header_length, kRedPayloadType));
     const bool protect = data[i++] % 2 == 1;
     if (protect) {
diff --git a/webrtc/test/fuzzers/rtcp_receiver_fuzzer.cc b/webrtc/test/fuzzers/rtcp_receiver_fuzzer.cc
index 944c79d..b7a4fdf 100644
--- a/webrtc/test/fuzzers/rtcp_receiver_fuzzer.cc
+++ b/webrtc/test/fuzzers/rtcp_receiver_fuzzer.cc
@@ -8,7 +8,6 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 #include "webrtc/base/checks.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/rtp_rtcp/source/rtcp_receiver.h"
 #include "webrtc/system_wrappers/include/clock.h"
 
diff --git a/webrtc/test/layer_filtering_transport.cc b/webrtc/test/layer_filtering_transport.cc
index 41d63ad..cba1a57 100644
--- a/webrtc/test/layer_filtering_transport.cc
+++ b/webrtc/test/layer_filtering_transport.cc
@@ -8,6 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <memory>
+
 #include "webrtc/base/checks.h"
 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
@@ -62,7 +64,7 @@
     const size_t payload_data_length = payload_length - header.paddingLength;
 
     const bool is_vp8 = header.payloadType == vp8_video_payload_type_;
-    rtc::scoped_ptr<RtpDepacketizer> depacketizer(
+    std::unique_ptr<RtpDepacketizer> depacketizer(
         RtpDepacketizer::Create(is_vp8 ? kRtpVideoVp8 : kRtpVideoVp9));
     RtpDepacketizer::ParsedPayload parsed_payload;
     if (depacketizer->Parse(&parsed_payload, payload, payload_data_length)) {
diff --git a/webrtc/test/rtp_file_reader.cc b/webrtc/test/rtp_file_reader.cc
index 476767a..d437d41 100644
--- a/webrtc/test/rtp_file_reader.cc
+++ b/webrtc/test/rtp_file_reader.cc
@@ -19,7 +19,6 @@
 #include "webrtc/base/checks.h"
 #include "webrtc/base/constructormagic.h"
 #include "webrtc/base/format_macros.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
 
 namespace webrtc {
diff --git a/webrtc/test/rtp_file_reader_unittest.cc b/webrtc/test/rtp_file_reader_unittest.cc
index 15a456c..fceac38 100644
--- a/webrtc/test/rtp_file_reader_unittest.cc
+++ b/webrtc/test/rtp_file_reader_unittest.cc
@@ -9,9 +9,9 @@
  */
 
 #include <map>
+#include <memory>
 
 #include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
 #include "webrtc/test/rtp_file_reader.h"
 #include "webrtc/test/testsupport/fileutils.h"
@@ -43,7 +43,7 @@
   }
 
  private:
-  rtc::scoped_ptr<test::RtpFileReader> rtp_packet_source_;
+  std::unique_ptr<test::RtpFileReader> rtp_packet_source_;
   bool headers_only_file_;
 };
 
@@ -94,7 +94,7 @@
   }
 
  private:
-  rtc::scoped_ptr<test::RtpFileReader> rtp_packet_source_;
+  std::unique_ptr<test::RtpFileReader> rtp_packet_source_;
 };
 
 TEST_F(TestPcapFileReader, TestEthernetIIFrame) {
diff --git a/webrtc/test/rtp_file_writer_unittest.cc b/webrtc/test/rtp_file_writer_unittest.cc
index 2c7c88c..3287f97 100644
--- a/webrtc/test/rtp_file_writer_unittest.cc
+++ b/webrtc/test/rtp_file_writer_unittest.cc
@@ -10,8 +10,9 @@
 
 #include <string.h>
 
+#include <memory>
+
 #include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/test/rtp_file_reader.h"
 #include "webrtc/test/rtp_file_writer.h"
 #include "webrtc/test/testsupport/fileutils.h"
@@ -43,7 +44,7 @@
   void VerifyFileContents(int expected_packets) {
     ASSERT_TRUE(rtp_writer_.get() == NULL)
         << "Must call CloseOutputFile before VerifyFileContents";
-    rtc::scoped_ptr<test::RtpFileReader> rtp_reader(
+    std::unique_ptr<test::RtpFileReader> rtp_reader(
         test::RtpFileReader::Create(test::RtpFileReader::kRtpDump, filename_));
     ASSERT_TRUE(rtp_reader.get() != NULL);
     test::RtpPacket packet;
@@ -61,7 +62,7 @@
   }
 
  private:
-  rtc::scoped_ptr<test::RtpFileWriter> rtp_writer_;
+  std::unique_ptr<test::RtpFileWriter> rtp_writer_;
   std::string filename_;
 };
 
diff --git a/webrtc/test/rtp_rtcp_observer.h b/webrtc/test/rtp_rtcp_observer.h
index 5eb88d3..ab86561 100644
--- a/webrtc/test/rtp_rtcp_observer.h
+++ b/webrtc/test/rtp_rtcp_observer.h
@@ -11,6 +11,7 @@
 #define WEBRTC_TEST_RTP_RTCP_OBSERVER_H_
 
 #include <map>
+#include <memory>
 #include <vector>
 
 #include "testing/gtest/include/gtest/gtest.h"
@@ -69,7 +70,7 @@
   }
 
   rtc::Event observation_complete_;
-  const rtc::scoped_ptr<RtpHeaderParser> parser_;
+  const std::unique_ptr<RtpHeaderParser> parser_;
 
  private:
   const int timeout_ms_;
diff --git a/webrtc/test/test_suite.h b/webrtc/test/test_suite.h
index dab2acd..94b11cf 100644
--- a/webrtc/test/test_suite.h
+++ b/webrtc/test/test_suite.h
@@ -17,6 +17,8 @@
 // instantiate this class in your main function and call its Run method to run
 // any gtest based tests that are linked into your executable.
 
+#include <memory>
+
 #include "webrtc/base/constructormagic.h"
 #include "webrtc/base/scoped_ptr.h"
 
@@ -41,7 +43,7 @@
   RTC_DISALLOW_COPY_AND_ASSIGN(TestSuite);
 
  private:
-  rtc::scoped_ptr<TraceToStderr> trace_to_stderr_;
+  std::unique_ptr<TraceToStderr> trace_to_stderr_;
 };
 
 }  // namespace test
diff --git a/webrtc/test/testsupport/fileutils.cc b/webrtc/test/testsupport/fileutils.cc
index 2fab425..d99b990 100644
--- a/webrtc/test/testsupport/fileutils.cc
+++ b/webrtc/test/testsupport/fileutils.cc
@@ -23,7 +23,6 @@
 #else
 #include <unistd.h>
 
-#include "webrtc/base/scoped_ptr.h"
 #define GET_CURRENT_DIR getcwd
 #endif
 
@@ -36,6 +35,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <memory>
+
 #include "webrtc/typedefs.h"  // For architecture defines
 
 namespace webrtc {
@@ -183,7 +184,7 @@
   return "";
 #else
   int len = dir.size() + prefix.size() + 2 + 6;
-  rtc::scoped_ptr<char[]> tempname(new char[len]);
+  std::unique_ptr<char[]> tempname(new char[len]);
 
   snprintf(tempname.get(), len, "%s/%sXXXXXX", dir.c_str(),
            prefix.c_str());
diff --git a/webrtc/tools/agc/activity_metric.cc b/webrtc/tools/agc/activity_metric.cc
index 258d023..6c1f756 100644
--- a/webrtc/tools/agc/activity_metric.cc
+++ b/webrtc/tools/agc/activity_metric.cc
@@ -14,10 +14,10 @@
 #include <stdlib.h>
 
 #include <algorithm>
+#include <memory>
 
 #include "gflags/gflags.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/audio_processing/agc/agc.h"
 #include "webrtc/modules/audio_processing/agc/histogram.h"
 #include "webrtc/modules/audio_processing/agc/utility.h"
@@ -155,10 +155,10 @@
   int video_index_;
   double activity_threshold_;
   double video_vad_[kMaxNumFrames];
-  rtc::scoped_ptr<Histogram> audio_content_;
-  rtc::scoped_ptr<VadAudioProc> audio_processing_;
-  rtc::scoped_ptr<PitchBasedVad> vad_;
-  rtc::scoped_ptr<StandaloneVad> standalone_vad_;
+  std::unique_ptr<Histogram> audio_content_;
+  std::unique_ptr<VadAudioProc> audio_processing_;
+  std::unique_ptr<PitchBasedVad> vad_;
+  std::unique_ptr<StandaloneVad> standalone_vad_;
 
   FILE* audio_content_fid_;
 };
diff --git a/webrtc/tools/agc/agc_harness.cc b/webrtc/tools/agc/agc_harness.cc
index 0d35d4b..1791962 100644
--- a/webrtc/tools/agc/agc_harness.cc
+++ b/webrtc/tools/agc/agc_harness.cc
@@ -10,10 +10,11 @@
 
 // Refer to kUsage below for a description.
 
+#include <memory>
+
 #include "gflags/gflags.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/base/format_macros.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/system_wrappers/include/sleep.h"
 #include "webrtc/system_wrappers/include/trace.h"
 #include "webrtc/test/channel_transport/channel_transport.h"
@@ -217,13 +218,13 @@
   int channel_;
   int capture_idx_;
   int render_idx_;
-  rtc::scoped_ptr<test::VoiceChannelTransport> channel_transport_;
+  std::unique_ptr<test::VoiceChannelTransport> channel_transport_;
 };
 
 void RunHarness() {
-  rtc::scoped_ptr<AgcVoiceEngine> voe1(new AgcVoiceEngine(
+  std::unique_ptr<AgcVoiceEngine> voe1(new AgcVoiceEngine(
       FLAGS_legacy_agc, 2000, 2000, FLAGS_capture1, FLAGS_render1));
-  rtc::scoped_ptr<AgcVoiceEngine> voe2;
+  std::unique_ptr<AgcVoiceEngine> voe2;
   if (FLAGS_parallel) {
     voe2.reset(new AgcVoiceEngine(!FLAGS_legacy_agc, 3000, 3000, FLAGS_capture2,
                                   FLAGS_render2));
diff --git a/webrtc/tools/e2e_quality/audio/audio_e2e_harness.cc b/webrtc/tools/e2e_quality/audio/audio_e2e_harness.cc
index 2594fd1..fb07b56 100644
--- a/webrtc/tools/e2e_quality/audio/audio_e2e_harness.cc
+++ b/webrtc/tools/e2e_quality/audio/audio_e2e_harness.cc
@@ -12,10 +12,11 @@
 // and runs forever. Some parameters can be configured through command-line
 // flags.
 
+#include <memory>
+
 #include "gflags/gflags.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/test/channel_transport/channel_transport.h"
 #include "webrtc/voice_engine/include/voe_audio_processing.h"
 #include "webrtc/voice_engine/include/voe_base.h"
@@ -48,7 +49,7 @@
   int channel = base->CreateChannel();
   ASSERT_NE(-1, channel);
 
-  rtc::scoped_ptr<VoiceChannelTransport> voice_channel_transport(
+  std::unique_ptr<VoiceChannelTransport> voice_channel_transport(
       new VoiceChannelTransport(network, channel));
 
   ASSERT_EQ(0, voice_channel_transport->SetSendDestination("127.0.0.1", 1234));
diff --git a/webrtc/tools/force_mic_volume_max/force_mic_volume_max.cc b/webrtc/tools/force_mic_volume_max/force_mic_volume_max.cc
index b6b1596..2bab288 100644
--- a/webrtc/tools/force_mic_volume_max/force_mic_volume_max.cc
+++ b/webrtc/tools/force_mic_volume_max/force_mic_volume_max.cc
@@ -12,7 +12,6 @@
 
 #include <stdio.h>
 
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/test/channel_transport/channel_transport.h"
 #include "webrtc/voice_engine/include/voe_audio_processing.h"
 #include "webrtc/voice_engine/include/voe_base.h"
diff --git a/webrtc/tools/frame_editing/frame_editing_lib.cc b/webrtc/tools/frame_editing/frame_editing_lib.cc
index 90855a3..bb6a75e 100644
--- a/webrtc/tools/frame_editing/frame_editing_lib.cc
+++ b/webrtc/tools/frame_editing/frame_editing_lib.cc
@@ -11,9 +11,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 
+#include <memory>
 #include <string>
 
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
 #include "webrtc/tools/frame_editing/frame_editing_lib.h"
 #include "webrtc/typedefs.h"
@@ -39,7 +39,7 @@
   // Frame size of I420.
   size_t frame_length = CalcBufferSize(kI420, width, height);
 
-  rtc::scoped_ptr<uint8_t[]> temp_buffer(new uint8_t[frame_length]);
+  std::unique_ptr<uint8_t[]> temp_buffer(new uint8_t[frame_length]);
 
   FILE* out_fid = fopen(out_path.c_str(), "wb");
 
diff --git a/webrtc/tools/frame_editing/frame_editing_unittest.cc b/webrtc/tools/frame_editing/frame_editing_unittest.cc
index 31991b7..e1ba1de 100644
--- a/webrtc/tools/frame_editing/frame_editing_unittest.cc
+++ b/webrtc/tools/frame_editing/frame_editing_unittest.cc
@@ -12,9 +12,9 @@
 #include <stdlib.h>
 
 #include <fstream>
+#include <memory>
 
 #include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
 #include "webrtc/test/testsupport/fileutils.h"
 #include "webrtc/tools/frame_editing/frame_editing_lib.h"
@@ -56,8 +56,8 @@
   // Compares the frames in both streams to the end of one of the streams.
   void CompareToTheEnd(FILE* test_video_fid,
                        FILE* ref_video_fid,
-                       rtc::scoped_ptr<int[]>* ref_buffer,
-                       rtc::scoped_ptr<int[]>* test_buffer) {
+                       std::unique_ptr<int[]>* ref_buffer,
+                       std::unique_ptr<int[]>* test_buffer) {
     while (!feof(test_video_fid) && !feof(ref_video_fid)) {
       num_bytes_read_ = fread(ref_buffer->get(), 1, kFrameSize, ref_video_fid);
       if (!feof(ref_video_fid)) {
@@ -81,8 +81,8 @@
   FILE* original_fid_;
   FILE* edited_fid_;
   size_t num_bytes_read_;
-  rtc::scoped_ptr<int[]> original_buffer_;
-  rtc::scoped_ptr<int[]> edited_buffer_;
+  std::unique_ptr<int[]> original_buffer_;
+  std::unique_ptr<int[]> edited_buffer_;
   int num_frames_read_;
 };
 
diff --git a/webrtc/video/video_capture_input.h b/webrtc/video/video_capture_input.h
index baf2082..5877f6c 100644
--- a/webrtc/video/video_capture_input.h
+++ b/webrtc/video/video_capture_input.h
@@ -11,6 +11,7 @@
 #ifndef WEBRTC_VIDEO_VIDEO_CAPTURE_INPUT_H_
 #define WEBRTC_VIDEO_VIDEO_CAPTURE_INPUT_H_
 
+#include <memory>
 #include <vector>
 
 #include "webrtc/base/criticalsection.h"
diff --git a/webrtc/video/video_send_stream.h b/webrtc/video/video_send_stream.h
index ad438ae..475b58e 100644
--- a/webrtc/video/video_send_stream.h
+++ b/webrtc/video/video_send_stream.h
@@ -12,6 +12,7 @@
 #define WEBRTC_VIDEO_VIDEO_SEND_STREAM_H_
 
 #include <map>
+#include <memory>
 #include <vector>
 
 #include "webrtc/call/bitrate_allocator.h"