Commit bf2bc522 authored by Zentaro Kavanagh's avatar Zentaro Kavanagh Committed by Commit Bot

Mark classes with final dtors as final

- -Wfinal-dtor-non-final-class warns on classes with final dtors but
  not final classes.
- Error messages are better when the class is marked final.
- Fix existing issues in code base and a follow up will remove warning
  exemption.

Bug: 999886
Test: no errors building
Change-Id: I54b64f21213b7d02138ab67fcc68607f6fca9dc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2508199
Auto-Submit: Zentaro Kavanagh <zentaro@chromium.org>
Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#823322}
parent 307461c0
...@@ -42,7 +42,7 @@ namespace { ...@@ -42,7 +42,7 @@ namespace {
// CDMs too early (e.g. during page navigation) which could cause errors // CDMs too early (e.g. during page navigation) which could cause errors
// (session closed) on the client side. See https://crbug.com/821171 for // (session closed) on the client side. See https://crbug.com/821171 for
// details. // details.
class CdmFactoryImpl : public DeferredDestroy<mojom::CdmFactory> { class CdmFactoryImpl final : public DeferredDestroy<mojom::CdmFactory> {
public: public:
CdmFactoryImpl(CdmService::Client* client, CdmFactoryImpl(CdmService::Client* client,
mojo::PendingRemote<mojom::FrameInterfaceFactory> interfaces) mojo::PendingRemote<mojom::FrameInterfaceFactory> interfaces)
......
...@@ -27,7 +27,7 @@ namespace media { ...@@ -27,7 +27,7 @@ namespace media {
class CdmFactory; class CdmFactory;
class MEDIA_MOJO_EXPORT CdmService : public mojom::CdmService { class MEDIA_MOJO_EXPORT CdmService final : public mojom::CdmService {
public: public:
class Client { class Client {
public: public:
......
...@@ -29,7 +29,7 @@ namespace media { ...@@ -29,7 +29,7 @@ namespace media {
class MediaGpuChannelManager; class MediaGpuChannelManager;
class GpuMojoMediaClient : public MojoMediaClient { class GpuMojoMediaClient final : public MojoMediaClient {
public: public:
// |media_gpu_channel_manager| must only be used on |gpu_task_runner|, which // |media_gpu_channel_manager| must only be used on |gpu_task_runner|, which
// is expected to be the GPU main thread task runner. // is expected to be the GPU main thread task runner.
......
...@@ -34,7 +34,8 @@ namespace media { ...@@ -34,7 +34,8 @@ namespace media {
class CdmFactory; class CdmFactory;
class MojoMediaClient; class MojoMediaClient;
class InterfaceFactoryImpl : public DeferredDestroy<mojom::InterfaceFactory> { class InterfaceFactoryImpl final
: public DeferredDestroy<mojom::InterfaceFactory> {
public: public:
InterfaceFactoryImpl( InterfaceFactoryImpl(
mojo::PendingRemote<mojom::FrameInterfaceFactory> frame_interfaces, mojo::PendingRemote<mojom::FrameInterfaceFactory> frame_interfaces,
......
...@@ -22,7 +22,7 @@ namespace media { ...@@ -22,7 +22,7 @@ namespace media {
class MojoMediaClient; class MojoMediaClient;
class MEDIA_MOJO_EXPORT MediaService : public mojom::MediaService { class MEDIA_MOJO_EXPORT MediaService final : public mojom::MediaService {
public: public:
MediaService(std::unique_ptr<MojoMediaClient> mojo_media_client, MediaService(std::unique_ptr<MojoMediaClient> mojo_media_client,
mojo::PendingReceiver<mojom::MediaService> receiver); mojo::PendingReceiver<mojom::MediaService> receiver);
......
...@@ -24,7 +24,8 @@ namespace media { ...@@ -24,7 +24,8 @@ namespace media {
class MojoCdmServiceContext; class MojoCdmServiceContext;
class MojoDecoderBufferReader; class MojoDecoderBufferReader;
class MEDIA_MOJO_EXPORT MojoAudioDecoderService : public mojom::AudioDecoder { class MEDIA_MOJO_EXPORT MojoAudioDecoderService final
: public mojom::AudioDecoder {
public: public:
MojoAudioDecoderService(MojoCdmServiceContext* mojo_cdm_service_context, MojoAudioDecoderService(MojoCdmServiceContext* mojo_cdm_service_context,
std::unique_ptr<media::AudioDecoder> decoder); std::unique_ptr<media::AudioDecoder> decoder);
......
...@@ -26,7 +26,7 @@ namespace { ...@@ -26,7 +26,7 @@ namespace {
// cdm::Buffer implementation that provides access to mojo shared memory. // cdm::Buffer implementation that provides access to mojo shared memory.
// It owns the memory until Destroy() is called. // It owns the memory until Destroy() is called.
class MojoCdmBuffer : public cdm::Buffer { class MojoCdmBuffer final : public cdm::Buffer {
public: public:
static MojoCdmBuffer* Create( static MojoCdmBuffer* Create(
mojo::ScopedSharedBufferHandle buffer, mojo::ScopedSharedBufferHandle buffer,
...@@ -108,7 +108,7 @@ class MojoCdmBuffer : public cdm::Buffer { ...@@ -108,7 +108,7 @@ class MojoCdmBuffer : public cdm::Buffer {
// VideoFrameImpl that is able to create a MojoSharedBufferVideoFrame // VideoFrameImpl that is able to create a MojoSharedBufferVideoFrame
// out of the data. // out of the data.
class MojoCdmVideoFrame : public VideoFrameImpl { class MojoCdmVideoFrame final : public VideoFrameImpl {
public: public:
explicit MojoCdmVideoFrame(MojoSharedBufferVideoFrame::MojoSharedBufferDoneCB explicit MojoCdmVideoFrame(MojoSharedBufferVideoFrame::MojoSharedBufferDoneCB
mojo_shared_buffer_done_cb) mojo_shared_buffer_done_cb)
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
namespace media { namespace media {
// This is a CdmAllocator that creates buffers using mojo shared memory. // This is a CdmAllocator that creates buffers using mojo shared memory.
class MEDIA_MOJO_EXPORT MojoCdmAllocator : public CdmAllocator { class MEDIA_MOJO_EXPORT MojoCdmAllocator final : public CdmAllocator {
public: public:
MojoCdmAllocator(); MojoCdmAllocator();
~MojoCdmAllocator() final; ~MojoCdmAllocator() final;
......
...@@ -19,7 +19,7 @@ namespace media { ...@@ -19,7 +19,7 @@ namespace media {
// callback can be passed in by value or as const-refs. Find a better solution // callback can be passed in by value or as const-refs. Find a better solution
// to handle this. // to handle this.
template <typename F, typename... T> template <typename F, typename... T>
class MojoCdmPromise : public CdmPromiseTemplate<T...> { class MojoCdmPromise final : public CdmPromiseTemplate<T...> {
public: public:
using CallbackType = base::OnceCallback<F>; using CallbackType = base::OnceCallback<F>;
......
...@@ -32,7 +32,8 @@ class CdmFactory; ...@@ -32,7 +32,8 @@ class CdmFactory;
// A mojom::ContentDecryptionModule implementation backed by a // A mojom::ContentDecryptionModule implementation backed by a
// media::ContentDecryptionModule. // media::ContentDecryptionModule.
class MEDIA_MOJO_EXPORT MojoCdmService : public mojom::ContentDecryptionModule { class MEDIA_MOJO_EXPORT MojoCdmService final
: public mojom::ContentDecryptionModule {
public: public:
using CdmServiceCreatedCB = using CdmServiceCreatedCB =
base::OnceCallback<void(std::unique_ptr<MojoCdmService> mojo_cdm_service, base::OnceCallback<void(std::unique_ptr<MojoCdmService> mojo_cdm_service,
......
...@@ -26,7 +26,7 @@ class MojoDecoderBufferWriter; ...@@ -26,7 +26,7 @@ class MojoDecoderBufferWriter;
// A mojom::Decryptor implementation that proxies decryptor calls to a // A mojom::Decryptor implementation that proxies decryptor calls to a
// media::Decryptor. // media::Decryptor.
class MEDIA_MOJO_EXPORT MojoDecryptorService : public mojom::Decryptor { class MEDIA_MOJO_EXPORT MojoDecryptorService final : public mojom::Decryptor {
public: public:
using StreamType = media::Decryptor::StreamType; using StreamType = media::Decryptor::StreamType;
using Status = media::Decryptor::Status; using Status = media::Decryptor::Status;
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
namespace media { namespace media {
// A ProvisionFetcher that proxies to a Remote<mojom::ProvisionFetcher>. // A ProvisionFetcher that proxies to a Remote<mojom::ProvisionFetcher>.
class MEDIA_MOJO_EXPORT MojoProvisionFetcher : public ProvisionFetcher { class MEDIA_MOJO_EXPORT MojoProvisionFetcher final : public ProvisionFetcher {
public: public:
explicit MojoProvisionFetcher( explicit MojoProvisionFetcher(
mojo::PendingRemote<mojom::ProvisionFetcher> provision_fetcher); mojo::PendingRemote<mojom::ProvisionFetcher> provision_fetcher);
......
...@@ -36,8 +36,8 @@ class Renderer; ...@@ -36,8 +36,8 @@ class Renderer;
// A mojom::Renderer implementation that use a media::Renderer to render // A mojom::Renderer implementation that use a media::Renderer to render
// media streams. // media streams.
class MEDIA_MOJO_EXPORT MojoRendererService : public mojom::Renderer, class MEDIA_MOJO_EXPORT MojoRendererService final : public mojom::Renderer,
public RendererClient { public RendererClient {
public: public:
// Helper function to bind MojoRendererService with a SelfOwendReceiver, // Helper function to bind MojoRendererService with a SelfOwendReceiver,
// which is safely accessible via the returned SelfOwnedReceiverRef. // which is safely accessible via the returned SelfOwnedReceiverRef.
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
namespace media { namespace media {
class MEDIA_MOJO_EXPORT PlaybackEventsRecorder : public mojom::PlaybackEventsRecorder { class MEDIA_MOJO_EXPORT PlaybackEventsRecorder final
: public mojom::PlaybackEventsRecorder {
public: public:
static void Create( static void Create(
mojo::PendingReceiver<mojom::PlaybackEventsRecorder> receiver); mojo::PendingReceiver<mojom::PlaybackEventsRecorder> receiver);
......
...@@ -22,7 +22,7 @@ class RendererFactory; ...@@ -22,7 +22,7 @@ class RendererFactory;
class VideoRendererSink; class VideoRendererSink;
// Test MojoMediaClient for MediaService. // Test MojoMediaClient for MediaService.
class TestMojoMediaClient : public MojoMediaClient { class TestMojoMediaClient final : public MojoMediaClient {
public: public:
TestMojoMediaClient(); TestMojoMediaClient();
~TestMojoMediaClient() final; ~TestMojoMediaClient() final;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment