diff --git a/webrtc/call/bitrate_allocator.h b/webrtc/call/bitrate_allocator.h index 25ca735585..404a312dad 100644 --- a/webrtc/call/bitrate_allocator.h +++ b/webrtc/call/bitrate_allocator.h @@ -11,12 +11,13 @@ #ifndef WEBRTC_CALL_BITRATE_ALLOCATOR_H_ #define WEBRTC_CALL_BITRATE_ALLOCATOR_H_ +#include + #include #include #include #include "webrtc/base/criticalsection.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/base/thread_annotations.h" namespace webrtc { diff --git a/webrtc/call/bitrate_allocator_unittest.cc b/webrtc/call/bitrate_allocator_unittest.cc index fc4f1702bb..6e0cdd4d78 100644 --- a/webrtc/call/bitrate_allocator_unittest.cc +++ b/webrtc/call/bitrate_allocator_unittest.cc @@ -9,6 +9,7 @@ */ #include +#include #include #include "testing/gtest/include/gtest/gtest.h" @@ -41,7 +42,7 @@ class BitrateAllocatorTest : public ::testing::Test { } ~BitrateAllocatorTest() {} - rtc::scoped_ptr allocator_; + std::unique_ptr allocator_; }; TEST_F(BitrateAllocatorTest, UpdatingBitrateObserver) { @@ -105,7 +106,7 @@ class BitrateAllocatorTestNoEnforceMin : public ::testing::Test { } ~BitrateAllocatorTestNoEnforceMin() {} - rtc::scoped_ptr allocator_; + std::unique_ptr allocator_; }; // The following three tests verify that the EnforceMinBitrate() method works diff --git a/webrtc/call/bitrate_estimator_tests.cc b/webrtc/call/bitrate_estimator_tests.cc index f3bef73b6e..c63d45dc6e 100644 --- a/webrtc/call/bitrate_estimator_tests.cc +++ b/webrtc/call/bitrate_estimator_tests.cc @@ -9,6 +9,7 @@ */ #include #include +#include #include #include "testing/gtest/include/gtest/gtest.h" @@ -17,7 +18,6 @@ #include "webrtc/base/checks.h" #include "webrtc/base/event.h" #include "webrtc/base/logging.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/base/thread_annotations.h" #include "webrtc/call.h" #include "webrtc/system_wrappers/include/critical_section_wrapper.h" @@ -243,17 +243,17 @@ class BitrateEstimatorTest : public test::CallTest { VideoSendStream* send_stream_; AudioReceiveStream* audio_receive_stream_; VideoReceiveStream* video_receive_stream_; - rtc::scoped_ptr frame_generator_capturer_; + std::unique_ptr frame_generator_capturer_; test::FakeEncoder fake_encoder_; test::FakeDecoder fake_decoder_; }; testing::NiceMock mock_voice_engine_; LogObserver receiver_log_; - rtc::scoped_ptr send_transport_; - rtc::scoped_ptr receive_transport_; - rtc::scoped_ptr sender_call_; - rtc::scoped_ptr receiver_call_; + std::unique_ptr send_transport_; + std::unique_ptr receive_transport_; + std::unique_ptr sender_call_; + std::unique_ptr receiver_call_; VideoReceiveStream::Config receive_config_; std::vector streams_; }; diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc index 2dfb13a2e6..3fd7a931d0 100644 --- a/webrtc/call/call.cc +++ b/webrtc/call/call.cc @@ -11,6 +11,7 @@ #include #include +#include #include #include "webrtc/audio/audio_receive_stream.h" @@ -19,7 +20,6 @@ #include "webrtc/audio/scoped_voe_interface.h" #include "webrtc/base/checks.h" #include "webrtc/base/logging.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/base/thread_annotations.h" #include "webrtc/base/thread_checker.h" #include "webrtc/base/trace_event.h" @@ -120,16 +120,16 @@ class Call : public webrtc::Call, public PacketReceiver, Clock* const clock_; const int num_cpu_cores_; - const rtc::scoped_ptr module_process_thread_; - const rtc::scoped_ptr pacer_thread_; - const rtc::scoped_ptr call_stats_; - const rtc::scoped_ptr bitrate_allocator_; + const std::unique_ptr module_process_thread_; + const std::unique_ptr pacer_thread_; + const std::unique_ptr call_stats_; + const std::unique_ptr bitrate_allocator_; Call::Config config_; rtc::ThreadChecker configuration_thread_checker_; bool network_enabled_; - rtc::scoped_ptr receive_crit_; + std::unique_ptr receive_crit_; // Audio and Video receive streams are owned by the client that creates them. std::map audio_receive_ssrcs_ GUARDED_BY(receive_crit_); @@ -140,7 +140,7 @@ class Call : public webrtc::Call, public PacketReceiver, std::map sync_stream_mapping_ GUARDED_BY(receive_crit_); - rtc::scoped_ptr send_crit_; + std::unique_ptr send_crit_; // Audio and Video send streams are owned by the client that creates them. std::map audio_send_ssrcs_ GUARDED_BY(send_crit_); std::map video_send_ssrcs_ GUARDED_BY(send_crit_); @@ -168,7 +168,7 @@ class Call : public webrtc::Call, public PacketReceiver, int64_t num_bitrate_updates_ GUARDED_BY(&bitrate_crit_); VieRemb remb_; - const rtc::scoped_ptr congestion_controller_; + const std::unique_ptr congestion_controller_; RTC_DISALLOW_COPY_AND_ASSIGN(Call); }; @@ -183,8 +183,9 @@ namespace internal { Call::Call(const Call::Config& config) : clock_(Clock::GetRealTimeClock()), num_cpu_cores_(CpuInfo::DetectNumberOfCores()), - module_process_thread_(ProcessThread::Create("ModuleProcessThread")), - pacer_thread_(ProcessThread::Create("PacerThread")), + module_process_thread_( + rtc::ScopedToUnique(ProcessThread::Create("ModuleProcessThread"))), + pacer_thread_(rtc::ScopedToUnique(ProcessThread::Create("PacerThread"))), call_stats_(new CallStats(clock_)), bitrate_allocator_(new BitrateAllocator()), config_(config), diff --git a/webrtc/call/call_perf_tests.cc b/webrtc/call/call_perf_tests.cc index 98e77977e9..4361872209 100644 --- a/webrtc/call/call_perf_tests.cc +++ b/webrtc/call/call_perf_tests.cc @@ -8,13 +8,13 @@ * be found in the AUTHORS file in the root of the source tree. */ #include +#include #include #include #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/base/checks.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/base/thread_annotations.h" #include "webrtc/call.h" #include "webrtc/call/transport_adapter.h" @@ -235,7 +235,7 @@ void CallPerfTest::TestAudioVideoSync(FecMode fec, private: int channel_; VoENetwork* voe_network_; - rtc::scoped_ptr parser_; + std::unique_ptr parser_; }; VoiceEngine* voice_engine = VoiceEngine::Create(); diff --git a/webrtc/call/call_unittest.cc b/webrtc/call/call_unittest.cc index 75c8238a5b..0da91a9bf7 100644 --- a/webrtc/call/call_unittest.cc +++ b/webrtc/call/call_unittest.cc @@ -9,6 +9,7 @@ */ #include +#include #include "testing/gtest/include/gtest/gtest.h" @@ -31,7 +32,7 @@ struct CallHelper { private: testing::NiceMock voice_engine_; - rtc::scoped_ptr call_; + std::unique_ptr call_; }; } // namespace diff --git a/webrtc/call/packet_injection_tests.cc b/webrtc/call/packet_injection_tests.cc index 277cd3e4df..1d52b884e9 100644 --- a/webrtc/call/packet_injection_tests.cc +++ b/webrtc/call/packet_injection_tests.cc @@ -8,6 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include + #include "testing/gtest/include/gtest/gtest.h" #include "webrtc/test/call_test.h" @@ -29,7 +31,7 @@ class PacketInjectionTest : public test::CallTest { const uint8_t* packet, size_t length); - rtc::scoped_ptr rtp_header_parser_; + std::unique_ptr rtp_header_parser_; }; void PacketInjectionTest::InjectIncorrectPacket(CodecType codec_type, diff --git a/webrtc/call/rampup_tests.h b/webrtc/call/rampup_tests.h index 31a0a0296e..fa73c63f9a 100644 --- a/webrtc/call/rampup_tests.h +++ b/webrtc/call/rampup_tests.h @@ -16,7 +16,6 @@ #include #include "webrtc/base/event.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/call.h" #include "webrtc/test/call_test.h" diff --git a/webrtc/call/rtc_event_log.cc b/webrtc/call/rtc_event_log.cc index 361db81c06..ce4d6ef39f 100644 --- a/webrtc/call/rtc_event_log.cc +++ b/webrtc/call/rtc_event_log.cc @@ -105,8 +105,8 @@ class RtcEventLogImpl final : public RtcEventLog { EXCLUSIVE_LOCKS_REQUIRED(crit_); rtc::CriticalSection crit_; - rtc::scoped_ptr file_ GUARDED_BY(crit_) = - rtc::scoped_ptr(FileWrapper::Create()); + std::unique_ptr file_ GUARDED_BY(crit_) = + std::unique_ptr(FileWrapper::Create()); rtc::PlatformFile platform_file_ GUARDED_BY(crit_) = rtc::kInvalidPlatformFileValue; rtclog::EventStream stream_ GUARDED_BY(crit_); @@ -501,7 +501,7 @@ bool RtcEventLog::ParseRtcEventLog(const std::string& file_name, rtclog::EventStream* result) { char tmp_buffer[1024]; int bytes_read = 0; - rtc::scoped_ptr dump_file(FileWrapper::Create()); + std::unique_ptr dump_file(FileWrapper::Create()); if (dump_file->OpenFile(file_name.c_str(), true) != 0) { return false; } @@ -516,8 +516,8 @@ bool RtcEventLog::ParseRtcEventLog(const std::string& file_name, #endif // ENABLE_RTC_EVENT_LOG // RtcEventLog member functions. -rtc::scoped_ptr RtcEventLog::Create() { - return rtc::scoped_ptr(new RtcEventLogImpl()); +std::unique_ptr RtcEventLog::Create() { + return std::unique_ptr(new RtcEventLogImpl()); } } // namespace webrtc diff --git a/webrtc/call/rtc_event_log.h b/webrtc/call/rtc_event_log.h index 027f6867c6..518308bf2d 100644 --- a/webrtc/call/rtc_event_log.h +++ b/webrtc/call/rtc_event_log.h @@ -11,10 +11,10 @@ #ifndef WEBRTC_CALL_RTC_EVENT_LOG_H_ #define WEBRTC_CALL_RTC_EVENT_LOG_H_ +#include #include #include "webrtc/base/platform_file.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/video_receive_stream.h" #include "webrtc/video_send_stream.h" @@ -36,7 +36,7 @@ class RtcEventLog { public: virtual ~RtcEventLog() {} - static rtc::scoped_ptr Create(); + static std::unique_ptr Create(); // Sets the time that events are stored in the internal event buffer // before the user calls StartLogging. The default is 10 000 000 us = 10 s diff --git a/webrtc/call/rtc_event_log2rtp_dump.cc b/webrtc/call/rtc_event_log2rtp_dump.cc index 8357d4856a..ef0be9a1b7 100644 --- a/webrtc/call/rtc_event_log2rtp_dump.cc +++ b/webrtc/call/rtc_event_log2rtp_dump.cc @@ -9,12 +9,12 @@ */ #include +#include #include #include #include "gflags/gflags.h" #include "webrtc/base/checks.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/call/rtc_event_log.h" #include "webrtc/modules/rtp_rtcp/source/byte_io.h" #include "webrtc/test/rtp_file_writer.h" @@ -100,7 +100,7 @@ int main(int argc, char* argv[]) { return -1; } - rtc::scoped_ptr rtp_writer( + std::unique_ptr rtp_writer( webrtc::test::RtpFileWriter::Create( webrtc::test::RtpFileWriter::FileFormat::kRtpDump, output_file)); diff --git a/webrtc/call/rtc_event_log_unittest.cc b/webrtc/call/rtc_event_log_unittest.cc index b86a688567..3039c8babb 100644 --- a/webrtc/call/rtc_event_log_unittest.cc +++ b/webrtc/call/rtc_event_log_unittest.cc @@ -10,6 +10,7 @@ #ifdef ENABLE_RTC_EVENT_LOG +#include #include #include #include @@ -18,7 +19,6 @@ #include "webrtc/base/buffer.h" #include "webrtc/base/checks.h" #include "webrtc/base/random.h" -#include "webrtc/base/scoped_ptr.h" #include "webrtc/base/thread.h" #include "webrtc/call.h" #include "webrtc/call/rtc_event_log.h" @@ -473,7 +473,7 @@ void LogSessionAndReadBack(size_t rtp_count, // When log_dumper goes out of scope, it causes the log file to be flushed // to disk. { - rtc::scoped_ptr log_dumper(RtcEventLog::Create()); + std::unique_ptr log_dumper(RtcEventLog::Create()); log_dumper->LogVideoReceiveStreamConfig(receiver_config); log_dumper->LogVideoSendStreamConfig(sender_config); size_t rtcp_index = 1; @@ -639,7 +639,7 @@ void DropOldEvents(uint32_t extensions_bitvector, // The log file will be flushed to disk when the log_dumper goes out of scope. { - rtc::scoped_ptr log_dumper(RtcEventLog::Create()); + std::unique_ptr log_dumper(RtcEventLog::Create()); // Reduce the time old events are stored to 50 ms. log_dumper->SetBufferDuration(50000); log_dumper->LogVideoReceiveStreamConfig(receiver_config); diff --git a/webrtc/voice_engine/channel_manager.cc b/webrtc/voice_engine/channel_manager.cc index 96f6d2b2ee..eac2e50919 100644 --- a/webrtc/voice_engine/channel_manager.cc +++ b/webrtc/voice_engine/channel_manager.cc @@ -49,7 +49,7 @@ ChannelManager::ChannelManager(uint32_t instance_id, const Config& config) : instance_id_(instance_id), last_channel_id_(-1), config_(config), - event_log_(rtc::ScopedToUnique(RtcEventLog::Create())) {} + event_log_(RtcEventLog::Create()) {} ChannelOwner ChannelManager::CreateChannel() { return CreateChannelInternal(config_);