Replace the remaining scoped_ptr with unique_ptr in webrtc/modules/

(This is a re-land of https://codereview.webrtc.org/1921233002, which
got reverted for breaking Chromium.)

BUG=webrtc:5520

Review URL: https://codereview.webrtc.org/1923133002

Cr-Commit-Position: refs/heads/master@{#12522}
diff --git a/webrtc/modules/audio_coding/include/audio_coding_module.h b/webrtc/modules/audio_coding/include/audio_coding_module.h
index 381e35e..eb9d5b8 100644
--- a/webrtc/modules/audio_coding/include/audio_coding_module.h
+++ b/webrtc/modules/audio_coding/include/audio_coding_module.h
@@ -11,6 +11,7 @@
 #ifndef WEBRTC_MODULES_AUDIO_CODING_INCLUDE_AUDIO_CODING_MODULE_H_
 #define WEBRTC_MODULES_AUDIO_CODING_INCLUDE_AUDIO_CODING_MODULE_H_
 
+#include <memory>
 #include <string>
 #include <vector>
 
diff --git a/webrtc/modules/audio_coding/neteq/decoder_database.h b/webrtc/modules/audio_coding/neteq/decoder_database.h
index 8dbec22..ec8a5d6 100644
--- a/webrtc/modules/audio_coding/neteq/decoder_database.h
+++ b/webrtc/modules/audio_coding/neteq/decoder_database.h
@@ -12,6 +12,7 @@
 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_DECODER_DATABASE_H_
 
 #include <map>
+#include <memory>
 #include <string>
 
 #include "webrtc/base/constructormagic.h"
diff --git a/webrtc/modules/audio_coding/neteq/neteq.cc b/webrtc/modules/audio_coding/neteq/neteq.cc
index c2a0cb6..edc29da 100644
--- a/webrtc/modules/audio_coding/neteq/neteq.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq.cc
@@ -10,6 +10,7 @@
 
 #include "webrtc/modules/audio_coding/neteq/include/neteq.h"
 
+#include <memory>
 #include <sstream>
 
 #include "webrtc/modules/audio_coding/neteq/neteq_impl.h"
diff --git a/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc b/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc
index e9ada1a..66b2b8b 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc
@@ -8,6 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <memory>
+
 #include "webrtc/modules/audio_coding/neteq/include/neteq.h"
 #include "webrtc/modules/audio_coding/neteq/neteq_impl.h"
 
diff --git a/webrtc/modules/audio_coding/neteq/tick_timer_unittest.cc b/webrtc/modules/audio_coding/neteq/tick_timer_unittest.cc
index 465ce3f..55edcf5 100644
--- a/webrtc/modules/audio_coding/neteq/tick_timer_unittest.cc
+++ b/webrtc/modules/audio_coding/neteq/tick_timer_unittest.cc
@@ -8,6 +8,8 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <memory>
+
 #include "webrtc/modules/audio_coding/neteq/tick_timer.h"
 
 #include "testing/gmock/include/gmock/gmock.h"
diff --git a/webrtc/modules/audio_processing/test/debug_dump_test.cc b/webrtc/modules/audio_processing/test/debug_dump_test.cc
index f68c175..b61b7b3 100644
--- a/webrtc/modules/audio_processing/test/debug_dump_test.cc
+++ b/webrtc/modules/audio_processing/test/debug_dump_test.cc
@@ -10,6 +10,7 @@
 
 #include <stddef.h>  // size_t
 
+#include <memory>
 #include <string>
 #include <vector>
 
diff --git a/webrtc/modules/congestion_controller/include/congestion_controller.h b/webrtc/modules/congestion_controller/include/congestion_controller.h
index 13614f5..7f18150 100644
--- a/webrtc/modules/congestion_controller/include/congestion_controller.h
+++ b/webrtc/modules/congestion_controller/include/congestion_controller.h
@@ -11,6 +11,8 @@
 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_
 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_
 
+#include <memory>
+
 #include "webrtc/base/constructormagic.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/include/module.h"
@@ -69,9 +71,9 @@
 
  private:
   Clock* const clock_;
-  const rtc::scoped_ptr<PacedSender> pacer_;
-  const rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
-  const rtc::scoped_ptr<BitrateController> bitrate_controller_;
+  const std::unique_ptr<PacedSender> pacer_;
+  const std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
+  const std::unique_ptr<BitrateController> bitrate_controller_;
   PacketRouter packet_router_;
   RemoteEstimatorProxy remote_estimator_proxy_;
   TransportFeedbackAdapter transport_feedback_adapter_;
diff --git a/webrtc/modules/desktop_capture/cropping_window_capturer.cc b/webrtc/modules/desktop_capture/cropping_window_capturer.cc
index 0dd564f..cbe7d96 100644
--- a/webrtc/modules/desktop_capture/cropping_window_capturer.cc
+++ b/webrtc/modules/desktop_capture/cropping_window_capturer.cc
@@ -32,7 +32,7 @@
 }
 
 void CroppingWindowCapturer::SetSharedMemoryFactory(
-    rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {
+    std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {
   window_capturer_->SetSharedMemoryFactory(std::move(shared_memory_factory));
 }
 
diff --git a/webrtc/modules/desktop_capture/cropping_window_capturer.h b/webrtc/modules/desktop_capture/cropping_window_capturer.h
index 177b544..27957ad 100644
--- a/webrtc/modules/desktop_capture/cropping_window_capturer.h
+++ b/webrtc/modules/desktop_capture/cropping_window_capturer.h
@@ -32,7 +32,7 @@
   // DesktopCapturer implementation.
   void Start(DesktopCapturer::Callback* callback) override;
   void SetSharedMemoryFactory(
-      rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override;
+      std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override;
   void Capture(const DesktopRegion& region) override;
   void SetExcludedWindow(WindowId window) override;
 
diff --git a/webrtc/modules/desktop_capture/desktop_and_cursor_composer.cc b/webrtc/modules/desktop_capture/desktop_and_cursor_composer.cc
index 52b111c..4c6e27e 100644
--- a/webrtc/modules/desktop_capture/desktop_and_cursor_composer.cc
+++ b/webrtc/modules/desktop_capture/desktop_and_cursor_composer.cc
@@ -138,7 +138,7 @@
 }
 
 void DesktopAndCursorComposer::SetSharedMemoryFactory(
-    rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {
+    std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {
   desktop_capturer_->SetSharedMemoryFactory(std::move(shared_memory_factory));
 }
 
diff --git a/webrtc/modules/desktop_capture/desktop_and_cursor_composer.h b/webrtc/modules/desktop_capture/desktop_and_cursor_composer.h
index bcf345e..971943b 100644
--- a/webrtc/modules/desktop_capture/desktop_and_cursor_composer.h
+++ b/webrtc/modules/desktop_capture/desktop_and_cursor_composer.h
@@ -37,7 +37,7 @@
   // DesktopCapturer interface.
   void Start(DesktopCapturer::Callback* callback) override;
   void SetSharedMemoryFactory(
-      rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override;
+      std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override;
   void Capture(const DesktopRegion& region) override;
   void SetExcludedWindow(WindowId window) override;
 
diff --git a/webrtc/modules/desktop_capture/desktop_capturer.h b/webrtc/modules/desktop_capture/desktop_capturer.h
index 9c2b8c3..103740a 100644
--- a/webrtc/modules/desktop_capture/desktop_capturer.h
+++ b/webrtc/modules/desktop_capture/desktop_capturer.h
@@ -13,6 +13,8 @@
 
 #include <stddef.h>
 
+#include <memory>
+
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/desktop_capture/desktop_capture_types.h"
 #include "webrtc/modules/desktop_capture/shared_memory.h"
@@ -48,7 +50,7 @@
   // where Capture() is called. It will be destroyed on the same thread. Shared
   // memory is currently supported only by some DesktopCapturer implementations.
   virtual void SetSharedMemoryFactory(
-      rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {}
+      std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {}
 
   // Captures next frame. |region| specifies region of the capture target that
   // should be fresh in the resulting frame. The frame may also include fresh
diff --git a/webrtc/modules/desktop_capture/screen_capturer_unittest.cc b/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
index 6f4963e..bc87ed3 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_unittest.cc
@@ -60,8 +60,8 @@
   FakeSharedMemoryFactory() {}
   ~FakeSharedMemoryFactory() override {}
 
-  rtc::scoped_ptr<SharedMemory> CreateSharedMemory(size_t size) override {
-    return rtc::scoped_ptr<SharedMemory>(
+  std::unique_ptr<SharedMemory> CreateSharedMemory(size_t size) override {
+    return std::unique_ptr<SharedMemory>(
         new FakeSharedMemory(new char[size], size));
   }
 
@@ -118,7 +118,7 @@
 
   capturer_->Start(&callback_);
   capturer_->SetSharedMemoryFactory(
-      rtc::scoped_ptr<SharedMemoryFactory>(new FakeSharedMemoryFactory()));
+      std::unique_ptr<SharedMemoryFactory>(new FakeSharedMemoryFactory()));
   capturer_->Capture(DesktopRegion());
 
   ASSERT_TRUE(frame);
diff --git a/webrtc/modules/desktop_capture/shared_memory.h b/webrtc/modules/desktop_capture/shared_memory.h
index 45f531e..e1d1e7c 100644
--- a/webrtc/modules/desktop_capture/shared_memory.h
+++ b/webrtc/modules/desktop_capture/shared_memory.h
@@ -17,6 +17,8 @@
 #include <windows.h>
 #endif
 
+#include <memory>
+
 #include "webrtc/base/constructormagic.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/typedefs.h"
@@ -69,7 +71,7 @@
   SharedMemoryFactory() {}
   virtual ~SharedMemoryFactory() {}
 
-  virtual rtc::scoped_ptr<SharedMemory> CreateSharedMemory(size_t size) = 0;
+  virtual std::unique_ptr<SharedMemory> CreateSharedMemory(size_t size) = 0;
 
  private:
   RTC_DISALLOW_COPY_AND_ASSIGN(SharedMemoryFactory);
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc
index 5a494f4..2a5a87e 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.cc
@@ -74,7 +74,7 @@
 }
 
 void ScreenCapturerWinGdi::SetSharedMemoryFactory(
-    rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {
+    std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {
   shared_memory_factory_ = std::move(shared_memory_factory);
 }
 
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h
index 7fb674d..f43aa0d 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h
@@ -39,7 +39,7 @@
   // Overridden from ScreenCapturer:
   void Start(Callback* callback) override;
   void SetSharedMemoryFactory(
-      rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override;
+      std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override;
   void Capture(const DesktopRegion& region) override;
   bool GetScreenList(ScreenList* screens) override;
   bool SelectScreen(ScreenId id) override;
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
index 053a0a3..e3a5f25 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc
@@ -82,7 +82,7 @@
 }
 
 void ScreenCapturerWinMagnifier::SetSharedMemoryFactory(
-    rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) {
+    std::unique_ptr<SharedMemoryFactory> shared_memory_factory) {
   shared_memory_factory_ = std::move(shared_memory_factory);
 }
 
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h
index ad3ddb1..82ef528 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h
@@ -48,7 +48,7 @@
   // Overridden from ScreenCapturer:
   void Start(Callback* callback) override;
   void SetSharedMemoryFactory(
-      rtc::scoped_ptr<SharedMemoryFactory> shared_memory_factory) override;
+      std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override;
   void Capture(const DesktopRegion& region) override;
   bool GetScreenList(ScreenList* screens) override;
   bool SelectScreen(ScreenId id) override;
diff --git a/webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h b/webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h
index a76e5e0..d57518a 100644
--- a/webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h
+++ b/webrtc/modules/rtp_rtcp/include/remote_ntp_time_estimator.h
@@ -11,6 +11,8 @@
 #ifndef WEBRTC_MODULES_RTP_RTCP_INCLUDE_REMOTE_NTP_TIME_ESTIMATOR_H_
 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_REMOTE_NTP_TIME_ESTIMATOR_H_
 
+#include <memory>
+
 #include "webrtc/base/constructormagic.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/system_wrappers/include/rtp_to_ntp.h"
@@ -41,7 +43,7 @@
 
  private:
   Clock* clock_;
-  rtc::scoped_ptr<TimestampExtrapolator> ts_extrapolator_;
+  std::unique_ptr<TimestampExtrapolator> ts_extrapolator_;
   RtcpList rtcp_list_;
   int64_t last_timing_log_ms_;
   RTC_DISALLOW_COPY_AND_ASSIGN(RemoteNtpTimeEstimator);
diff --git a/webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h b/webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h
index 6ce6434..06ef2fc 100644
--- a/webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h
+++ b/webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h
@@ -12,6 +12,7 @@
 #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RTP_PAYLOAD_REGISTRY_H_
 
 #include <map>
+#include <memory>
 
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/scoped_ptr.h"
@@ -181,7 +182,7 @@
 
   rtc::CriticalSection crit_sect_;
   RtpUtility::PayloadTypeMap payload_type_map_;
-  rtc::scoped_ptr<RTPPayloadStrategy> rtp_payload_strategy_;
+  std::unique_ptr<RTPPayloadStrategy> rtp_payload_strategy_;
   int8_t  red_payload_type_;
   int8_t ulpfec_payload_type_;
   int8_t incoming_payload_type_;
diff --git a/webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc b/webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc
index 28e98ba..83bd284 100644
--- a/webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/fec_receiver_impl.cc
@@ -12,8 +12,9 @@
 
 #include <assert.h>
 
+#include <memory>
+
 #include "webrtc/base/logging.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
 #include "webrtc/modules/rtp_rtcp/source/rtp_receiver_video.h"
 
@@ -87,7 +88,7 @@
   // Add to list without RED header, aka a virtual RTP packet
   // we remove the RED header
 
-  rtc::scoped_ptr<ForwardErrorCorrection::ReceivedPacket> received_packet(
+  std::unique_ptr<ForwardErrorCorrection::ReceivedPacket> received_packet(
       new ForwardErrorCorrection::ReceivedPacket);
   received_packet->pkt = new ForwardErrorCorrection::Packet;
 
@@ -135,7 +136,7 @@
   }
   ++packet_counter_.num_packets;
 
-  rtc::scoped_ptr<ForwardErrorCorrection::ReceivedPacket>
+  std::unique_ptr<ForwardErrorCorrection::ReceivedPacket>
       second_received_packet;
   if (blockLength > 0) {
     // handle block length, split into 2 packets
diff --git a/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc b/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc
index ee8f408..cd60d9b 100644
--- a/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/fec_receiver_unittest.cc
@@ -11,10 +11,10 @@
 #include <string.h>
 
 #include <list>
+#include <memory>
 
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/rtp_rtcp/include/fec_receiver.h"
 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
 #include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
@@ -92,9 +92,9 @@
                                       uint8_t ulpfec_payload_type);
 
   MockRtpData rtp_data_callback_;
-  rtc::scoped_ptr<ForwardErrorCorrection> fec_;
-  rtc::scoped_ptr<FecReceiver> receiver_fec_;
-  rtc::scoped_ptr<FrameGenerator> generator_;
+  std::unique_ptr<ForwardErrorCorrection> fec_;
+  std::unique_ptr<FecReceiver> receiver_fec_;
+  std::unique_ptr<FrameGenerator> generator_;
 };
 
 void DeletePackets(std::list<Packet*>* packets) {
@@ -415,12 +415,12 @@
                                               size_t length,
                                               uint8_t ulpfec_payload_type) {
   webrtc::RTPHeader header;
-  rtc::scoped_ptr<webrtc::RtpHeaderParser> parser(
+  std::unique_ptr<webrtc::RtpHeaderParser> parser(
       webrtc::RtpHeaderParser::Create());
   ASSERT_TRUE(parser->Parse(data, length, &header));
 
   webrtc::NullRtpData null_callback;
-  rtc::scoped_ptr<webrtc::FecReceiver> receiver_fec(
+  std::unique_ptr<webrtc::FecReceiver> receiver_fec(
       webrtc::FecReceiver::Create(&null_callback));
 
   receiver_fec->AddReceivedRedPacket(header, data, length, ulpfec_payload_type);
diff --git a/webrtc/modules/rtp_rtcp/source/forward_error_correction.cc b/webrtc/modules/rtp_rtcp/source/forward_error_correction.cc
index b85d813..623c658 100644
--- a/webrtc/modules/rtp_rtcp/source/forward_error_correction.cc
+++ b/webrtc/modules/rtp_rtcp/source/forward_error_correction.cc
@@ -15,6 +15,7 @@
 
 #include <algorithm>
 #include <iterator>
+#include <memory>
 
 #include "webrtc/base/checks.h"
 #include "webrtc/base/logging.h"
@@ -163,7 +164,7 @@
 
   // -- Generate packet masks --
   // Always allocate space for a large mask.
-  rtc::scoped_ptr<uint8_t[]> packet_mask(
+  std::unique_ptr<uint8_t[]> packet_mask(
       new uint8_t[num_fec_packets * kMaskSizeLBitSet]);
   memset(packet_mask.get(), 0, num_fec_packets * num_mask_bytes);
   internal::GeneratePacketMasks(num_media_packets, num_fec_packets,
diff --git a/webrtc/modules/rtp_rtcp/source/h264_bitstream_parser.cc b/webrtc/modules/rtp_rtcp/source/h264_bitstream_parser.cc
index 6d8b407..e23a3fa 100644
--- a/webrtc/modules/rtp_rtcp/source/h264_bitstream_parser.cc
+++ b/webrtc/modules/rtp_rtcp/source/h264_bitstream_parser.cc
@@ -9,13 +9,13 @@
  */
 #include "webrtc/modules/rtp_rtcp/source/h264_bitstream_parser.h"
 
+#include <memory>
 #include <vector>
 
 #include "webrtc/base/bitbuffer.h"
 #include "webrtc/base/bytebuffer.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/base/logging.h"
-#include "webrtc/base/scoped_ptr.h"
 
 namespace webrtc {
 namespace {
@@ -103,7 +103,7 @@
   sps_parsed_ = false;
   // Parse out the SPS RBSP. It should be small, so it's ok that we create a
   // copy. We'll eventually write this back.
-  rtc::scoped_ptr<rtc::ByteBufferWriter> sps_rbsp(
+  std::unique_ptr<rtc::ByteBufferWriter> sps_rbsp(
       ParseRbsp(sps + kNaluHeaderAndTypeSize, length - kNaluHeaderAndTypeSize));
   rtc::BitBuffer sps_parser(reinterpret_cast<const uint8_t*>(sps_rbsp->Data()),
                             sps_rbsp->Length());
@@ -209,7 +209,7 @@
   // We're starting a new stream, so reset picture type rewriting values.
   pps_ = PpsState();
   pps_parsed_ = false;
-  rtc::scoped_ptr<rtc::ByteBufferWriter> buffer(
+  std::unique_ptr<rtc::ByteBufferWriter> buffer(
       ParseRbsp(pps + kNaluHeaderAndTypeSize, length - kNaluHeaderAndTypeSize));
   rtc::BitBuffer parser(reinterpret_cast<const uint8_t*>(buffer->Data()),
                         buffer->Length());
@@ -317,7 +317,7 @@
   RTC_CHECK(sps_parsed_);
   RTC_CHECK(pps_parsed_);
   last_slice_qp_delta_parsed_ = false;
-  rtc::scoped_ptr<rtc::ByteBufferWriter> slice_rbsp(ParseRbsp(
+  std::unique_ptr<rtc::ByteBufferWriter> slice_rbsp(ParseRbsp(
       source + kNaluHeaderAndTypeSize, source_length - kNaluHeaderAndTypeSize));
   rtc::BitBuffer slice_reader(
       reinterpret_cast<const uint8_t*>(slice_rbsp->Data()),
diff --git a/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc b/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc
index e19c31b..a73d4ed 100644
--- a/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/nack_rtx_unittest.cc
@@ -11,10 +11,10 @@
 #include <algorithm>
 #include <iterator>
 #include <list>
+#include <memory>
 #include <set>
 
 #include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/common_types.h"
 #include "webrtc/modules/rtp_rtcp/include/receive_statistics.h"
 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
@@ -105,7 +105,7 @@
     size_t packet_length = len;
     uint8_t restored_packet[1500];
     RTPHeader header;
-    rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
+    std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
     if (!parser->Parse(ptr, len, &header)) {
       return false;
     }
@@ -279,11 +279,11 @@
 
   void TearDown() override { delete rtp_rtcp_module_; }
 
-  rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
+  std::unique_ptr<ReceiveStatistics> receive_statistics_;
   RTPPayloadRegistry rtp_payload_registry_;
-  rtc::scoped_ptr<RtpReceiver> rtp_receiver_;
+  std::unique_ptr<RtpReceiver> rtp_receiver_;
   RtpRtcp* rtp_rtcp_module_;
-  rtc::scoped_ptr<TestRtpFeedback> rtp_feedback_;
+  std::unique_ptr<TestRtpFeedback> rtp_feedback_;
   RtxLoopBackTransport transport_;
   VerifyingRtxReceiver receiver_;
   uint8_t payload_data[65000];
diff --git a/webrtc/modules/rtp_rtcp/source/producer_fec_unittest.cc b/webrtc/modules/rtp_rtcp/source/producer_fec_unittest.cc
index 96c564a..ec5228a 100644
--- a/webrtc/modules/rtp_rtcp/source/producer_fec_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/producer_fec_unittest.cc
@@ -9,6 +9,7 @@
  */
 
 #include <list>
+#include <memory>
 #include <vector>
 
 #include "testing/gtest/include/gtest/gtest.h"
@@ -188,7 +189,7 @@
 TEST_F(ProducerFecTest, BuildRedPacket) {
   generator_->NewFrame(1);
   test::RawRtpPacket* packet = generator_->NextPacket(0, 10);
-  rtc::scoped_ptr<RedPacket> red_packet(producer_->BuildRedPacket(
+  std::unique_ptr<RedPacket> red_packet(producer_->BuildRedPacket(
       packet->data, packet->length - kRtpHeaderSize, kRtpHeaderSize,
       kRedPayloadType));
   EXPECT_EQ(packet->length + 1, red_packet->length());
diff --git a/webrtc/modules/rtp_rtcp/source/receive_statistics_unittest.cc b/webrtc/modules/rtp_rtcp/source/receive_statistics_unittest.cc
index c265c17..898ec02 100644
--- a/webrtc/modules/rtp_rtcp/source/receive_statistics_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/receive_statistics_unittest.cc
@@ -8,9 +8,10 @@
  *  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/modules/rtp_rtcp/include/receive_statistics.h"
 #include "webrtc/system_wrappers/include/clock.h"
 
@@ -36,7 +37,7 @@
 
  protected:
   SimulatedClock clock_;
-  rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
+  std::unique_ptr<ReceiveStatistics> receive_statistics_;
   RTPHeader header1_;
   RTPHeader header2_;
 };
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_format_remb_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtcp_format_remb_unittest.cc
index 183076f..bbfb52c 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_format_remb_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_format_remb_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/common_types.h"
@@ -74,13 +76,13 @@
   OverUseDetectorOptions over_use_detector_options_;
   Clock* system_clock_;
   ModuleRtpRtcpImpl* dummy_rtp_rtcp_impl_;
-  rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
+  std::unique_ptr<ReceiveStatistics> receive_statistics_;
   RTCPSender* rtcp_sender_;
   RTCPReceiver* rtcp_receiver_;
   TestTransport* test_transport_;
   test::NullTransport null_transport_;
   MockRemoteBitrateObserver remote_bitrate_observer_;
-  rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
+  std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
 };
 
 void RtcpFormatRembTest::SetUp() {
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.cc b/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.cc
index 4ad4956..5cdaa3a 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.cc
@@ -651,10 +651,10 @@
 //    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 
 // De-serialize packet.
-rtc::scoped_ptr<TransportFeedback> TransportFeedback::ParseFrom(
+std::unique_ptr<TransportFeedback> TransportFeedback::ParseFrom(
     const uint8_t* buffer,
     size_t length) {
-  rtc::scoped_ptr<TransportFeedback> packet(new TransportFeedback());
+  std::unique_ptr<TransportFeedback> packet(new TransportFeedback());
 
   if (length < kMinSizeBytes) {
     LOG(LS_WARNING) << "Buffer too small (" << length
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h b/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h
index ad6fd16..7a74d7f 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h
@@ -12,6 +12,7 @@
 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TRANSPORT_FEEDBACK_H_
 
 #include <deque>
+#include <memory>
 #include <vector>
 
 #include "webrtc/base/constructormagic.h"
@@ -58,7 +59,7 @@
   static const uint8_t kFeedbackMessageType = 15;  // TODO(sprang): IANA reg?
   static const uint8_t kPayloadType = 205;         // RTPFB, see RFC4585.
 
-  static rtc::scoped_ptr<TransportFeedback> ParseFrom(const uint8_t* buffer,
+  static std::unique_ptr<TransportFeedback> ParseFrom(const uint8_t* buffer,
                                                       size_t length);
 
  protected:
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback_unittest.cc
index 3615065..203d70f 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback_unittest.cc
@@ -11,6 +11,7 @@
 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h"
 
 #include <limits>
+#include <memory>
 
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -43,7 +44,7 @@
   void WithInput(const uint16_t received_seq[],
                  const int64_t received_ts[],
                  uint16_t length) {
-    rtc::scoped_ptr<int64_t[]> temp_deltas;
+    std::unique_ptr<int64_t[]> temp_deltas;
     if (received_ts == nullptr) {
       temp_deltas.reset(new int64_t[length]);
       GenerateDeltas(received_seq, length, temp_deltas.get());
@@ -136,7 +137,7 @@
   std::vector<int64_t> expected_deltas_;
   size_t expected_size_;
   int64_t default_delta_;
-  rtc::scoped_ptr<TransportFeedback> feedback_;
+  std::unique_ptr<TransportFeedback> feedback_;
   rtc::Buffer serialized_;
 };
 
@@ -356,7 +357,7 @@
 
 TEST(RtcpPacketTest, TransportFeedback_Limits) {
   // Sequence number wrap above 0x8000.
-  rtc::scoped_ptr<TransportFeedback> packet(new TransportFeedback());
+  std::unique_ptr<TransportFeedback> packet(new TransportFeedback());
   packet->WithBase(0, 0);
   EXPECT_TRUE(packet->WithReceivedPacket(0x8000, 1000));
 
@@ -446,7 +447,7 @@
       &mod_buffer[2], ByteReader<uint16_t>::ReadBigEndian(&mod_buffer[2]) +
                           ((kPaddingBytes + 3) / 4));
 
-  rtc::scoped_ptr<TransportFeedback> parsed_packet(
+  std::unique_ptr<TransportFeedback> parsed_packet(
       TransportFeedback::ParseFrom(mod_buffer, kExpectedSizeWithPadding));
   ASSERT_TRUE(parsed_packet.get() != nullptr);
   EXPECT_EQ(kExpectedSizeWords * 4, packet.size());  // Padding not included.
@@ -468,7 +469,7 @@
     feedback.WithReceivedPacket(deltas, deltas * 1000 + kLargeTimeDelta);
 
     rtc::Buffer serialized_packet = feedback.Build();
-    rtc::scoped_ptr<TransportFeedback> deserialized_packet =
+    std::unique_ptr<TransportFeedback> deserialized_packet =
         TransportFeedback::ParseFrom(serialized_packet.data(),
                                      serialized_packet.size());
     EXPECT_TRUE(deserialized_packet.get() != nullptr);
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h
index da578c7..9a9c73d 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h
@@ -90,7 +90,7 @@
     bool xr_dlrr_item;
     std::unique_ptr<RTCPVoIPMetric>  VoIPMetric;
 
-    rtc::scoped_ptr<rtcp::TransportFeedback> transport_feedback_;
+    std::unique_ptr<rtcp::TransportFeedback> transport_feedback_;
 
 private:
     RTC_DISALLOW_COPY_AND_ASSIGN(RTCPPacketInformation);
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc
index b48fed6..924d009 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc
@@ -8,6 +8,8 @@
  *  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"
 
@@ -145,7 +147,7 @@
   TestTransport* test_transport_;
   RTCPHelp::RTCPPacketInformation rtcp_packet_info_;
   MockRemoteBitrateObserver remote_bitrate_observer_;
-  rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
+  std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
 };
 
 
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
index 9a5d471..8817d4d 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
@@ -8,6 +8,8 @@
  *  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"
 
@@ -256,9 +258,9 @@
 
   SimulatedClock clock_;
   TestTransport test_transport_;
-  rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
-  rtc::scoped_ptr<ModuleRtpRtcpImpl> rtp_rtcp_impl_;
-  rtc::scoped_ptr<RTCPSender> rtcp_sender_;
+  std::unique_ptr<ReceiveStatistics> receive_statistics_;
+  std::unique_ptr<ModuleRtpRtcpImpl> rtp_rtcp_impl_;
+  std::unique_ptr<RTCPSender> rtcp_sender_;
 };
 
 TEST_F(RtcpSenderTest, SetRtcpStatus) {
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_utility.h b/webrtc/modules/rtp_rtcp/source/rtcp_utility.h
index 4067a40..fedd1dc 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_utility.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_utility.h
@@ -13,6 +13,8 @@
 
 #include <stddef.h> // size_t, ptrdiff_t
 
+#include <memory>
+
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h"
@@ -468,7 +470,7 @@
 
   RTCPPacketTypes _packetType;
   RTCPPacket _packet;
-  rtc::scoped_ptr<webrtc::rtcp::RtcpPacket> rtcp_packet_;
+  std::unique_ptr<webrtc::rtcp::RtcpPacket> rtcp_packet_;
 };
 
 class RTCPPacketIterator {
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
index d29e3d4..12c2db5 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc
@@ -8,11 +8,11 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <memory>
 #include <vector>
 
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/include/module_common_types.h"
 #include "webrtc/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
 #include "webrtc/modules/rtp_rtcp/source/rtp_format.h"
@@ -72,7 +72,7 @@
 void TestFua(size_t frame_size,
              size_t max_payload_size,
              const std::vector<size_t>& expected_sizes) {
-  rtc::scoped_ptr<uint8_t[]> frame;
+  std::unique_ptr<uint8_t[]> frame;
   frame.reset(new uint8_t[frame_size]);
   frame[0] = 0x05;  // F=0, NRI=0, Type=5.
   for (size_t i = 0; i < frame_size - kNalHeaderSize; ++i) {
@@ -82,11 +82,11 @@
   fragmentation.VerifyAndAllocateFragmentationHeader(1);
   fragmentation.fragmentationOffset[0] = 0;
   fragmentation.fragmentationLength[0] = frame_size;
-  rtc::scoped_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create(
+  std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create(
       kRtpVideoH264, max_payload_size, NULL, kEmptyFrame));
   packetizer->SetPayloadData(frame.get(), frame_size, &fragmentation);
 
-  rtc::scoped_ptr<uint8_t[]> packet(new uint8_t[max_payload_size]);
+  std::unique_ptr<uint8_t[]> packet(new uint8_t[max_payload_size]);
   size_t length = 0;
   bool last = false;
   size_t offset = kNalHeaderSize;
@@ -156,7 +156,7 @@
   fragmentation.VerifyAndAllocateFragmentationHeader(1);
   fragmentation.fragmentationOffset[0] = 0;
   fragmentation.fragmentationLength[0] = sizeof(frame);
-  rtc::scoped_ptr<RtpPacketizer> packetizer(
+  std::unique_ptr<RtpPacketizer> packetizer(
       RtpPacketizer::Create(kRtpVideoH264, kMaxPayloadSize, NULL, kEmptyFrame));
   packetizer->SetPayloadData(frame, sizeof(frame), &fragmentation);
   uint8_t packet[kMaxPayloadSize] = {0};
@@ -185,7 +185,7 @@
   frame[fragmentation.fragmentationOffset[0]] = 0x01;
   frame[fragmentation.fragmentationOffset[1]] = 0x01;
 
-  rtc::scoped_ptr<RtpPacketizer> packetizer(
+  std::unique_ptr<RtpPacketizer> packetizer(
       RtpPacketizer::Create(kRtpVideoH264, kMaxPayloadSize, NULL, kEmptyFrame));
   packetizer->SetPayloadData(frame, kFrameSize, &fragmentation);
 
@@ -222,7 +222,7 @@
   fragmentation.fragmentationOffset[2] = 4;
   fragmentation.fragmentationLength[2] =
       kNalHeaderSize + kFrameSize - kPayloadOffset;
-  rtc::scoped_ptr<RtpPacketizer> packetizer(
+  std::unique_ptr<RtpPacketizer> packetizer(
       RtpPacketizer::Create(kRtpVideoH264, kMaxPayloadSize, NULL, kEmptyFrame));
   packetizer->SetPayloadData(frame, kFrameSize, &fragmentation);
 
@@ -257,7 +257,7 @@
   fragmentation.fragmentationOffset[2] = 4;
   fragmentation.fragmentationLength[2] =
       kNalHeaderSize + kFrameSize - kPayloadOffset;
-  rtc::scoped_ptr<RtpPacketizer> packetizer(
+  std::unique_ptr<RtpPacketizer> packetizer(
       RtpPacketizer::Create(kRtpVideoH264, kMaxPayloadSize, NULL, kEmptyFrame));
   packetizer->SetPayloadData(frame, kFrameSize, &fragmentation);
 
@@ -305,7 +305,7 @@
       frame[nalu_offset + j] = i + j;
     }
   }
-  rtc::scoped_ptr<RtpPacketizer> packetizer(
+  std::unique_ptr<RtpPacketizer> packetizer(
       RtpPacketizer::Create(kRtpVideoH264, kMaxPayloadSize, NULL, kEmptyFrame));
   packetizer->SetPayloadData(frame, kFrameSize, &fragmentation);
 
@@ -394,7 +394,7 @@
                 ::testing::ElementsAreArray(data, length));
   }
 
-  rtc::scoped_ptr<RtpDepacketizer> depacketizer_;
+  std::unique_ptr<RtpDepacketizer> depacketizer_;
 };
 
 TEST_F(RtpDepacketizerH264Test, TestSingleNalu) {
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc
index b956447..079d964 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_vp8_unittest.cc
@@ -8,6 +8,8 @@
  *  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/modules/rtp_rtcp/source/rtp_format_vp8.h"
@@ -417,7 +419,7 @@
                 ::testing::ElementsAreArray(data, length));
   }
 
-  rtc::scoped_ptr<RtpDepacketizer> depacketizer_;
+  std::unique_ptr<RtpDepacketizer> depacketizer_;
 };
 
 TEST_F(RtpDepacketizerVp8Test, BasicHeader) {
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_vp9_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_vp9_unittest.cc
index 5bbafe4..f9514ad 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_format_vp9_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_format_vp9_unittest.cc
@@ -8,6 +8,7 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <memory>
 #include <vector>
 
 #include "testing/gmock/include/gmock/gmock.h"
@@ -76,7 +77,7 @@
                          const RTPVideoHeaderVP9& expected,
                          size_t expected_hdr_length,
                          size_t expected_length) {
-  rtc::scoped_ptr<RtpDepacketizer> depacketizer(new RtpDepacketizerVp9());
+  std::unique_ptr<RtpDepacketizer> depacketizer(new RtpDepacketizerVp9());
   RtpDepacketizer::ParsedPayload parsed;
   ASSERT_TRUE(depacketizer->Parse(&parsed, packet, expected_length));
   EXPECT_EQ(kRtpVideoVp9, parsed.type.Video.codec);
@@ -127,12 +128,12 @@
     expected_.InitRTPVideoHeaderVP9();
   }
 
-  rtc::scoped_ptr<uint8_t[]> packet_;
-  rtc::scoped_ptr<uint8_t[]> payload_;
+  std::unique_ptr<uint8_t[]> packet_;
+  std::unique_ptr<uint8_t[]> payload_;
   size_t payload_size_;
   size_t payload_pos_;
   RTPVideoHeaderVP9 expected_;
-  rtc::scoped_ptr<RtpPacketizerVp9> packetizer_;
+  std::unique_ptr<RtpPacketizerVp9> packetizer_;
 
   void Init(size_t payload_size, size_t packet_size) {
     payload_.reset(new uint8_t[payload_size]);
@@ -469,7 +470,7 @@
   }
 
   RTPVideoHeaderVP9 expected_;
-  rtc::scoped_ptr<RtpDepacketizer> depacketizer_;
+  std::unique_ptr<RtpDepacketizer> depacketizer_;
 };
 
 TEST_F(RtpDepacketizerVp9Test, ParseBasicHeader) {
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry_unittest.cc
index cbded68..5bbe97a 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_payload_registry_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_payload_registry_unittest.cc
@@ -8,11 +8,12 @@
  *  be found in the AUTHORS file in the root of the source tree.
  */
 
+#include <memory>
+
 #include "webrtc/modules/rtp_rtcp/include/rtp_payload_registry.h"
 
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
 #include "webrtc/modules/rtp_rtcp/source/byte_io.h"
 #include "webrtc/modules/rtp_rtcp/source/mock/mock_rtp_payload_strategy.h"
@@ -58,7 +59,7 @@
     return returned_payload_on_heap;
   }
 
-  rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry_;
+  std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_;
   testing::NiceMock<MockRTPPayloadStrategy>* mock_payload_strategy_;
 };
 
@@ -296,9 +297,9 @@
   uint16_t original_sequence_number = 1234;
   uint32_t original_ssrc = 500;
 
-  rtc::scoped_ptr<const uint8_t[]> packet(GenerateRtxPacket(
+  std::unique_ptr<const uint8_t[]> packet(GenerateRtxPacket(
       header_length, payload_length, original_sequence_number));
-  rtc::scoped_ptr<uint8_t[]> restored_packet(
+  std::unique_ptr<uint8_t[]> restored_packet(
       new uint8_t[header_length + payload_length]);
   size_t length = original_length;
   bool success = rtp_payload_registry->RestoreOriginalPacket(
@@ -312,7 +313,7 @@
   EXPECT_EQ(original_length - kRtxHeaderSize, length)
       << "The restored packet should be exactly kRtxHeaderSize smaller.";
 
-  rtc::scoped_ptr<RtpHeaderParser> header_parser(RtpHeaderParser::Create());
+  std::unique_ptr<RtpHeaderParser> header_parser(RtpHeaderParser::Create());
   RTPHeader restored_header;
   ASSERT_TRUE(
       header_parser->Parse(restored_packet.get(), length, &restored_header));
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h
index 7c6287c..dca1978 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_impl.h
@@ -11,6 +11,8 @@
 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_
 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_RECEIVER_IMPL_H_
 
+#include <memory>
+
 #include "webrtc/base/criticalsection.h"
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h"
@@ -75,7 +77,7 @@
 
   Clock* clock_;
   RTPPayloadRegistry* rtp_payload_registry_;
-  rtc::scoped_ptr<RTPReceiverStrategy> rtp_media_receiver_;
+  std::unique_ptr<RTPReceiverStrategy> rtp_media_receiver_;
 
   RtpFeedback* cb_rtp_feedback_;
 
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_video.cc b/webrtc/modules/rtp_rtcp/source/rtp_receiver_video.cc
index f53f55a..9d76c1a 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_video.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_video.cc
@@ -13,6 +13,8 @@
 #include <assert.h>
 #include <string.h>
 
+#include <memory>
+
 #include "webrtc/base/checks.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/trace_event.h"
@@ -74,7 +76,7 @@
   }
 
   // We are not allowed to hold a critical section when calling below functions.
-  rtc::scoped_ptr<RtpDepacketizer> depacketizer(
+  std::unique_ptr<RtpDepacketizer> depacketizer(
       RtpDepacketizer::Create(rtp_header->type.Video.codec));
   if (depacketizer.get() == NULL) {
     LOG(LS_ERROR) << "Failed to create depacketizer.";
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc
index 708b9af..7e0ac31 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc
@@ -9,6 +9,7 @@
  */
 
 #include <map>
+#include <memory>
 #include <set>
 
 #include "testing/gmock/include/gmock/gmock.h"
@@ -68,7 +69,7 @@
                size_t len,
                const PacketOptions& options) override {
     RTPHeader header;
-    rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
+    std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
     EXPECT_TRUE(parser->Parse(static_cast<const uint8_t*>(data), len, &header));
     ++rtp_packets_sent_;
     last_rtp_header_ = header;
@@ -115,10 +116,10 @@
 
   RtcpPacketTypeCounter packets_sent_;
   RtcpPacketTypeCounter packets_received_;
-  rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
+  std::unique_ptr<ReceiveStatistics> receive_statistics_;
   SendTransport transport_;
   RtcpRttStatsTestImpl rtt_stats_;
-  rtc::scoped_ptr<ModuleRtpRtcpImpl> impl_;
+  std::unique_ptr<ModuleRtpRtcpImpl> impl_;
   uint32_t remote_ssrc_;
 
   void SetRemoteSsrc(uint32_t ssrc) {
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.h b/webrtc/modules/rtp_rtcp/source/rtp_sender.h
index 99465c6..f9d5df6 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.h
@@ -13,6 +13,7 @@
 
 #include <list>
 #include <map>
+#include <memory>
 #include <utility>
 #include <vector>
 
@@ -423,8 +424,8 @@
   Bitrate total_bitrate_sent_;
 
   const bool audio_configured_;
-  const rtc::scoped_ptr<RTPSenderAudio> audio_;
-  const rtc::scoped_ptr<RTPSenderVideo> video_;
+  const std::unique_ptr<RTPSenderAudio> audio_;
+  const std::unique_ptr<RTPSenderVideo> video_;
 
   RtpPacketSender* const paced_sender_;
   TransportSequenceNumberAllocator* const transport_sequence_number_allocator_;
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
index f9dc8f1..f350eff 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc
@@ -9,12 +9,12 @@
  */
 
 #include <list>
+#include <memory>
 #include <vector>
 
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webrtc/base/buffer.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/call/mock/mock_rtc_event_log.h"
 #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h"
 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h"
@@ -148,7 +148,7 @@
   MockRtcEventLog mock_rtc_event_log_;
   MockRtpPacketSender mock_paced_sender_;
   MockTransportSequenceNumberAllocator seq_num_allocator_;
-  rtc::scoped_ptr<RTPSender> rtp_sender_;
+  std::unique_ptr<RTPSender> rtp_sender_;
   int payload_;
   LoopbackTransportTest transport_;
   const bool kMarkerBit;
@@ -202,7 +202,7 @@
     rtp_sender_video_.reset(
         new RTPSenderVideo(&fake_clock_, rtp_sender_.get()));
   }
-  rtc::scoped_ptr<RTPSenderVideo> rtp_sender_video_;
+  std::unique_ptr<RTPSenderVideo> rtp_sender_video_;
 
   void VerifyCVOPacket(uint8_t* data,
                        size_t len,
@@ -849,7 +849,7 @@
   rtp_header_len += 4;  // 4 extra bytes common to all extension headers.
 
   // Create and set up parser.
-  rtc::scoped_ptr<webrtc::RtpHeaderParser> rtp_parser(
+  std::unique_ptr<webrtc::RtpHeaderParser> rtp_parser(
       webrtc::RtpHeaderParser::Create());
   ASSERT_TRUE(rtp_parser.get() != nullptr);
   rtp_parser->RegisterRtpHeaderExtension(kRtpExtensionTransmissionTimeOffset,
@@ -968,7 +968,7 @@
   rtp_sender_->SetRtxSsrc(1234);
 
   // Create and set up parser.
-  rtc::scoped_ptr<webrtc::RtpHeaderParser> rtp_parser(
+  std::unique_ptr<webrtc::RtpHeaderParser> rtp_parser(
       webrtc::RtpHeaderParser::Create());
   ASSERT_TRUE(rtp_parser.get() != nullptr);
   rtp_parser->RegisterRtpHeaderExtension(kRtpExtensionTransmissionTimeOffset,
@@ -1402,7 +1402,7 @@
   ASSERT_EQ(0, rtp_sender_->SendOutgoingData(kEmptyFrame, payload_type,
                                              capture_time_ms + 2000, 0, nullptr,
                                              0, nullptr));
-  rtc::scoped_ptr<webrtc::RtpHeaderParser> rtp_parser(
+  std::unique_ptr<webrtc::RtpHeaderParser> rtp_parser(
       webrtc::RtpHeaderParser::Create());
   ASSERT_TRUE(rtp_parser.get() != nullptr);
   webrtc::RTPHeader rtp_header;
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
index d617f10..0bf95b7 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc
@@ -13,6 +13,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include <memory>
 #include <vector>
 
 #include "webrtc/base/checks.h"
@@ -111,7 +112,7 @@
                                           int64_t capture_time_ms,
                                           StorageType media_packet_storage,
                                           bool protect) {
-  rtc::scoped_ptr<RedPacket> red_packet;
+  std::unique_ptr<RedPacket> red_packet;
   std::vector<RedPacket*> fec_packets;
   StorageType fec_storage = kDontRetransmit;
   uint16_t next_fec_sequence_number = 0;
@@ -224,7 +225,7 @@
     return -1;
   }
 
-  rtc::scoped_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create(
+  std::unique_ptr<RtpPacketizer> packetizer(RtpPacketizer::Create(
       videoType, _rtpSender.MaxDataPayloadLength(),
       video_header ? &(video_header->codecHeader) : nullptr, frameType));
 
diff --git a/webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc b/webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc
index 67e8a65..ea2d98b 100644
--- a/webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc
+++ b/webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc
@@ -11,6 +11,7 @@
 #include "webrtc/modules/rtp_rtcp/test/testAPI/test_api.h"
 
 #include <algorithm>
+#include <memory>
 #include <vector>
 
 #include "webrtc/test/null_transport.h"
@@ -41,7 +42,7 @@
     }
   }
   RTPHeader header;
-  rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
+  std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
   if (!parser->Parse(static_cast<const uint8_t*>(data), len, &header)) {
     return false;
   }
@@ -100,9 +101,9 @@
         &fake_clock_, NULL, NULL, rtp_payload_registry_.get()));
   }
 
-  rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry_;
-  rtc::scoped_ptr<RtpReceiver> rtp_receiver_;
-  rtc::scoped_ptr<RtpRtcp> module_;
+  std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry_;
+  std::unique_ptr<RtpReceiver> rtp_receiver_;
+  std::unique_ptr<RtpRtcp> module_;
   uint32_t test_ssrc_;
   uint32_t test_timestamp_;
   uint16_t test_sequence_number_;
diff --git a/webrtc/modules/rtp_rtcp/test/testAPI/test_api_audio.cc b/webrtc/modules/rtp_rtcp/test/testAPI/test_api_audio.cc
index 9b44c4f..8069b09 100644
--- a/webrtc/modules/rtp_rtcp/test/testAPI/test_api_audio.cc
+++ b/webrtc/modules/rtp_rtcp/test/testAPI/test_api_audio.cc
@@ -9,6 +9,7 @@
  */
 
 #include <algorithm>
+#include <memory>
 #include <vector>
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -135,12 +136,12 @@
 
   RtpRtcp* module1;
   RtpRtcp* module2;
-  rtc::scoped_ptr<ReceiveStatistics> receive_statistics1_;
-  rtc::scoped_ptr<ReceiveStatistics> receive_statistics2_;
-  rtc::scoped_ptr<RtpReceiver> rtp_receiver1_;
-  rtc::scoped_ptr<RtpReceiver> rtp_receiver2_;
-  rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry1_;
-  rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry2_;
+  std::unique_ptr<ReceiveStatistics> receive_statistics1_;
+  std::unique_ptr<ReceiveStatistics> receive_statistics2_;
+  std::unique_ptr<RtpReceiver> rtp_receiver1_;
+  std::unique_ptr<RtpReceiver> rtp_receiver2_;
+  std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry1_;
+  std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry2_;
   VerifyingAudioReceiver* data_receiver1;
   VerifyingAudioReceiver* data_receiver2;
   LoopBackTransport* transport1;
diff --git a/webrtc/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc b/webrtc/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
index d4b3641..c1359df 100644
--- a/webrtc/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
+++ b/webrtc/modules/rtp_rtcp/test/testAPI/test_api_rtcp.cc
@@ -9,6 +9,7 @@
  */
 
 #include <algorithm>
+#include <memory>
 #include <vector>
 
 #include "testing/gmock/include/gmock/gmock.h"
@@ -175,14 +176,14 @@
     delete receiver;
   }
 
-  rtc::scoped_ptr<TestRtpFeedback> rtp_feedback1_;
-  rtc::scoped_ptr<TestRtpFeedback> rtp_feedback2_;
-  rtc::scoped_ptr<ReceiveStatistics> receive_statistics1_;
-  rtc::scoped_ptr<ReceiveStatistics> receive_statistics2_;
-  rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry1_;
-  rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry2_;
-  rtc::scoped_ptr<RtpReceiver> rtp_receiver1_;
-  rtc::scoped_ptr<RtpReceiver> rtp_receiver2_;
+  std::unique_ptr<TestRtpFeedback> rtp_feedback1_;
+  std::unique_ptr<TestRtpFeedback> rtp_feedback2_;
+  std::unique_ptr<ReceiveStatistics> receive_statistics1_;
+  std::unique_ptr<ReceiveStatistics> receive_statistics2_;
+  std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry1_;
+  std::unique_ptr<RTPPayloadRegistry> rtp_payload_registry2_;
+  std::unique_ptr<RtpReceiver> rtp_receiver1_;
+  std::unique_ptr<RtpReceiver> rtp_receiver2_;
   RtpRtcp* module1;
   RtpRtcp* module2;
   TestRtpReceiver* receiver;
diff --git a/webrtc/modules/rtp_rtcp/test/testAPI/test_api_video.cc b/webrtc/modules/rtp_rtcp/test/testAPI/test_api_video.cc
index 16ea540..74daba9 100644
--- a/webrtc/modules/rtp_rtcp/test/testAPI/test_api_video.cc
+++ b/webrtc/modules/rtp_rtcp/test/testAPI/test_api_video.cc
@@ -11,6 +11,7 @@
 #include <stdlib.h>
 
 #include <algorithm>
+#include <memory>
 #include <vector>
 
 #include "testing/gtest/include/gtest/gtest.h"
@@ -127,9 +128,9 @@
   }
 
   int test_id_;
-  rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
+  std::unique_ptr<ReceiveStatistics> receive_statistics_;
   RTPPayloadRegistry rtp_payload_registry_;
-  rtc::scoped_ptr<RtpReceiver> rtp_receiver_;
+  std::unique_ptr<RtpReceiver> rtp_receiver_;
   RtpRtcp* video_module_;
   LoopBackTransport* transport_;
   TestRtpReceiver* receiver_;
@@ -170,7 +171,7 @@
                                          kPadSize);
       ++seq_num;
       RTPHeader header;
-      rtc::scoped_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
+      std::unique_ptr<RtpHeaderParser> parser(RtpHeaderParser::Create());
       EXPECT_TRUE(parser->Parse(padding_packet, packet_size, &header));
       PayloadUnion payload_specific;
       EXPECT_TRUE(rtp_payload_registry_.GetPayloadSpecifics(header.payloadType,
diff --git a/webrtc/modules/rtp_rtcp/test/testFec/test_packet_masks_metrics.cc b/webrtc/modules/rtp_rtcp/test/testFec/test_packet_masks_metrics.cc
index 466214c..b7c4ef5 100644
--- a/webrtc/modules/rtp_rtcp/test/testFec/test_packet_masks_metrics.cc
+++ b/webrtc/modules/rtp_rtcp/test/testFec/test_packet_masks_metrics.cc
@@ -45,8 +45,9 @@
 
 #include <math.h>
 
+#include <memory>
+
 #include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction_internal.h"
 #include "webrtc/modules/rtp_rtcp/test/testFec/average_residual_loss_xor_codes.h"
 #include "webrtc/test/testsupport/fileutils.h"
@@ -191,7 +192,7 @@
   int RecoveredMediaPackets(int num_media_packets,
                             int num_fec_packets,
                             uint8_t* state) {
-    rtc::scoped_ptr<uint8_t[]> state_tmp(
+    std::unique_ptr<uint8_t[]> state_tmp(
         new uint8_t[num_media_packets + num_fec_packets]);
     memcpy(state_tmp.get(), state, num_media_packets + num_fec_packets);
     int num_recovered_packets = 0;
@@ -385,7 +386,7 @@
   // (which containes the code size parameters/protection length).
   void ComputeMetricsForCode(CodeType code_type,
                              int code_index) {
-    rtc::scoped_ptr<double[]> prob_weight(new double[kNumLossModels]);
+    std::unique_ptr<double[]> prob_weight(new double[kNumLossModels]);
     memset(prob_weight.get() , 0, sizeof(double) * kNumLossModels);
     MetricsFecCode metrics_code;
     SetMetricsZero(&metrics_code);
@@ -393,7 +394,7 @@
     int num_media_packets = code_params_[code_index].num_media_packets;
     int num_fec_packets = code_params_[code_index].num_fec_packets;
     int tot_num_packets = num_media_packets + num_fec_packets;
-    rtc::scoped_ptr<uint8_t[]> state(new uint8_t[tot_num_packets]);
+    std::unique_ptr<uint8_t[]> state(new uint8_t[tot_num_packets]);
     memset(state.get() , 0, tot_num_packets);
 
     int num_loss_configurations = static_cast<int>(pow(2.0f, tot_num_packets));
diff --git a/webrtc/modules/utility/include/jvm_android.h b/webrtc/modules/utility/include/jvm_android.h
index f527dff..305e7cf 100644
--- a/webrtc/modules/utility/include/jvm_android.h
+++ b/webrtc/modules/utility/include/jvm_android.h
@@ -12,6 +12,8 @@
 #define WEBRTC_MODULES_UTILITY_INCLUDE_JVM_ANDROID_H_
 
 #include <jni.h>
+
+#include <memory>
 #include <string>
 
 #include "webrtc/base/scoped_ptr.h"
@@ -76,7 +78,7 @@
   NativeRegistration(JNIEnv* jni, jclass clazz);
   ~NativeRegistration();
 
-  rtc::scoped_ptr<GlobalRef> NewObject(
+  std::unique_ptr<GlobalRef> NewObject(
       const char* name, const char* signature, ...);
 
  private:
@@ -96,7 +98,7 @@
   // Note that the class name must be one of the names in the static
   // |loaded_classes| array defined in jvm_android.cc.
   // This method must be called on the construction thread.
-  rtc::scoped_ptr<NativeRegistration> RegisterNatives(
+  std::unique_ptr<NativeRegistration> RegisterNatives(
       const char* name, const JNINativeMethod *methods, int num_methods);
 
   // Converts from Java string to std::string.
@@ -120,9 +122,9 @@
 //   webrtc::JVM::Initialize(jvm, context);
 //
 //   // Header (.h) file of example class called User.
-//   rtc::scoped_ptr<JNIEnvironment> env;
-//   rtc::scoped_ptr<NativeRegistration> reg;
-//   rtc::scoped_ptr<GlobalRef> obj;
+//   std::unique_ptr<JNIEnvironment> env;
+//   std::unique_ptr<NativeRegistration> reg;
+//   std::unique_ptr<GlobalRef> obj;
 //
 //   // Construction (in .cc file) of User class.
 //   User::User() {
@@ -156,7 +158,7 @@
   // Creates a JNIEnvironment object.
   // This method returns a NULL pointer if AttachCurrentThread() has not been
   // called successfully. Use the AttachCurrentThreadIfNeeded class if needed.
-  rtc::scoped_ptr<JNIEnvironment> environment();
+  std::unique_ptr<JNIEnvironment> environment();
 
   // Returns a JavaClass object given class |name|.
   // Note that the class name must be one of the names in the static
diff --git a/webrtc/modules/utility/include/mock/mock_process_thread.h b/webrtc/modules/utility/include/mock/mock_process_thread.h
index 9560e40..3d39307 100644
--- a/webrtc/modules/utility/include/mock/mock_process_thread.h
+++ b/webrtc/modules/utility/include/mock/mock_process_thread.h
@@ -31,7 +31,7 @@
   // MOCK_METHOD1 gets confused with mocking this method, so we work around it
   // by overriding the method from the interface and forwarding the call to a
   // mocked, simpler method.
-  void PostTask(rtc::scoped_ptr<ProcessTask> task) override {
+  void PostTask(std::unique_ptr<ProcessTask> task) override {
     PostTask(task.get());
   }
 };
diff --git a/webrtc/modules/utility/include/process_thread.h b/webrtc/modules/utility/include/process_thread.h
index 285a5ea..4d77452 100644
--- a/webrtc/modules/utility/include/process_thread.h
+++ b/webrtc/modules/utility/include/process_thread.h
@@ -11,6 +11,8 @@
 #ifndef WEBRTC_MODULES_UTILITY_INCLUDE_PROCESS_THREAD_H_
 #define WEBRTC_MODULES_UTILITY_INCLUDE_PROCESS_THREAD_H_
 
+#include <memory>
+
 #include "webrtc/typedefs.h"
 #include "webrtc/base/scoped_ptr.h"
 
@@ -29,7 +31,7 @@
  public:
   virtual ~ProcessThread();
 
-  static rtc::scoped_ptr<ProcessThread> Create(const char* thread_name);
+  static std::unique_ptr<ProcessThread> Create(const char* thread_name);
 
   // Starts the worker thread.  Must be called from the construction thread.
   virtual void Start() = 0;
@@ -50,7 +52,7 @@
   // construction thread of the ProcessThread instance, if the task did not
   // get a chance to run (e.g. posting the task while shutting down or when
   // the thread never runs).
-  virtual void PostTask(rtc::scoped_ptr<ProcessTask> task) = 0;
+  virtual void PostTask(std::unique_ptr<ProcessTask> task) = 0;
 
   // Adds a module that will start to receive callbacks on the worker thread.
   // Can be called from any thread.
diff --git a/webrtc/modules/utility/source/jvm_android.cc b/webrtc/modules/utility/source/jvm_android.cc
index eb37fda..d53d1b5 100644
--- a/webrtc/modules/utility/source/jvm_android.cc
+++ b/webrtc/modules/utility/source/jvm_android.cc
@@ -10,6 +10,8 @@
 
 #include <android/log.h>
 
+#include <memory>
+
 #include "webrtc/modules/utility/include/jvm_android.h"
 
 #include "webrtc/base/checks.h"
@@ -139,7 +141,7 @@
   CHECK_EXCEPTION(jni_) << "Error during UnregisterNatives";
 }
 
-rtc::scoped_ptr<GlobalRef> NativeRegistration::NewObject(
+std::unique_ptr<GlobalRef> NativeRegistration::NewObject(
     const char* name, const char* signature, ...) {
   ALOGD("NativeRegistration::NewObject%s", GetThreadInfo().c_str());
   va_list args;
@@ -149,7 +151,7 @@
                                  args);
   CHECK_EXCEPTION(jni_) << "Error during NewObjectV";
   va_end(args);
-  return rtc::scoped_ptr<GlobalRef>(new GlobalRef(jni_, obj));
+  return std::unique_ptr<GlobalRef>(new GlobalRef(jni_, obj));
 }
 
 // JavaClass implementation.
@@ -181,14 +183,14 @@
   RTC_DCHECK(thread_checker_.CalledOnValidThread());
 }
 
-rtc::scoped_ptr<NativeRegistration> JNIEnvironment::RegisterNatives(
+std::unique_ptr<NativeRegistration> JNIEnvironment::RegisterNatives(
     const char* name, const JNINativeMethod *methods, int num_methods) {
   ALOGD("JNIEnvironment::RegisterNatives(%s)", name);
   RTC_DCHECK(thread_checker_.CalledOnValidThread());
   jclass clazz = LookUpClass(name);
   jni_->RegisterNatives(clazz, methods, num_methods);
   CHECK_EXCEPTION(jni_) << "Error during RegisterNatives";
-  return rtc::scoped_ptr<NativeRegistration>(
+  return std::unique_ptr<NativeRegistration>(
       new NativeRegistration(jni_, clazz));
 }
 
@@ -240,7 +242,7 @@
   DeleteGlobalRef(jni(), context_);
 }
 
-rtc::scoped_ptr<JNIEnvironment> JVM::environment() {
+std::unique_ptr<JNIEnvironment> JVM::environment() {
   ALOGD("JVM::environment%s", GetThreadInfo().c_str());
   // The JNIEnv is used for thread-local storage. For this reason, we cannot
   // share a JNIEnv between threads. If a piece of code has no other way to get
@@ -250,9 +252,9 @@
   JNIEnv* jni = GetEnv(jvm_);
   if (!jni) {
     ALOGE("AttachCurrentThread() has not been called on this thread.");
-    return rtc::scoped_ptr<JNIEnvironment>();
+    return std::unique_ptr<JNIEnvironment>();
   }
-  return rtc::scoped_ptr<JNIEnvironment>(new JNIEnvironment(jni));
+  return std::unique_ptr<JNIEnvironment>(new JNIEnvironment(jni));
 }
 
 JavaClass JVM::GetClass(const char* name) {
diff --git a/webrtc/modules/utility/source/process_thread_impl.cc b/webrtc/modules/utility/source/process_thread_impl.cc
index 8cdf016..68c7ab6 100644
--- a/webrtc/modules/utility/source/process_thread_impl.cc
+++ b/webrtc/modules/utility/source/process_thread_impl.cc
@@ -36,9 +36,9 @@
 ProcessThread::~ProcessThread() {}
 
 // static
-rtc::scoped_ptr<ProcessThread> ProcessThread::Create(
+std::unique_ptr<ProcessThread> ProcessThread::Create(
     const char* thread_name) {
-  return rtc::scoped_ptr<ProcessThread>(new ProcessThreadImpl(thread_name));
+  return std::unique_ptr<ProcessThread>(new ProcessThreadImpl(thread_name));
 }
 
 ProcessThreadImpl::ProcessThreadImpl(const char* thread_name)
@@ -119,7 +119,7 @@
   wake_up_->Set();
 }
 
-void ProcessThreadImpl::PostTask(rtc::scoped_ptr<ProcessTask> task) {
+void ProcessThreadImpl::PostTask(std::unique_ptr<ProcessTask> task) {
   // Allowed to be called on any thread.
   {
     rtc::CritScope lock(&lock_);
diff --git a/webrtc/modules/utility/source/process_thread_impl.h b/webrtc/modules/utility/source/process_thread_impl.h
index 2855ed9..330aec9 100644
--- a/webrtc/modules/utility/source/process_thread_impl.h
+++ b/webrtc/modules/utility/source/process_thread_impl.h
@@ -33,7 +33,7 @@
   void Stop() override;
 
   void WakeUp(Module* module) override;
-  void PostTask(rtc::scoped_ptr<ProcessTask> task) override;
+  void PostTask(std::unique_ptr<ProcessTask> task) override;
 
   void RegisterModule(Module* module) override;
   void DeRegisterModule(Module* module) override;
diff --git a/webrtc/modules/video_coding/jitter_buffer_unittest.cc b/webrtc/modules/video_coding/jitter_buffer_unittest.cc
index df70ea9..eb7d78b 100644
--- a/webrtc/modules/video_coding/jitter_buffer_unittest.cc
+++ b/webrtc/modules/video_coding/jitter_buffer_unittest.cc
@@ -195,7 +195,7 @@
   MOCK_METHOD1(WakeUp, void(Module* module));
   MOCK_METHOD1(RegisterModule, void(Module* module));
   MOCK_METHOD1(DeRegisterModule, void(Module* module));
-  void PostTask(rtc::scoped_ptr<ProcessTask> task) {}
+  void PostTask(std::unique_ptr<ProcessTask> task) {}
 };
 
 class TestBasicJitterBuffer : public ::testing::TestWithParam<std::string>,
diff --git a/webrtc/modules/video_coding/packet_buffer.h b/webrtc/modules/video_coding/packet_buffer.h
index caa81f6..75049b3 100644
--- a/webrtc/modules/video_coding/packet_buffer.h
+++ b/webrtc/modules/video_coding/packet_buffer.h
@@ -14,6 +14,7 @@
 #include <array>
 #include <vector>
 #include <map>
+#include <memory>
 #include <set>
 #include <queue>
 
diff --git a/webrtc/modules/video_coding/packet_buffer_unittest.cc b/webrtc/modules/video_coding/packet_buffer_unittest.cc
index 28c62c2..eb0a03b 100644
--- a/webrtc/modules/video_coding/packet_buffer_unittest.cc
+++ b/webrtc/modules/video_coding/packet_buffer_unittest.cc
@@ -10,6 +10,7 @@
 
 #include <cstring>
 #include <limits>
+#include <memory>
 
 #include "webrtc/modules/video_coding/frame_object.h"
 #include "webrtc/modules/video_coding/packet_buffer.h"
diff --git a/webrtc/modules/video_processing/util/noise_estimation.h b/webrtc/modules/video_processing/util/noise_estimation.h
index 5299b31..fa5b522 100644
--- a/webrtc/modules/video_processing/util/noise_estimation.h
+++ b/webrtc/modules/video_processing/util/noise_estimation.h
@@ -11,6 +11,8 @@
 #ifndef WEBRTC_MODULES_VIDEO_PROCESSING_UTIL_NOISE_ESTIMATION_H_
 #define WEBRTC_MODULES_VIDEO_PROCESSING_UTIL_NOISE_ESTIMATION_H_
 
+#include <memory>
+
 #include "webrtc/base/scoped_ptr.h"
 #include "webrtc/modules/include/module_common_types.h"
 #include "webrtc/modules/video_processing/include/video_processing_defines.h"