diff options
author | hubbe <hubbe@chromium.org> | 2015-04-29 16:25:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-29 23:26:28 +0000 |
commit | d9acbbebb5b391d6d190f9e2a1629f48f0fe11a0 (patch) | |
tree | e12c15d9d94f8099ce2b5a172fafcf36b0ce5e6b /media | |
parent | c73fce65a5963c8013e8a0a2b0251ba7c02bfccc (diff) | |
download | chromium_src-d9acbbebb5b391d6d190f9e2a1629f48f0fe11a0.zip chromium_src-d9acbbebb5b391d6d190f9e2a1629f48f0fe11a0.tar.gz chromium_src-d9acbbebb5b391d6d190f9e2a1629f48f0fe11a0.tar.bz2 |
Cast: Change override to final wherever possible.
Should provide a modest speedup.
Review URL: https://codereview.chromium.org/1112803005
Cr-Commit-Position: refs/heads/master@{#327612}
Diffstat (limited to 'media')
58 files changed, 245 insertions, 245 deletions
diff --git a/media/cast/cast_environment.h b/media/cast/cast_environment.h index d3c9474..83b5ce3 100644 --- a/media/cast/cast_environment.h +++ b/media/cast/cast_environment.h @@ -71,7 +71,7 @@ class CastEnvironment : public base::RefCountedThreadSafe<CastEnvironment> { protected: virtual ~CastEnvironment(); - // Subclasses may override these. + // Subclasses may final these. scoped_refptr<base::SingleThreadTaskRunner> main_thread_proxy_; scoped_refptr<base::SingleThreadTaskRunner> audio_thread_proxy_; scoped_refptr<base::SingleThreadTaskRunner> video_thread_proxy_; diff --git a/media/cast/cast_sender_impl.cc b/media/cast/cast_sender_impl.cc index 23e8a23..9c6266c 100644 --- a/media/cast/cast_sender_impl.cc +++ b/media/cast/cast_sender_impl.cc @@ -27,7 +27,7 @@ class LocalVideoFrameInput : public VideoFrameInput { video_sender->CreateVideoFrameFactory().release() : nullptr) {} void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, - const base::TimeTicks& capture_time) override { + const base::TimeTicks& capture_time) final { cast_environment_->PostTask(CastEnvironment::MAIN, FROM_HERE, base::Bind(&VideoSender::InsertRawVideoFrame, @@ -38,17 +38,17 @@ class LocalVideoFrameInput : public VideoFrameInput { scoped_refptr<VideoFrame> MaybeCreateOptimizedFrame( const gfx::Size& frame_size, - base::TimeDelta timestamp) override { + base::TimeDelta timestamp) final { return video_frame_factory_ ? video_frame_factory_->MaybeCreateFrame(frame_size, timestamp) : nullptr; } - bool CanCreateOptimizedFrames() const override { + bool CanCreateOptimizedFrames() const final { return video_frame_factory_.get() != nullptr; } protected: - ~LocalVideoFrameInput() override {} + ~LocalVideoFrameInput() final {} private: friend class base::RefCountedThreadSafe<LocalVideoFrameInput>; @@ -69,7 +69,7 @@ class LocalAudioFrameInput : public AudioFrameInput { : cast_environment_(cast_environment), audio_sender_(audio_sender) {} void InsertAudio(scoped_ptr<AudioBus> audio_bus, - const base::TimeTicks& recorded_time) override { + const base::TimeTicks& recorded_time) final { cast_environment_->PostTask(CastEnvironment::MAIN, FROM_HERE, base::Bind(&AudioSender::InsertAudio, @@ -79,7 +79,7 @@ class LocalAudioFrameInput : public AudioFrameInput { } protected: - ~LocalAudioFrameInput() override {} + ~LocalAudioFrameInput() final {} private: friend class base::RefCountedThreadSafe<LocalAudioFrameInput>; diff --git a/media/cast/cast_sender_impl.h b/media/cast/cast_sender_impl.h index 3a3a247..341bcbc 100644 --- a/media/cast/cast_sender_impl.h +++ b/media/cast/cast_sender_impl.h @@ -28,20 +28,20 @@ class CastSenderImpl : public CastSender { CastTransportSender* const transport_sender); void InitializeAudio(const AudioSenderConfig& audio_config, - const StatusChangeCallback& status_change_cb) override; + const StatusChangeCallback& status_change_cb) final; void InitializeVideo( const VideoSenderConfig& video_config, const StatusChangeCallback& status_change_cb, const CreateVideoEncodeAcceleratorCallback& create_vea_cb, const CreateVideoEncodeMemoryCallback& create_video_encode_mem_cb) - override; + final; - void SetTargetPlayoutDelay(base::TimeDelta new_target_playout_delay) override; + void SetTargetPlayoutDelay(base::TimeDelta new_target_playout_delay) final; - ~CastSenderImpl() override; + ~CastSenderImpl() final; - scoped_refptr<AudioFrameInput> audio_frame_input() override; - scoped_refptr<VideoFrameInput> video_frame_input() override; + scoped_refptr<AudioFrameInput> audio_frame_input() final; + scoped_refptr<VideoFrameInput> video_frame_input() final; private: void ReceivedPacket(scoped_ptr<Packet> packet); diff --git a/media/cast/logging/encoding_event_subscriber.h b/media/cast/logging/encoding_event_subscriber.h index a67e5bc..f72fe33 100644 --- a/media/cast/logging/encoding_event_subscriber.h +++ b/media/cast/logging/encoding_event_subscriber.h @@ -49,11 +49,11 @@ class EncodingEventSubscriber : public RawEventSubscriber { // timestamp). EncodingEventSubscriber(EventMediaType event_media_type, size_t max_frames); - ~EncodingEventSubscriber() override; + ~EncodingEventSubscriber() final; // RawReventSubscriber implementations. - void OnReceiveFrameEvent(const FrameEvent& frame_event) override; - void OnReceivePacketEvent(const PacketEvent& packet_event) override; + void OnReceiveFrameEvent(const FrameEvent& frame_event) final; + void OnReceivePacketEvent(const PacketEvent& packet_event) final; // Assigns frame events and packet events received so far to |frame_events| // and |packet_events| and resets the internal state. diff --git a/media/cast/logging/receiver_time_offset_estimator_impl.h b/media/cast/logging/receiver_time_offset_estimator_impl.h index bc5348b..c2b6455 100644 --- a/media/cast/logging/receiver_time_offset_estimator_impl.h +++ b/media/cast/logging/receiver_time_offset_estimator_impl.h @@ -36,15 +36,15 @@ class ReceiverTimeOffsetEstimatorImpl : public ReceiverTimeOffsetEstimator { public: ReceiverTimeOffsetEstimatorImpl(); - ~ReceiverTimeOffsetEstimatorImpl() override; + ~ReceiverTimeOffsetEstimatorImpl() final; // RawEventSubscriber implementations. - void OnReceiveFrameEvent(const FrameEvent& frame_event) override; - void OnReceivePacketEvent(const PacketEvent& packet_event) override; + void OnReceiveFrameEvent(const FrameEvent& frame_event) final; + void OnReceivePacketEvent(const PacketEvent& packet_event) final; // ReceiverTimeOffsetEstimator implementation. bool GetReceiverOffsetBounds(base::TimeDelta* lower_bound, - base::TimeDelta* upper_bound) override; + base::TimeDelta* upper_bound) final; private: // This helper uses the difference between sent and recived event diff --git a/media/cast/logging/simple_event_subscriber.h b/media/cast/logging/simple_event_subscriber.h index 176ab8c..1bdce45 100644 --- a/media/cast/logging/simple_event_subscriber.h +++ b/media/cast/logging/simple_event_subscriber.h @@ -22,11 +22,11 @@ class SimpleEventSubscriber : public RawEventSubscriber { public: SimpleEventSubscriber(); - ~SimpleEventSubscriber() override; + ~SimpleEventSubscriber() final; // RawEventSubscriber implementations. - void OnReceiveFrameEvent(const FrameEvent& frame_event) override; - void OnReceivePacketEvent(const PacketEvent& packet_event) override; + void OnReceiveFrameEvent(const FrameEvent& frame_event) final; + void OnReceivePacketEvent(const PacketEvent& packet_event) final; // Assigns frame events received so far to |frame_events| and clears them // from this object. diff --git a/media/cast/logging/stats_event_subscriber.h b/media/cast/logging/stats_event_subscriber.h index 8c50669..36d5110 100644 --- a/media/cast/logging/stats_event_subscriber.h +++ b/media/cast/logging/stats_event_subscriber.h @@ -32,11 +32,11 @@ class StatsEventSubscriber : public RawEventSubscriber { base::TickClock* clock, ReceiverTimeOffsetEstimator* offset_estimator); - ~StatsEventSubscriber() override; + ~StatsEventSubscriber() final; // RawReventSubscriber implementations. - void OnReceiveFrameEvent(const FrameEvent& frame_event) override; - void OnReceivePacketEvent(const PacketEvent& packet_event) override; + void OnReceiveFrameEvent(const FrameEvent& frame_event) final; + void OnReceivePacketEvent(const PacketEvent& packet_event) final; // Returns stats as a DictionaryValue. The dictionary contains one entry - // "audio" or "video" pointing to an inner dictionary. diff --git a/media/cast/net/cast_transport_sender_impl.h b/media/cast/net/cast_transport_sender_impl.h index 3c129e2..51051ad 100644 --- a/media/cast/net/cast_transport_sender_impl.h +++ b/media/cast/net/cast_transport_sender_impl.h @@ -84,30 +84,30 @@ class CastTransportSenderImpl : public CastTransportSender { const PacketReceiverCallback& packet_callback, PacketSender* external_transport); - ~CastTransportSenderImpl() override; + ~CastTransportSenderImpl() final; // CastTransportSender implementation. void InitializeAudio(const CastTransportRtpConfig& config, const RtcpCastMessageCallback& cast_message_cb, - const RtcpRttCallback& rtt_cb) override; + const RtcpRttCallback& rtt_cb) final; void InitializeVideo(const CastTransportRtpConfig& config, const RtcpCastMessageCallback& cast_message_cb, - const RtcpRttCallback& rtt_cb) override; - void InsertFrame(uint32 ssrc, const EncodedFrame& frame) override; + const RtcpRttCallback& rtt_cb) final; + void InsertFrame(uint32 ssrc, const EncodedFrame& frame) final; void SendSenderReport(uint32 ssrc, base::TimeTicks current_time, - uint32 current_time_as_rtp_timestamp) override; + uint32 current_time_as_rtp_timestamp) final; void CancelSendingFrames(uint32 ssrc, - const std::vector<uint32>& frame_ids) override; + const std::vector<uint32>& frame_ids) final; - void ResendFrameForKickstart(uint32 ssrc, uint32 frame_id) override; + void ResendFrameForKickstart(uint32 ssrc, uint32 frame_id) final; - PacketReceiverCallback PacketReceiverForTesting() override; + PacketReceiverCallback PacketReceiverForTesting() final; // CastTransportReceiver implementation. - void AddValidSsrc(uint32 ssrc) override; + void AddValidSsrc(uint32 ssrc) final; void SendRtcpFromRtpReceiver( uint32 ssrc, @@ -116,7 +116,7 @@ class CastTransportSenderImpl : public CastTransportSender { const RtcpCastMessage* cast_message, base::TimeDelta target_delay, const ReceiverRtcpEventSubscriber::RtcpEvents* rtcp_events, - const RtpReceiverStatistics* rtp_receiver_statistics) override; + const RtpReceiverStatistics* rtp_receiver_statistics) final; private: FRIEND_TEST_ALL_PREFIXES(CastTransportSenderImplTest, NacksCancelRetransmits); diff --git a/media/cast/net/cast_transport_sender_impl_unittest.cc b/media/cast/net/cast_transport_sender_impl_unittest.cc index e841868..921bddf 100644 --- a/media/cast/net/cast_transport_sender_impl_unittest.cc +++ b/media/cast/net/cast_transport_sender_impl_unittest.cc @@ -31,7 +31,7 @@ class FakePacketSender : public PacketSender { FakePacketSender() : paused_(false), packets_sent_(0), bytes_sent_(0) {} - bool SendPacket(PacketRef packet, const base::Closure& cb) override { + bool SendPacket(PacketRef packet, const base::Closure& cb) final { if (paused_) { stored_packet_ = packet; callback_ = cb; @@ -42,7 +42,7 @@ class FakePacketSender : public PacketSender { return true; } - int64 GetBytesSent() override { return bytes_sent_; } + int64 GetBytesSent() final { return bytes_sent_; } void SetPaused(bool paused) { paused_ = paused; diff --git a/media/cast/net/pacing/paced_sender.h b/media/cast/net/pacing/paced_sender.h index 71349c0..122cf55 100644 --- a/media/cast/net/pacing/paced_sender.h +++ b/media/cast/net/pacing/paced_sender.h @@ -89,7 +89,7 @@ class PacedSender : public PacedPacketSender, PacketSender* external_transport, const scoped_refptr<base::SingleThreadTaskRunner>& transport_task_runner); - ~PacedSender() override; + ~PacedSender() final; // These must be called before non-RTCP packets are sent. void RegisterAudioSsrc(uint32 audio_ssrc); @@ -111,11 +111,11 @@ class PacedSender : public PacedPacketSender, int64 GetLastByteSentForSsrc(uint32 ssrc); // PacedPacketSender implementation. - bool SendPackets(const SendPacketVector& packets) override; + bool SendPackets(const SendPacketVector& packets) final; bool ResendPackets(const SendPacketVector& packets, - const DedupInfo& dedup_info) override; - bool SendRtcpPacket(uint32 ssrc, PacketRef packet) override; - void CancelSendingPacket(const PacketKey& packet_key) override; + const DedupInfo& dedup_info) final; + bool SendRtcpPacket(uint32 ssrc, PacketRef packet) final; + void CancelSendingPacket(const PacketKey& packet_key) final; private: // Actually sends the packets to the transport. diff --git a/media/cast/net/pacing/paced_sender_unittest.cc b/media/cast/net/pacing/paced_sender_unittest.cc index 62ad8ea..2387d42 100644 --- a/media/cast/net/pacing/paced_sender_unittest.cc +++ b/media/cast/net/pacing/paced_sender_unittest.cc @@ -32,7 +32,7 @@ class TestPacketSender : public PacketSender { public: TestPacketSender() : bytes_sent_(0) {} - bool SendPacket(PacketRef packet, const base::Closure& cb) override { + bool SendPacket(PacketRef packet, const base::Closure& cb) final { EXPECT_FALSE(expected_packet_size_.empty()); size_t expected_packet_size = expected_packet_size_.front(); expected_packet_size_.pop_front(); @@ -41,7 +41,7 @@ class TestPacketSender : public PacketSender { return true; } - int64 GetBytesSent() override { return bytes_sent_; } + int64 GetBytesSent() final { return bytes_sent_; } void AddExpectedSize(int expected_packet_size, int repeat_count) { for (int i = 0; i < repeat_count; ++i) { diff --git a/media/cast/net/rtcp/receiver_rtcp_event_subscriber.h b/media/cast/net/rtcp/receiver_rtcp_event_subscriber.h index b5321f9..248f07a 100644 --- a/media/cast/net/rtcp/receiver_rtcp_event_subscriber.h +++ b/media/cast/net/rtcp/receiver_rtcp_event_subscriber.h @@ -43,11 +43,11 @@ class ReceiverRtcpEventSubscriber : public RawEventSubscriber { ReceiverRtcpEventSubscriber(const size_t max_size_to_retain, EventMediaType type); - ~ReceiverRtcpEventSubscriber() override; + ~ReceiverRtcpEventSubscriber() final; // RawEventSubscriber implementation. - void OnReceiveFrameEvent(const FrameEvent& frame_event) override; - void OnReceivePacketEvent(const PacketEvent& packet_event) override; + void OnReceiveFrameEvent(const FrameEvent& frame_event) final; + void OnReceivePacketEvent(const PacketEvent& packet_event) final; // Assigns events collected to |rtcp_events|. If there is space, some // older events will be added for redundancy as well. diff --git a/media/cast/net/rtcp/receiver_rtcp_event_subscriber_unittest.cc b/media/cast/net/rtcp/receiver_rtcp_event_subscriber_unittest.cc index 993df70ea..bd31d24 100644 --- a/media/cast/net/rtcp/receiver_rtcp_event_subscriber_unittest.cc +++ b/media/cast/net/rtcp/receiver_rtcp_event_subscriber_unittest.cc @@ -35,7 +35,7 @@ class ReceiverRtcpEventSubscriberTest : public ::testing::Test { ~ReceiverRtcpEventSubscriberTest() override {} - void TearDown() override { + void TearDown() final { if (event_subscriber_) { cast_environment_->Logging()->RemoveRawEventSubscriber( event_subscriber_.get()); diff --git a/media/cast/net/rtcp/rtcp_unittest.cc b/media/cast/net/rtcp/rtcp_unittest.cc index 2ecbd1a..0796351 100644 --- a/media/cast/net/rtcp/rtcp_unittest.cc +++ b/media/cast/net/rtcp/rtcp_unittest.cc @@ -34,7 +34,7 @@ class FakeRtcpTransport : public PacedPacketSender { base::TimeDelta packet_delay() const { return packet_delay_; } void set_packet_delay(base::TimeDelta delay) { packet_delay_ = delay; } - bool SendRtcpPacket(uint32 ssrc, PacketRef packet) override { + bool SendRtcpPacket(uint32 ssrc, PacketRef packet) final { clock_->Advance(packet_delay_); if (paused_) { packet_queue_.push_back(packet); @@ -44,14 +44,14 @@ class FakeRtcpTransport : public PacedPacketSender { return true; } - bool SendPackets(const SendPacketVector& packets) override { return false; } + bool SendPackets(const SendPacketVector& packets) final { return false; } bool ResendPackets(const SendPacketVector& packets, - const DedupInfo& dedup_info) override { + const DedupInfo& dedup_info) final { return false; } - void CancelSendingPacket(const PacketKey& packet_key) override {} + void CancelSendingPacket(const PacketKey& packet_key) final {} void Pause() { paused_ = true; diff --git a/media/cast/net/rtp/cast_message_builder_unittest.cc b/media/cast/net/rtp/cast_message_builder_unittest.cc index 240d04a..bae827a 100644 --- a/media/cast/net/rtp/cast_message_builder_unittest.cc +++ b/media/cast/net/rtp/cast_message_builder_unittest.cc @@ -28,7 +28,7 @@ class NackFeedbackVerification : public RtpPayloadFeedback { NackFeedbackVerification() : triggered_(false), missing_packets_(), last_frame_acked_(0) {} - void CastFeedback(const RtcpCastMessage& cast_feedback) override { + void CastFeedback(const RtcpCastMessage& cast_feedback) final { EXPECT_EQ(kSsrc, cast_feedback.media_ssrc); last_frame_acked_ = cast_feedback.ack_frame_id; diff --git a/media/cast/net/rtp/rtp_packetizer_unittest.cc b/media/cast/net/rtp/rtp_packetizer_unittest.cc index aa1b4c5..802a9c4 100644 --- a/media/cast/net/rtp/rtp_packetizer_unittest.cc +++ b/media/cast/net/rtp/rtp_packetizer_unittest.cc @@ -61,7 +61,7 @@ class TestRtpPacketTransport : public PacketSender { EXPECT_EQ(expected_frame_id_ - 1u, rtp_header.reference_frame_id); } - bool SendPacket(PacketRef packet, const base::Closure& cb) override { + bool SendPacket(PacketRef packet, const base::Closure& cb) final { ++packets_sent_; RtpHeaderParser parser(&packet->data[0], packet->data.size()); RtpCastTestHeader rtp_header; @@ -72,7 +72,7 @@ class TestRtpPacketTransport : public PacketSender { return true; } - int64 GetBytesSent() override { return 0; } + int64 GetBytesSent() final { return 0; } size_t number_of_packets_received() const { return packets_sent_; } diff --git a/media/cast/net/udp_transport.h b/media/cast/net/udp_transport.h index 4816da4..ddeb8fc 100644 --- a/media/cast/net/udp_transport.h +++ b/media/cast/net/udp_transport.h @@ -43,7 +43,7 @@ class UdpTransport : public PacketSender { const net::IPEndPoint& remote_end_point, int32 send_buffer_size, const CastTransportStatusCallback& status_callback); - ~UdpTransport() override; + ~UdpTransport() final; // Start receiving packets. Packets are submitted to |packet_receiver|. void StartReceiving(const PacketReceiverCallbackWithStatus& packet_receiver); @@ -59,8 +59,8 @@ class UdpTransport : public PacketSender { #endif // PacketSender implementations. - bool SendPacket(PacketRef packet, const base::Closure& cb) override; - int64 GetBytesSent() override; + bool SendPacket(PacketRef packet, const base::Closure& cb) final; + int64 GetBytesSent() final; private: // Requests and processes packets from |udp_socket_|. This method is called diff --git a/media/cast/receiver/audio_decoder.cc b/media/cast/receiver/audio_decoder.cc index bc5b596..147abcf 100644 --- a/media/cast/receiver/audio_decoder.cc +++ b/media/cast/receiver/audio_decoder.cc @@ -115,9 +115,9 @@ class AudioDecoder::OpusImpl : public AudioDecoder::ImplBase { } private: - ~OpusImpl() override {} + ~OpusImpl() final {} - void RecoverBecauseFramesWereDropped() override { + void RecoverBecauseFramesWereDropped() final { // Passing NULL for the input data notifies the decoder of frame loss. const opus_int32 result = opus_decode_float( @@ -125,7 +125,7 @@ class AudioDecoder::OpusImpl : public AudioDecoder::ImplBase { DCHECK_GE(result, 0); } - scoped_ptr<AudioBus> Decode(uint8* data, int len) override { + scoped_ptr<AudioBus> Decode(uint8* data, int len) final { scoped_ptr<AudioBus> audio_bus; const opus_int32 num_samples_decoded = opus_decode_float( opus_decoder_, data, len, buffer_.get(), max_samples_per_frame_, 0); @@ -174,9 +174,9 @@ class AudioDecoder::Pcm16Impl : public AudioDecoder::ImplBase { } private: - ~Pcm16Impl() override {} + ~Pcm16Impl() final {} - scoped_ptr<AudioBus> Decode(uint8* data, int len) override { + scoped_ptr<AudioBus> Decode(uint8* data, int len) final { scoped_ptr<AudioBus> audio_bus; const int num_samples = len / sizeof(int16) / num_channels_; if (num_samples <= 0) diff --git a/media/cast/receiver/audio_decoder_unittest.cc b/media/cast/receiver/audio_decoder_unittest.cc index 6cd4f4e..5059ebc 100644 --- a/media/cast/receiver/audio_decoder_unittest.cc +++ b/media/cast/receiver/audio_decoder_unittest.cc @@ -41,7 +41,7 @@ class AudioDecoderTest : public ::testing::TestWithParam<TestScenario> { } protected: - void SetUp() override { + void SetUp() final { audio_decoder_.reset(new AudioDecoder(cast_environment_, GetParam().num_channels, GetParam().sampling_rate, diff --git a/media/cast/receiver/cast_receiver_impl.h b/media/cast/receiver/cast_receiver_impl.h index bc1bf67..6cd6ba3 100644 --- a/media/cast/receiver/cast_receiver_impl.h +++ b/media/cast/receiver/cast_receiver_impl.h @@ -29,18 +29,18 @@ class CastReceiverImpl : public CastReceiver { const FrameReceiverConfig& video_config, CastTransportSender* const transport); - ~CastReceiverImpl() override; + ~CastReceiverImpl() final; // CastReceiver implementation. - void ReceivePacket(scoped_ptr<Packet> packet) override; + void ReceivePacket(scoped_ptr<Packet> packet) final; void RequestDecodedAudioFrame( - const AudioFrameDecodedCallback& callback) override; + const AudioFrameDecodedCallback& callback) final; void RequestEncodedAudioFrame( - const ReceiveEncodedFrameCallback& callback) override; + const ReceiveEncodedFrameCallback& callback) final; void RequestDecodedVideoFrame( - const VideoFrameDecodedCallback& callback) override; + const VideoFrameDecodedCallback& callback) final; void RequestEncodedVideoFrame( - const ReceiveEncodedFrameCallback& callback) override; + const ReceiveEncodedFrameCallback& callback) final; private: // Feeds an EncodedFrame into |audio_decoder_|. RequestDecodedAudioFrame() diff --git a/media/cast/receiver/frame_receiver.h b/media/cast/receiver/frame_receiver.h index 2ff8f0f..f4037dd 100644 --- a/media/cast/receiver/frame_receiver.h +++ b/media/cast/receiver/frame_receiver.h @@ -52,7 +52,7 @@ class FrameReceiver : public RtpPayloadFeedback, EventMediaType event_media_type, CastTransportSender* const transport); - ~FrameReceiver() override; + ~FrameReceiver() final; // Request an encoded frame. // @@ -72,7 +72,7 @@ class FrameReceiver : public RtpPayloadFeedback, size_t payload_size); // RtpPayloadFeedback implementation. - void CastFeedback(const RtcpCastMessage& cast_message) override; + void CastFeedback(const RtcpCastMessage& cast_message) final; private: // Processes ready-to-consume packets from |framer_|, decrypting each packet's diff --git a/media/cast/receiver/frame_receiver_unittest.cc b/media/cast/receiver/frame_receiver_unittest.cc index cce59f9..f50ce93 100644 --- a/media/cast/receiver/frame_receiver_unittest.cc +++ b/media/cast/receiver/frame_receiver_unittest.cc @@ -80,7 +80,7 @@ class FrameReceiverTest : public ::testing::Test { ~FrameReceiverTest() override {} - void SetUp() override { + void SetUp() final { payload_.assign(kPacketSize, 0); // Always start with a key frame. diff --git a/media/cast/receiver/video_decoder.cc b/media/cast/receiver/video_decoder.cc index a30394c..b2a2e3e 100644 --- a/media/cast/receiver/video_decoder.cc +++ b/media/cast/receiver/video_decoder.cc @@ -113,12 +113,12 @@ class VideoDecoder::Vp8Impl : public VideoDecoder::ImplBase { } private: - ~Vp8Impl() override { + ~Vp8Impl() final { if (ImplBase::operational_status_ == STATUS_INITIALIZED) CHECK_EQ(VPX_CODEC_OK, vpx_codec_destroy(&context_)); } - scoped_refptr<VideoFrame> Decode(uint8* data, int len) override { + scoped_refptr<VideoFrame> Decode(uint8* data, int len) final { if (len <= 0 || vpx_codec_decode(&context_, data, static_cast<unsigned int>(len), @@ -180,9 +180,9 @@ class VideoDecoder::FakeImpl : public VideoDecoder::ImplBase { } private: - ~FakeImpl() override {} + ~FakeImpl() final {} - scoped_refptr<VideoFrame> Decode(uint8* data, int len) override { + scoped_refptr<VideoFrame> Decode(uint8* data, int len) final { // Make sure this is a JSON string. if (!len || data[0] != '{') return NULL; diff --git a/media/cast/receiver/video_decoder_unittest.cc b/media/cast/receiver/video_decoder_unittest.cc index a51ea1d..29a5b51 100644 --- a/media/cast/receiver/video_decoder_unittest.cc +++ b/media/cast/receiver/video_decoder_unittest.cc @@ -50,7 +50,7 @@ class VideoDecoderTest : public ::testing::TestWithParam<Codec> { } protected: - void SetUp() override { + void SetUp() final { video_decoder_.reset(new VideoDecoder(cast_environment_, GetParam())); CHECK_EQ(STATUS_INITIALIZED, video_decoder_->InitializationResult()); diff --git a/media/cast/sender/audio_encoder.cc b/media/cast/sender/audio_encoder.cc index 588b942..942619a 100644 --- a/media/cast/sender/audio_encoder.cc +++ b/media/cast/sender/audio_encoder.cc @@ -249,12 +249,12 @@ class AudioEncoder::OpusImpl : public AudioEncoder::ImplBase { } private: - ~OpusImpl() override {} + ~OpusImpl() final {} void TransferSamplesIntoBuffer(const AudioBus* audio_bus, int source_offset, int buffer_fill_offset, - int num_samples) override { + int num_samples) final { // Opus requires channel-interleaved samples in a single array. for (int ch = 0; ch < audio_bus->channels(); ++ch) { const float* src = audio_bus->channel(ch) + source_offset; @@ -265,7 +265,7 @@ class AudioEncoder::OpusImpl : public AudioEncoder::ImplBase { } } - bool EncodeFromFilledBuffer(std::string* out) override { + bool EncodeFromFilledBuffer(std::string* out) final { out->resize(kOpusMaxPayloadSize); const opus_int32 result = opus_encode_float(opus_encoder_, @@ -353,7 +353,7 @@ class AudioEncoder::AppleAacImpl : public AudioEncoder::ImplBase { } private: - ~AppleAacImpl() override { Teardown(); } + ~AppleAacImpl() final { Teardown(); } // Destroys the existing audio converter and file, if any. void Teardown() { @@ -530,7 +530,7 @@ class AudioEncoder::AppleAacImpl : public AudioEncoder::ImplBase { void TransferSamplesIntoBuffer(const AudioBus* audio_bus, int source_offset, int buffer_fill_offset, - int num_samples) override { + int num_samples) final { DCHECK_EQ(audio_bus->channels(), input_buffer_->channels()); // See the comment on |input_bus_| for more on this optimization. Note that @@ -552,7 +552,7 @@ class AudioEncoder::AppleAacImpl : public AudioEncoder::ImplBase { source_offset, num_samples, buffer_fill_offset, input_buffer_.get()); } - bool EncodeFromFilledBuffer(std::string* out) override { + bool EncodeFromFilledBuffer(std::string* out) final { // Reset the buffer size field to the buffer capacity. converter_abl_.mBuffers[0].mDataByteSize = max_access_unit_size_; @@ -711,12 +711,12 @@ class AudioEncoder::Pcm16Impl : public AudioEncoder::ImplBase { } private: - ~Pcm16Impl() override {} + ~Pcm16Impl() final {} void TransferSamplesIntoBuffer(const AudioBus* audio_bus, int source_offset, int buffer_fill_offset, - int num_samples) override { + int num_samples) final { audio_bus->ToInterleavedPartial( source_offset, num_samples, @@ -724,7 +724,7 @@ class AudioEncoder::Pcm16Impl : public AudioEncoder::ImplBase { buffer_.get() + buffer_fill_offset * num_channels_); } - bool EncodeFromFilledBuffer(std::string* out) override { + bool EncodeFromFilledBuffer(std::string* out) final { // Output 16-bit PCM integers in big-endian byte order. out->resize(num_channels_ * samples_per_frame_ * sizeof(int16)); const int16* src = buffer_.get(); diff --git a/media/cast/sender/audio_encoder_unittest.cc b/media/cast/sender/audio_encoder_unittest.cc index 4997dc1..12b5f2c 100644 --- a/media/cast/sender/audio_encoder_unittest.cc +++ b/media/cast/sender/audio_encoder_unittest.cc @@ -100,7 +100,7 @@ class AudioEncoderTest : public ::testing::TestWithParam<TestScenario> { testing_clock_->Advance(base::TimeTicks::Now() - base::TimeTicks()); } - void SetUp() override { + void SetUp() final { task_runner_ = new test::FakeSingleThreadTaskRunner(testing_clock_); cast_environment_ = new CastEnvironment(scoped_ptr<base::TickClock>(testing_clock_).Pass(), diff --git a/media/cast/sender/audio_sender.h b/media/cast/sender/audio_sender.h index 6148d0e..b6333b1 100644 --- a/media/cast/sender/audio_sender.h +++ b/media/cast/sender/audio_sender.h @@ -36,7 +36,7 @@ class AudioSender : public FrameSender, const StatusChangeCallback& status_change_cb, CastTransportSender* const transport_sender); - ~AudioSender() override; + ~AudioSender() final; // Note: It is not guaranteed that |audio_frame| will actually be encoded and // sent, if AudioSender detects too many frames in flight. Therefore, clients @@ -45,9 +45,9 @@ class AudioSender : public FrameSender, const base::TimeTicks& recorded_time); protected: - int GetNumberOfFramesInEncoder() const override; - base::TimeDelta GetInFlightMediaDuration() const override; - void OnAck(uint32 frame_id) override; + int GetNumberOfFramesInEncoder() const final; + base::TimeDelta GetInFlightMediaDuration() const final; + void OnAck(uint32 frame_id) final; private: // Called by the |audio_encoder_| with the next EncodedFrame to send. diff --git a/media/cast/sender/audio_sender_unittest.cc b/media/cast/sender/audio_sender_unittest.cc index 0e33da0..b0662804 100644 --- a/media/cast/sender/audio_sender_unittest.cc +++ b/media/cast/sender/audio_sender_unittest.cc @@ -36,7 +36,7 @@ class TestPacketSender : public PacketSender { public: TestPacketSender() : number_of_rtp_packets_(0), number_of_rtcp_packets_(0) {} - bool SendPacket(PacketRef packet, const base::Closure& cb) override { + bool SendPacket(PacketRef packet, const base::Closure& cb) final { if (Rtcp::IsRtcpPacket(&packet->data[0], packet->data.size())) { ++number_of_rtcp_packets_; } else { @@ -51,7 +51,7 @@ class TestPacketSender : public PacketSender { return true; } - int64 GetBytesSent() override { return 0; } + int64 GetBytesSent() final { return 0; } int number_of_rtp_packets() const { return number_of_rtp_packets_; } diff --git a/media/cast/sender/congestion_control.cc b/media/cast/sender/congestion_control.cc index d14f9b0..5ede1b5 100644 --- a/media/cast/sender/congestion_control.cc +++ b/media/cast/sender/congestion_control.cc @@ -29,23 +29,23 @@ class AdaptiveCongestionControl : public CongestionControl { uint32 min_bitrate_configured, double max_frame_rate); - ~AdaptiveCongestionControl() override; + ~AdaptiveCongestionControl() final; - void UpdateRtt(base::TimeDelta rtt) override; + void UpdateRtt(base::TimeDelta rtt) final; - void UpdateTargetPlayoutDelay(base::TimeDelta delay) override; + void UpdateTargetPlayoutDelay(base::TimeDelta delay) final; // Called when an encoded frame is sent to the transport. void SendFrameToTransport(uint32 frame_id, size_t frame_size, - base::TimeTicks when) override; + base::TimeTicks when) final; // Called when we receive an ACK for a frame. - void AckFrame(uint32 frame_id, base::TimeTicks when) override; + void AckFrame(uint32 frame_id, base::TimeTicks when) final; // Returns the bitrate we should use for the next frame. uint32 GetBitrate(base::TimeTicks playout_time, - base::TimeDelta playout_delay) override; + base::TimeDelta playout_delay) final; private: struct FrameStats { @@ -96,23 +96,23 @@ class AdaptiveCongestionControl : public CongestionControl { class FixedCongestionControl : public CongestionControl { public: FixedCongestionControl(uint32 bitrate) : bitrate_(bitrate) {} - ~FixedCongestionControl() override {} + ~FixedCongestionControl() final {} - void UpdateRtt(base::TimeDelta rtt) override {} + void UpdateRtt(base::TimeDelta rtt) final {} - void UpdateTargetPlayoutDelay(base::TimeDelta delay) override {} + void UpdateTargetPlayoutDelay(base::TimeDelta delay) final {} // Called when an encoded frame is sent to the transport. void SendFrameToTransport(uint32 frame_id, size_t frame_size, - base::TimeTicks when) override {} + base::TimeTicks when) final {} // Called when we receive an ACK for a frame. - void AckFrame(uint32 frame_id, base::TimeTicks when) override {} + void AckFrame(uint32 frame_id, base::TimeTicks when) final {} // Returns the bitrate we should use for the next frame. uint32 GetBitrate(base::TimeTicks playout_time, - base::TimeDelta playout_delay) override { + base::TimeDelta playout_delay) final { return bitrate_; } diff --git a/media/cast/sender/external_video_encoder.cc b/media/cast/sender/external_video_encoder.cc index fcabe5c..a49cb91 100644 --- a/media/cast/sender/external_video_encoder.cc +++ b/media/cast/sender/external_video_encoder.cc @@ -132,7 +132,7 @@ class ExternalVideoEncoder::VEAClientImpl } protected: - void NotifyError(VideoEncodeAccelerator::Error error) override { + void NotifyError(VideoEncodeAccelerator::Error error) final { DCHECK(task_runner_->RunsTasksOnCurrentThread()); DCHECK(error != VideoEncodeAccelerator::kInvalidArgumentError && @@ -152,7 +152,7 @@ class ExternalVideoEncoder::VEAClientImpl // Called to allocate the input and output buffers. void RequireBitstreamBuffers(unsigned int input_count, const gfx::Size& input_coded_size, - size_t output_buffer_size) override { + size_t output_buffer_size) final { DCHECK(task_runner_->RunsTasksOnCurrentThread()); // TODO(miu): Investigate why we are ignoring |input_count| (4) and instead @@ -169,7 +169,7 @@ class ExternalVideoEncoder::VEAClientImpl // to the Cast MAIN thread via the supplied callback. void BitstreamBufferReady(int32 bitstream_buffer_id, size_t payload_size, - bool key_frame) override { + bool key_frame) final { DCHECK(task_runner_->RunsTasksOnCurrentThread()); if (bitstream_buffer_id < 0 || bitstream_buffer_id >= static_cast<int32>(output_buffers_.size())) { @@ -249,7 +249,7 @@ class ExternalVideoEncoder::VEAClientImpl private: friend class base::RefCountedThreadSafe<VEAClientImpl>; - ~VEAClientImpl() override { + ~VEAClientImpl() final { // According to the media::VideoEncodeAccelerator interface, Destroy() // should be called instead of invoking its private destructor. task_runner_->PostTask( diff --git a/media/cast/sender/external_video_encoder.h b/media/cast/sender/external_video_encoder.h index ee8b7f4..fcd616c 100644 --- a/media/cast/sender/external_video_encoder.h +++ b/media/cast/sender/external_video_encoder.h @@ -35,16 +35,16 @@ class ExternalVideoEncoder : public VideoEncoder { const CreateVideoEncodeAcceleratorCallback& create_vea_cb, const CreateVideoEncodeMemoryCallback& create_video_encode_memory_cb); - ~ExternalVideoEncoder() override; + ~ExternalVideoEncoder() final; // VideoEncoder implementation. bool EncodeVideoFrame( const scoped_refptr<media::VideoFrame>& video_frame, const base::TimeTicks& reference_time, - const FrameEncodedCallback& frame_encoded_callback) override; - void SetBitRate(int new_bit_rate) override; - void GenerateKeyFrame() override; - void LatestFrameIdToReference(uint32 frame_id) override; + const FrameEncodedCallback& frame_encoded_callback) final; + void SetBitRate(int new_bit_rate) final; + void GenerateKeyFrame() final; + void LatestFrameIdToReference(uint32 frame_id) final; private: class VEAClientImpl; @@ -88,10 +88,10 @@ class SizeAdaptableExternalVideoEncoder : public SizeAdaptableVideoEncoderBase { const CreateVideoEncodeAcceleratorCallback& create_vea_cb, const CreateVideoEncodeMemoryCallback& create_video_encode_memory_cb); - ~SizeAdaptableExternalVideoEncoder() override; + ~SizeAdaptableExternalVideoEncoder() final; protected: - scoped_ptr<VideoEncoder> CreateEncoder() override; + scoped_ptr<VideoEncoder> CreateEncoder() final; private: // Special callbacks needed by media::cast::ExternalVideoEncoder. diff --git a/media/cast/sender/fake_software_video_encoder.h b/media/cast/sender/fake_software_video_encoder.h index 0b00e03..a0e8af6 100644 --- a/media/cast/sender/fake_software_video_encoder.h +++ b/media/cast/sender/fake_software_video_encoder.h @@ -15,16 +15,16 @@ namespace cast { class FakeSoftwareVideoEncoder : public SoftwareVideoEncoder { public: FakeSoftwareVideoEncoder(const VideoSenderConfig& video_config); - ~FakeSoftwareVideoEncoder() override; + ~FakeSoftwareVideoEncoder() final; // SoftwareVideoEncoder implementations. - void Initialize() override; + void Initialize() final; void Encode(const scoped_refptr<media::VideoFrame>& video_frame, const base::TimeTicks& reference_time, - EncodedFrame* encoded_frame) override; - void UpdateRates(uint32 new_bitrate) override; - void GenerateKeyFrame() override; - void LatestFrameIdToReference(uint32 frame_id) override; + EncodedFrame* encoded_frame) final; + void UpdateRates(uint32 new_bitrate) final; + void GenerateKeyFrame() final; + void LatestFrameIdToReference(uint32 frame_id) final; private: VideoSenderConfig video_config_; diff --git a/media/cast/sender/h264_vt_encoder.cc b/media/cast/sender/h264_vt_encoder.cc index 38d671b..1b504c3 100644 --- a/media/cast/sender/h264_vt_encoder.cc +++ b/media/cast/sender/h264_vt_encoder.cc @@ -219,7 +219,7 @@ class H264VideoToolboxEncoder::VideoFrameFactoryImpl scoped_refptr<VideoFrame> MaybeCreateFrame( const gfx::Size& frame_size, - base::TimeDelta timestamp) override { + base::TimeDelta timestamp) final { if (frame_size.IsEmpty()) { DVLOG(1) << "Rejecting empty video frame."; return nullptr; @@ -269,7 +269,7 @@ class H264VideoToolboxEncoder::VideoFrameFactoryImpl private: friend class base::RefCountedThreadSafe<VideoFrameFactoryImpl>; - ~VideoFrameFactoryImpl() override {} + ~VideoFrameFactoryImpl() final {} base::Lock lock_; base::ScopedCFTypeRef<CVPixelBufferPoolRef> pool_; @@ -294,12 +294,12 @@ class H264VideoToolboxEncoder::VideoFrameFactoryImpl::Proxy scoped_refptr<VideoFrame> MaybeCreateFrame( const gfx::Size& frame_size, - base::TimeDelta timestamp) override { + base::TimeDelta timestamp) final { return video_frame_factory_->MaybeCreateFrame(frame_size, timestamp); } private: - ~Proxy() override {} + ~Proxy() final {} const scoped_refptr<VideoFrameFactoryImpl> video_frame_factory_; diff --git a/media/cast/sender/h264_vt_encoder.h b/media/cast/sender/h264_vt_encoder.h index 4df9320..1f51c23 100644 --- a/media/cast/sender/h264_vt_encoder.h +++ b/media/cast/sender/h264_vt_encoder.h @@ -35,22 +35,22 @@ class H264VideoToolboxEncoder : public VideoEncoder, const scoped_refptr<CastEnvironment>& cast_environment, const VideoSenderConfig& video_config, const StatusChangeCallback& status_change_cb); - ~H264VideoToolboxEncoder() override; + ~H264VideoToolboxEncoder() final; // media::cast::VideoEncoder implementation bool EncodeVideoFrame( const scoped_refptr<media::VideoFrame>& video_frame, const base::TimeTicks& reference_time, - const FrameEncodedCallback& frame_encoded_callback) override; - void SetBitRate(int new_bit_rate) override; - void GenerateKeyFrame() override; - void LatestFrameIdToReference(uint32 frame_id) override; - scoped_ptr<VideoFrameFactory> CreateVideoFrameFactory() override; - void EmitFrames() override; + const FrameEncodedCallback& frame_encoded_callback) final; + void SetBitRate(int new_bit_rate) final; + void GenerateKeyFrame() final; + void LatestFrameIdToReference(uint32 frame_id) final; + scoped_ptr<VideoFrameFactory> CreateVideoFrameFactory() final; + void EmitFrames() final; // base::PowerObserver - void OnSuspend() override; - void OnResume() override; + void OnSuspend() final; + void OnResume() final; private: // VideoFrameFactory tied to the VideoToolbox encoder. diff --git a/media/cast/sender/h264_vt_encoder_unittest.cc b/media/cast/sender/h264_vt_encoder_unittest.cc index 26ac062..fb07577 100644 --- a/media/cast/sender/h264_vt_encoder_unittest.cc +++ b/media/cast/sender/h264_vt_encoder_unittest.cc @@ -32,10 +32,10 @@ const int kVideoHeight = 720; class MediaTestSuite : public base::TestSuite { public: MediaTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} - ~MediaTestSuite() override {} + ~MediaTestSuite() final {} protected: - void Initialize() override; + void Initialize() final; }; void MediaTestSuite::Initialize() { @@ -208,14 +208,14 @@ class TestPowerSource : public base::PowerMonitorSource { } private: - bool IsOnBatteryPowerImpl() override { return false; } + bool IsOnBatteryPowerImpl() final { return false; } }; class H264VideoToolboxEncoderTest : public ::testing::Test { protected: H264VideoToolboxEncoderTest() = default; - void SetUp() override { + void SetUp() final { clock_ = new base::SimpleTestTickClock(); clock_->Advance(base::TimeTicks::Now() - base::TimeTicks()); @@ -234,7 +234,7 @@ class H264VideoToolboxEncoderTest : public ::testing::Test { EXPECT_EQ(STATUS_INITIALIZED, operational_status_); } - void TearDown() override { + void TearDown() final { encoder_.reset(); message_loop_.RunUntilIdle(); power_monitor_.reset(); diff --git a/media/cast/sender/size_adaptable_video_encoder_base.h b/media/cast/sender/size_adaptable_video_encoder_base.h index 293a684..7fc2921 100644 --- a/media/cast/sender/size_adaptable_video_encoder_base.h +++ b/media/cast/sender/size_adaptable_video_encoder_base.h @@ -34,12 +34,12 @@ class SizeAdaptableVideoEncoderBase : public VideoEncoder { bool EncodeVideoFrame( const scoped_refptr<media::VideoFrame>& video_frame, const base::TimeTicks& reference_time, - const FrameEncodedCallback& frame_encoded_callback) override; - void SetBitRate(int new_bit_rate) override; - void GenerateKeyFrame() override; - void LatestFrameIdToReference(uint32 frame_id) override; - scoped_ptr<VideoFrameFactory> CreateVideoFrameFactory() override; - void EmitFrames() override; + const FrameEncodedCallback& frame_encoded_callback) final; + void SetBitRate(int new_bit_rate) final; + void GenerateKeyFrame() final; + void LatestFrameIdToReference(uint32 frame_id) final; + scoped_ptr<VideoFrameFactory> CreateVideoFrameFactory() final; + void EmitFrames() final; protected: // Accessors for subclasses. diff --git a/media/cast/sender/video_encoder_impl.h b/media/cast/sender/video_encoder_impl.h index 7572c4a..b31efa6 100644 --- a/media/cast/sender/video_encoder_impl.h +++ b/media/cast/sender/video_encoder_impl.h @@ -36,16 +36,16 @@ class VideoEncoderImpl : public VideoEncoder { const VideoSenderConfig& video_config, const StatusChangeCallback& status_change_cb); - ~VideoEncoderImpl() override; + ~VideoEncoderImpl() final; // VideoEncoder implementation. bool EncodeVideoFrame( const scoped_refptr<media::VideoFrame>& video_frame, const base::TimeTicks& reference_time, - const FrameEncodedCallback& frame_encoded_callback) override; - void SetBitRate(int new_bit_rate) override; - void GenerateKeyFrame() override; - void LatestFrameIdToReference(uint32 frame_id) override; + const FrameEncodedCallback& frame_encoded_callback) final; + void SetBitRate(int new_bit_rate) final; + void GenerateKeyFrame() final; + void LatestFrameIdToReference(uint32 frame_id) final; private: scoped_refptr<CastEnvironment> cast_environment_; diff --git a/media/cast/sender/video_encoder_unittest.cc b/media/cast/sender/video_encoder_unittest.cc index dc1b948..9b4f697 100644 --- a/media/cast/sender/video_encoder_unittest.cc +++ b/media/cast/sender/video_encoder_unittest.cc @@ -46,7 +46,7 @@ class VideoEncoderTest ~VideoEncoderTest() override {} - void SetUp() override { + void SetUp() final { video_config_.codec = GetParam().first; video_config_.use_external_encoder = GetParam().second; @@ -54,7 +54,7 @@ class VideoEncoderTest vea_factory_.reset(new FakeVideoEncodeAcceleratorFactory(task_runner_)); } - void TearDown() override { + void TearDown() final { video_encoder_.reset(); RunTasksAndAdvanceClock(); } diff --git a/media/cast/sender/video_sender.h b/media/cast/sender/video_sender.h index 0cb25fd..386ddb9 100644 --- a/media/cast/sender/video_sender.h +++ b/media/cast/sender/video_sender.h @@ -60,9 +60,9 @@ class VideoSender : public FrameSender, scoped_ptr<VideoFrameFactory> CreateVideoFrameFactory(); protected: - int GetNumberOfFramesInEncoder() const override; - base::TimeDelta GetInFlightMediaDuration() const override; - void OnAck(uint32 frame_id) override; + int GetNumberOfFramesInEncoder() const final; + base::TimeDelta GetInFlightMediaDuration() const final; + void OnAck(uint32 frame_id) final; private: // Called by the |video_encoder_| with the next EncodedFrame to send. diff --git a/media/cast/sender/video_sender_unittest.cc b/media/cast/sender/video_sender_unittest.cc index 89a9c4f..6da16bd 100644 --- a/media/cast/sender/video_sender_unittest.cc +++ b/media/cast/sender/video_sender_unittest.cc @@ -52,7 +52,7 @@ class TestPacketSender : public PacketSender { paused_(false) {} // A singular packet implies a RTCP packet. - bool SendPacket(PacketRef packet, const base::Closure& cb) override { + bool SendPacket(PacketRef packet, const base::Closure& cb) final { if (paused_) { stored_packet_ = packet; callback_ = cb; @@ -72,7 +72,7 @@ class TestPacketSender : public PacketSender { return true; } - int64 GetBytesSent() override { return 0; } + int64 GetBytesSent() final { return 0; } int number_of_rtp_packets() const { return number_of_rtp_packets_; } @@ -151,7 +151,7 @@ class VideoSenderTest : public ::testing::Test { ~VideoSenderTest() override {} - void TearDown() override { + void TearDown() final { video_sender_.reset(); task_runner_->RunTasks(); } diff --git a/media/cast/sender/vp8_encoder.h b/media/cast/sender/vp8_encoder.h index 2de51d4..705534c 100644 --- a/media/cast/sender/vp8_encoder.h +++ b/media/cast/sender/vp8_encoder.h @@ -24,16 +24,16 @@ class Vp8Encoder : public SoftwareVideoEncoder { public: explicit Vp8Encoder(const VideoSenderConfig& video_config); - ~Vp8Encoder() override; + ~Vp8Encoder() final; // SoftwareVideoEncoder implementations. - void Initialize() override; + void Initialize() final; void Encode(const scoped_refptr<media::VideoFrame>& video_frame, const base::TimeTicks& reference_time, - EncodedFrame* encoded_frame) override; - void UpdateRates(uint32 new_bitrate) override; - void GenerateKeyFrame() override; - void LatestFrameIdToReference(uint32 frame_id) override; + EncodedFrame* encoded_frame) final; + void UpdateRates(uint32 new_bitrate) final; + void GenerateKeyFrame() final; + void LatestFrameIdToReference(uint32 frame_id) final; private: enum { kNumberOfVp8VideoBuffers = 3 }; diff --git a/media/cast/test/cast_benchmarks.cc b/media/cast/test/cast_benchmarks.cc index f376396..005037c 100644 --- a/media/cast/test/cast_benchmarks.cc +++ b/media/cast/test/cast_benchmarks.cc @@ -108,19 +108,19 @@ class CastTransportSenderWrapper : public CastTransportSender { void InitializeAudio(const CastTransportRtpConfig& config, const RtcpCastMessageCallback& cast_message_cb, - const RtcpRttCallback& rtt_cb) override { + const RtcpRttCallback& rtt_cb) final { audio_ssrc_ = config.ssrc; transport_->InitializeAudio(config, cast_message_cb, rtt_cb); } void InitializeVideo(const CastTransportRtpConfig& config, const RtcpCastMessageCallback& cast_message_cb, - const RtcpRttCallback& rtt_cb) override { + const RtcpRttCallback& rtt_cb) final { video_ssrc_ = config.ssrc; transport_->InitializeVideo(config, cast_message_cb, rtt_cb); } - void InsertFrame(uint32 ssrc, const EncodedFrame& frame) override { + void InsertFrame(uint32 ssrc, const EncodedFrame& frame) final { if (ssrc == audio_ssrc_) { *encoded_audio_bytes_ += frame.data.size(); } else if (ssrc == video_ssrc_) { @@ -131,26 +131,26 @@ class CastTransportSenderWrapper : public CastTransportSender { void SendSenderReport(uint32 ssrc, base::TimeTicks current_time, - uint32 current_time_as_rtp_timestamp) override { + uint32 current_time_as_rtp_timestamp) final { transport_->SendSenderReport(ssrc, current_time, current_time_as_rtp_timestamp); } void CancelSendingFrames(uint32 ssrc, - const std::vector<uint32>& frame_ids) override { + const std::vector<uint32>& frame_ids) final { transport_->CancelSendingFrames(ssrc, frame_ids); } - void ResendFrameForKickstart(uint32 ssrc, uint32 frame_id) override { + void ResendFrameForKickstart(uint32 ssrc, uint32 frame_id) final { transport_->ResendFrameForKickstart(ssrc, frame_id); } - PacketReceiverCallback PacketReceiverForTesting() override { + PacketReceiverCallback PacketReceiverForTesting() final { return transport_->PacketReceiverForTesting(); } - void AddValidSsrc(uint32 ssrc) override { + void AddValidSsrc(uint32 ssrc) final { return transport_->AddValidSsrc(ssrc); } @@ -161,7 +161,7 @@ class CastTransportSenderWrapper : public CastTransportSender { const RtcpCastMessage* cast_message, base::TimeDelta target_delay, const ReceiverRtcpEventSubscriber::RtcpEvents* rtcp_events, - const RtpReceiverStatistics* rtp_receiver_statistics) override { + const RtpReceiverStatistics* rtp_receiver_statistics) final { return transport_->SendRtcpFromRtpReceiver(ssrc, sender_ssrc, time_data, diff --git a/media/cast/test/end2end_unittest.cc b/media/cast/test/end2end_unittest.cc index f5780ee..5473dc6 100644 --- a/media/cast/test/end2end_unittest.cc +++ b/media/cast/test/end2end_unittest.cc @@ -165,10 +165,10 @@ class LoopBackPacketPipe : public test::PacketPipe { LoopBackPacketPipe(const PacketReceiverCallback& packet_receiver) : packet_receiver_(packet_receiver) {} - ~LoopBackPacketPipe() override {} + ~LoopBackPacketPipe() final {} // PacketPipe implementations. - void Send(scoped_ptr<Packet> packet) override { + void Send(scoped_ptr<Packet> packet) final { packet_receiver_.Run(packet.Pass()); } @@ -200,7 +200,7 @@ class LoopBackTransport : public PacketSender { packet_pipe_->InitOnIOThread(task_runner, clock); } - bool SendPacket(PacketRef packet, const base::Closure& cb) override { + bool SendPacket(PacketRef packet, const base::Closure& cb) final { DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); if (!send_packets_) return true; @@ -217,7 +217,7 @@ class LoopBackTransport : public PacketSender { return true; } - int64 GetBytesSent() override { return bytes_sent_; } + int64 GetBytesSent() final { return bytes_sent_; } void SetSendPackets(bool send_packets) { send_packets_ = send_packets; } @@ -643,7 +643,7 @@ class End2EndTest : public ::testing::Test { &event_subscriber_sender_); } - void TearDown() override { + void TearDown() final { cast_sender_.reset(); cast_receiver_.reset(); task_runner_->RunTasks(); diff --git a/media/cast/test/fake_media_source.cc b/media/cast/test/fake_media_source.cc index 061478d..a30a55b 100644 --- a/media/cast/test/fake_media_source.cc +++ b/media/cast/test/fake_media_source.cc @@ -102,7 +102,7 @@ FakeMediaSource::~FakeMediaSource() { } void FakeMediaSource::SetSourceFile(const base::FilePath& video_file, - int override_fps) { + int final_fps) { DCHECK(!video_file.empty()); LOG(INFO) << "Source: " << video_file.value(); @@ -185,11 +185,11 @@ void FakeMediaSource::SetSourceFile(const base::FilePath& video_file, LOG(WARNING) << "Found multiple video streams."; } video_stream_index_ = static_cast<int>(i); - if (override_fps > 0) { + if (final_fps > 0) { // If video is played at a manual speed audio needs to match. - playback_rate_ = 1.0 * override_fps * + playback_rate_ = 1.0 * final_fps * av_stream->r_frame_rate.den / av_stream->r_frame_rate.num; - video_frame_rate_numerator_ = override_fps; + video_frame_rate_numerator_ = final_fps; video_frame_rate_denominator_ = 1; } else { playback_rate_ = 1.0; diff --git a/media/cast/test/fake_media_source.h b/media/cast/test/fake_media_source.h index f7fc36a..3ca55a0 100644 --- a/media/cast/test/fake_media_source.h +++ b/media/cast/test/fake_media_source.h @@ -54,11 +54,11 @@ class FakeMediaSource : public media::AudioConverter::InputCallback { const AudioSenderConfig& audio_config, const VideoSenderConfig& video_config, bool keep_frames); - ~FakeMediaSource() override; + ~FakeMediaSource() final; // Transcode this file as the source of video and audio frames. - // If |override_fps| is non zero then the file is played at the desired rate. - void SetSourceFile(const base::FilePath& video_file, int override_fps); + // If |final_fps| is non zero then the file is played at the desired rate. + void SetSourceFile(const base::FilePath& video_file, int final_fps); // Set to true to randomly change the frame size at random points in time. // Only applies when SetSourceFile() is not used. @@ -105,7 +105,7 @@ class FakeMediaSource : public media::AudioConverter::InputCallback { // media::AudioConverter::InputCallback implementation. double ProvideInput(media::AudioBus* output_bus, base::TimeDelta buffer_delay) - override; + final; AVStream* av_audio_stream(); AVStream* av_video_stream(); diff --git a/media/cast/test/fake_receiver_time_offset_estimator.h b/media/cast/test/fake_receiver_time_offset_estimator.h index fc3a901..cd98c0d 100644 --- a/media/cast/test/fake_receiver_time_offset_estimator.h +++ b/media/cast/test/fake_receiver_time_offset_estimator.h @@ -20,15 +20,15 @@ class FakeReceiverTimeOffsetEstimator : public ReceiverTimeOffsetEstimator { public: FakeReceiverTimeOffsetEstimator(base::TimeDelta offset); - ~FakeReceiverTimeOffsetEstimator() override; + ~FakeReceiverTimeOffsetEstimator() final; // RawReventSubscriber implementations. - void OnReceiveFrameEvent(const FrameEvent& frame_event) override; - void OnReceivePacketEvent(const PacketEvent& packet_event) override; + void OnReceiveFrameEvent(const FrameEvent& frame_event) final; + void OnReceivePacketEvent(const PacketEvent& packet_event) final; // ReceiverTimeOffsetEstimator bool GetReceiverOffsetBounds(base::TimeDelta* lower_bound, - base::TimeDelta* upper_bound) override; + base::TimeDelta* upper_bound) final; private: const base::TimeDelta offset_; diff --git a/media/cast/test/fake_single_thread_task_runner.h b/media/cast/test/fake_single_thread_task_runner.h index 60aaae4..c6fb02e 100644 --- a/media/cast/test/fake_single_thread_task_runner.h +++ b/media/cast/test/fake_single_thread_task_runner.h @@ -30,17 +30,17 @@ class FakeSingleThreadTaskRunner : public base::SingleThreadTaskRunner { // base::SingleThreadTaskRunner implementation. bool PostDelayedTask(const tracked_objects::Location& from_here, const base::Closure& task, - base::TimeDelta delay) override; + base::TimeDelta delay) final; - bool RunsTasksOnCurrentThread() const override; + bool RunsTasksOnCurrentThread() const final; // This function is currently not used, and will return false. bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, const base::Closure& task, - base::TimeDelta delay) override; + base::TimeDelta delay) final; protected: - ~FakeSingleThreadTaskRunner() override; + ~FakeSingleThreadTaskRunner() final; private: base::SimpleTestTickClock* const clock_; diff --git a/media/cast/test/loopback_transport.cc b/media/cast/test/loopback_transport.cc index 45f708d..7c71d58 100644 --- a/media/cast/test/loopback_transport.cc +++ b/media/cast/test/loopback_transport.cc @@ -20,10 +20,10 @@ class LoopBackPacketPipe : public test::PacketPipe { const PacketReceiverCallback& packet_receiver) : packet_receiver_(packet_receiver) {} - ~LoopBackPacketPipe() override {} + ~LoopBackPacketPipe() final {} // PacketPipe implementations. - void Send(scoped_ptr<Packet> packet) override { + void Send(scoped_ptr<Packet> packet) final { packet_receiver_.Run(packet.Pass()); } diff --git a/media/cast/test/loopback_transport.h b/media/cast/test/loopback_transport.h index 0b42560..478004c 100644 --- a/media/cast/test/loopback_transport.h +++ b/media/cast/test/loopback_transport.h @@ -27,11 +27,11 @@ class LoopBackTransport : public PacketSender { public: explicit LoopBackTransport( scoped_refptr<CastEnvironment> cast_environment); - ~LoopBackTransport() override; + ~LoopBackTransport() final; - bool SendPacket(PacketRef packet, const base::Closure& cb) override; + bool SendPacket(PacketRef packet, const base::Closure& cb) final; - int64 GetBytesSent() override; + int64 GetBytesSent() final; // Initiailize this loopback transport. // Establish a flow of packets from |pipe| to |packet_receiver|. diff --git a/media/cast/test/receiver.cc b/media/cast/test/receiver.cc index e36cedf..30d4f20 100644 --- a/media/cast/test/receiver.cc +++ b/media/cast/test/receiver.cc @@ -202,9 +202,9 @@ class NaivePlayer : public InProcessReceiver, num_audio_frames_processed_(0), currently_playing_audio_frame_start_(-1) {} - ~NaivePlayer() override {} + ~NaivePlayer() final {} - void Start() override { + void Start() final { AudioManager::Get()->GetTaskRunner()->PostTask( FROM_HERE, base::Bind(&NaivePlayer::StartAudioOutputOnAudioManagerThread, @@ -214,7 +214,7 @@ class NaivePlayer : public InProcessReceiver, InProcessReceiver::Start(); } - void Stop() override { + void Stop() final { // First, stop audio output to the Chromium audio stack. base::WaitableEvent done(false, false); DCHECK(!AudioManager::Get()->GetTaskRunner()->BelongsToCurrentThread()); @@ -263,11 +263,11 @@ class NaivePlayer : public InProcessReceiver, } //////////////////////////////////////////////////////////////////// - // InProcessReceiver overrides. + // InProcessReceiver finals. void OnVideoFrame(const scoped_refptr<VideoFrame>& video_frame, const base::TimeTicks& playout_time, - bool is_continuous) override { + bool is_continuous) final { DCHECK(cast_env()->CurrentlyOn(CastEnvironment::MAIN)); LOG_IF(WARNING, !is_continuous) << "Video: Discontinuity in received frames."; @@ -284,7 +284,7 @@ class NaivePlayer : public InProcessReceiver, void OnAudioFrame(scoped_ptr<AudioBus> audio_frame, const base::TimeTicks& playout_time, - bool is_continuous) override { + bool is_continuous) final { DCHECK(cast_env()->CurrentlyOn(CastEnvironment::MAIN)); LOG_IF(WARNING, !is_continuous) << "Audio: Discontinuity in received frames."; @@ -310,13 +310,13 @@ class NaivePlayer : public InProcessReceiver, std::make_pair(playout_time, audio_frame.release())); } - // End of InProcessReceiver overrides. + // End of InProcessReceiver finals. //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// // AudioSourceCallback implementation. - int OnMoreData(AudioBus* dest, uint32 total_bytes_delay) override { + int OnMoreData(AudioBus* dest, uint32 total_bytes_delay) final { // Note: This method is being invoked by a separate thread unknown to us // (i.e., outside of CastEnvironment). @@ -376,7 +376,7 @@ class NaivePlayer : public InProcessReceiver, return dest->frames(); } - void OnError(AudioOutputStream* stream) override { + void OnError(AudioOutputStream* stream) final { LOG(ERROR) << "AudioOutputStream reports an error. " << "Playback is unlikely to continue."; } diff --git a/media/cast/test/sender.cc b/media/cast/test/sender.cc index 686efa8..e34ecf1 100644 --- a/media/cast/test/sender.cc +++ b/media/cast/test/sender.cc @@ -261,15 +261,15 @@ int main(int argc, char** argv) { video_config, false)); - int override_fps = 0; + int final_fps = 0; if (!base::StringToInt(cmd->GetSwitchValueASCII(kSwitchFps), - &override_fps)){ - override_fps = 0; + &final_fps)){ + final_fps = 0; } base::FilePath source_path = cmd->GetSwitchValuePath(kSwitchSourceFile); if (!source_path.empty()) { LOG(INFO) << "Source: " << source_path.value(); - fake_media_source->SetSourceFile(source_path, override_fps); + fake_media_source->SetSourceFile(source_path, final_fps); } if (cmd->HasSwitch(kSwitchVaryFrameSizes)) fake_media_source->SetVariableFrameSizeMode(true); diff --git a/media/cast/test/simulator.cc b/media/cast/test/simulator.cc index 9b8cc05..6c277d5 100644 --- a/media/cast/test/simulator.cc +++ b/media/cast/test/simulator.cc @@ -170,10 +170,10 @@ class EncodedVideoFrameTracker : public RawEventSubscriber { EncodedVideoFrameTracker(FakeMediaSource* media_source) : media_source_(media_source), last_frame_event_type_(UNKNOWN) {} - ~EncodedVideoFrameTracker() override {} + ~EncodedVideoFrameTracker() final {} // RawEventSubscriber implementations. - void OnReceiveFrameEvent(const FrameEvent& frame_event) override { + void OnReceiveFrameEvent(const FrameEvent& frame_event) final { // This method only cares about video FRAME_CAPTURE_END and // FRAME_ENCODED events. if (frame_event.media_type != VIDEO_EVENT) { @@ -195,7 +195,7 @@ class EncodedVideoFrameTracker : public RawEventSubscriber { last_frame_event_type_ = frame_event.type; } - void OnReceivePacketEvent(const PacketEvent& packet_event) override { + void OnReceivePacketEvent(const PacketEvent& packet_event) final { // Don't care. } diff --git a/media/cast/test/skewed_single_thread_task_runner.h b/media/cast/test/skewed_single_thread_task_runner.h index 1a4d0ab..666a348 100644 --- a/media/cast/test/skewed_single_thread_task_runner.h +++ b/media/cast/test/skewed_single_thread_task_runner.h @@ -31,17 +31,17 @@ class SkewedSingleThreadTaskRunner : public base::SingleThreadTaskRunner { // base::SingleThreadTaskRunner implementation. bool PostDelayedTask(const tracked_objects::Location& from_here, const base::Closure& task, - base::TimeDelta delay) override; + base::TimeDelta delay) final; - bool RunsTasksOnCurrentThread() const override; + bool RunsTasksOnCurrentThread() const final; // This function is currently not used, and will return false. bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, const base::Closure& task, - base::TimeDelta delay) override; + base::TimeDelta delay) final; protected: - ~SkewedSingleThreadTaskRunner() override; + ~SkewedSingleThreadTaskRunner() final; private: double skew_; diff --git a/media/cast/test/skewed_tick_clock.h b/media/cast/test/skewed_tick_clock.h index a5539a3..e1dc81e 100644 --- a/media/cast/test/skewed_tick_clock.h +++ b/media/cast/test/skewed_tick_clock.h @@ -25,7 +25,7 @@ class SkewedTickClock : public base::TickClock { // jump forwards or backwards, only changing the offset will // do that. void SetSkew(double skew, base::TimeDelta offset); - base::TimeTicks NowTicks() override; + base::TimeTicks NowTicks() final; private: base::TimeTicks SkewTicks(base::TimeTicks now); diff --git a/media/cast/test/utility/in_process_receiver.h b/media/cast/test/utility/in_process_receiver.h index c73115c..545699b 100644 --- a/media/cast/test/utility/in_process_receiver.h +++ b/media/cast/test/utility/in_process_receiver.h @@ -75,11 +75,11 @@ class InProcessReceiver { // Helper method that creates |transport_| and |cast_receiver_|, starts // |transport_| receiving, and requests the first audio/video frame. - // Subclasses may override to provide additional start-up functionality. + // Subclasses may final to provide additional start-up functionality. virtual void StartOnMainThread(); // Helper method that destroys |transport_| and |cast_receiver_|. - // Subclasses may override to provide additional start-up functionality. + // Subclasses may final to provide additional start-up functionality. virtual void StopOnMainThread(base::WaitableEvent* event); // Callback for the transport to notify of status changes. A default diff --git a/media/cast/test/utility/tap_proxy.cc b/media/cast/test/utility/tap_proxy.cc index 6aca4f3..fa3e1b6 100644 --- a/media/cast/test/utility/tap_proxy.cc +++ b/media/cast/test/utility/tap_proxy.cc @@ -41,7 +41,7 @@ class SendToFDPipe : public PacketPipe { public: explicit SendToFDPipe(int fd) : fd_(fd) { } - void Send(scoped_ptr<Packet> packet) override { + void Send(scoped_ptr<Packet> packet) final { while (1) { int written = write( fd_, @@ -85,10 +85,10 @@ class QueueManager : public base::MessageLoopForIO::Watcher { &tick_clock_); } - ~QueueManager() override {} + ~QueueManager() final {} // MessageLoopForIO::Watcher methods - void OnFileCanReadWithoutBlocking(int fd) override { + void OnFileCanReadWithoutBlocking(int fd) final { scoped_ptr<Packet> packet(new Packet(kMaxPacketSize)); int nread = read(input_fd_, reinterpret_cast<char*>(&packet->front()), @@ -102,7 +102,7 @@ class QueueManager : public base::MessageLoopForIO::Watcher { packet->resize(nread); packet_pipe_->Send(packet.Pass()); } - void OnFileCanWriteWithoutBlocking(int fd) override { NOTREACHED(); } + void OnFileCanWriteWithoutBlocking(int fd) final { NOTREACHED(); } private: int input_fd_; @@ -169,7 +169,7 @@ ByteCounter out_pipe_output_counter; class ByteCounterPipe : public media::cast::test::PacketPipe { public: ByteCounterPipe(ByteCounter* counter) : counter_(counter) {} - void Send(scoped_ptr<media::cast::Packet> packet) override { + void Send(scoped_ptr<media::cast::Packet> packet) final { counter_->Increment(packet->size()); pipe_->Send(packet.Pass()); } diff --git a/media/cast/test/utility/udp_proxy.cc b/media/cast/test/utility/udp_proxy.cc index 5c41dbe..9b05589 100644 --- a/media/cast/test/utility/udp_proxy.cc +++ b/media/cast/test/utility/udp_proxy.cc @@ -56,7 +56,7 @@ class Buffer : public PacketPipe { CHECK_GT(max_megabits_per_second, 0); } - void Send(scoped_ptr<Packet> packet) override { + void Send(scoped_ptr<Packet> packet) final { if (packet->size() + buffer_size_ <= max_buffer_size_) { buffer_size_ += packet->size(); buffer_.push_back(linked_ptr<Packet>(packet.release())); @@ -116,7 +116,7 @@ class RandomDrop : public PacketPipe { RandomDrop(double drop_fraction) : drop_fraction_(static_cast<int>(drop_fraction * RAND_MAX)) {} - void Send(scoped_ptr<Packet> packet) override { + void Send(scoped_ptr<Packet> packet) final { if (rand() > drop_fraction_) { pipe_->Send(packet.Pass()); } @@ -158,7 +158,7 @@ class SimpleDelayBase : public PacketPipe { class ConstantDelay : public SimpleDelayBase { public: ConstantDelay(double delay_seconds) : delay_seconds_(delay_seconds) {} - double GetDelay() override { return delay_seconds_; } + double GetDelay() final { return delay_seconds_; } private: double delay_seconds_; @@ -189,11 +189,11 @@ class DuplicateAndDelay : public RandomUnsortedDelay { RandomUnsortedDelay(random_delay), delay_min_(delay_min) { } - void Send(scoped_ptr<Packet> packet) override { + void Send(scoped_ptr<Packet> packet) final { pipe_->Send(scoped_ptr<Packet>(new Packet(*packet.get()))); RandomUnsortedDelay::Send(packet.Pass()); } - double GetDelay() override { + double GetDelay() final { return RandomUnsortedDelay::GetDelay() + delay_min_; } private: @@ -216,7 +216,7 @@ class RandomSortedDelay : public PacketPipe { seconds_between_extra_delay_(seconds_between_extra_delay), weak_factory_(this) {} - void Send(scoped_ptr<Packet> packet) override { + void Send(scoped_ptr<Packet> packet) final { buffer_.push_back(linked_ptr<Packet>(packet.release())); if (buffer_.size() == 1) { next_send_ = std::max( @@ -228,7 +228,7 @@ class RandomSortedDelay : public PacketPipe { } void InitOnIOThread( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, - base::TickClock* clock) override { + base::TickClock* clock) final { PacketPipe::InitOnIOThread(task_runner, clock); // As we start the stream, assume that we are in a random // place between two extra delays, thus multiplier = 1.0; @@ -307,12 +307,12 @@ class NetworkGlitchPipe : public PacketPipe { void InitOnIOThread( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, - base::TickClock* clock) override { + base::TickClock* clock) final { PacketPipe::InitOnIOThread(task_runner, clock); Flip(); } - void Send(scoped_ptr<Packet> packet) override { + void Send(scoped_ptr<Packet> packet) final { if (works_) { pipe_->Send(packet.Pass()); } @@ -356,7 +356,7 @@ class InterruptedPoissonProcess::InternalBuffer : public PacketPipe { weak_factory_(this) { } - void Send(scoped_ptr<Packet> packet) override { + void Send(scoped_ptr<Packet> packet) final { // Drop if buffer is full. if (stored_size_ >= stored_limit_) return; @@ -368,7 +368,7 @@ class InterruptedPoissonProcess::InternalBuffer : public PacketPipe { void InitOnIOThread( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, - base::TickClock* clock) override { + base::TickClock* clock) final { clock_ = clock; if (ipp_) ipp_->InitOnIOThread(task_runner, clock); @@ -548,8 +548,8 @@ class PacketSender : public PacketPipe { public: PacketSender(UDPProxyImpl* udp_proxy, const net::IPEndPoint* destination) : udp_proxy_(udp_proxy), destination_(destination) {} - void Send(scoped_ptr<Packet> packet) override; - void AppendToPipe(scoped_ptr<PacketPipe> pipe) override { NOTREACHED(); } + void Send(scoped_ptr<Packet> packet) final; + void AppendToPipe(scoped_ptr<PacketPipe> pipe) final { NOTREACHED(); } private: UDPProxyImpl* udp_proxy_; @@ -690,7 +690,7 @@ class UDPProxyImpl : public UDPProxy { start_event.Wait(); } - ~UDPProxyImpl() override { + ~UDPProxyImpl() final { base::WaitableEvent stop_event(false, false); proxy_thread_.message_loop_proxy()->PostTask( FROM_HERE, diff --git a/media/cast/test/utility/udp_proxy_main.cc b/media/cast/test/utility/udp_proxy_main.cc index c1e269d..d050ea0 100644 --- a/media/cast/test/utility/udp_proxy_main.cc +++ b/media/cast/test/utility/udp_proxy_main.cc @@ -75,7 +75,7 @@ base::LazyInstance<GlobalCounter>::Leaky g_counter = class ByteCounterPipe : public media::cast::test::PacketPipe { public: ByteCounterPipe(ByteCounter* counter) : counter_(counter) {} - void Send(scoped_ptr<media::cast::Packet> packet) override { + void Send(scoped_ptr<media::cast::Packet> packet) final { counter_->Increment(packet->size()); pipe_->Send(packet.Pass()); } |