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 {
// CDMs too early (e.g. during page navigation) which could cause errors
// (session closed) on the client side. See https://crbug.com/821171 for
// details.
class CdmFactoryImpl : public DeferredDestroy<mojom::CdmFactory> {
class CdmFactoryImpl final : public DeferredDestroy<mojom::CdmFactory> {
public:
CdmFactoryImpl(CdmService::Client* client,
mojo::PendingRemote<mojom::FrameInterfaceFactory> interfaces)
......
......@@ -27,7 +27,7 @@ namespace media {
class CdmFactory;
class MEDIA_MOJO_EXPORT CdmService : public mojom::CdmService {
class MEDIA_MOJO_EXPORT CdmService final : public mojom::CdmService {
public:
class Client {
public:
......
......@@ -29,7 +29,7 @@ namespace media {
class MediaGpuChannelManager;
class GpuMojoMediaClient : public MojoMediaClient {
class GpuMojoMediaClient final : public MojoMediaClient {
public:
// |media_gpu_channel_manager| must only be used on |gpu_task_runner|, which
// is expected to be the GPU main thread task runner.
......
......@@ -34,7 +34,8 @@ namespace media {
class CdmFactory;
class MojoMediaClient;
class InterfaceFactoryImpl : public DeferredDestroy<mojom::InterfaceFactory> {
class InterfaceFactoryImpl final
: public DeferredDestroy<mojom::InterfaceFactory> {
public:
InterfaceFactoryImpl(
mojo::PendingRemote<mojom::FrameInterfaceFactory> frame_interfaces,
......
......@@ -22,7 +22,7 @@ namespace media {
class MojoMediaClient;
class MEDIA_MOJO_EXPORT MediaService : public mojom::MediaService {
class MEDIA_MOJO_EXPORT MediaService final : public mojom::MediaService {
public:
MediaService(std::unique_ptr<MojoMediaClient> mojo_media_client,
mojo::PendingReceiver<mojom::MediaService> receiver);
......
......@@ -24,7 +24,8 @@ namespace media {
class MojoCdmServiceContext;
class MojoDecoderBufferReader;
class MEDIA_MOJO_EXPORT MojoAudioDecoderService : public mojom::AudioDecoder {
class MEDIA_MOJO_EXPORT MojoAudioDecoderService final
: public mojom::AudioDecoder {
public:
MojoAudioDecoderService(MojoCdmServiceContext* mojo_cdm_service_context,
std::unique_ptr<media::AudioDecoder> decoder);
......
......@@ -26,7 +26,7 @@ namespace {
// cdm::Buffer implementation that provides access to mojo shared memory.
// It owns the memory until Destroy() is called.
class MojoCdmBuffer : public cdm::Buffer {
class MojoCdmBuffer final : public cdm::Buffer {
public:
static MojoCdmBuffer* Create(
mojo::ScopedSharedBufferHandle buffer,
......@@ -108,7 +108,7 @@ class MojoCdmBuffer : public cdm::Buffer {
// VideoFrameImpl that is able to create a MojoSharedBufferVideoFrame
// out of the data.
class MojoCdmVideoFrame : public VideoFrameImpl {
class MojoCdmVideoFrame final : public VideoFrameImpl {
public:
explicit MojoCdmVideoFrame(MojoSharedBufferVideoFrame::MojoSharedBufferDoneCB
mojo_shared_buffer_done_cb)
......
......@@ -21,7 +21,7 @@
namespace media {
// 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:
MojoCdmAllocator();
~MojoCdmAllocator() final;
......
......@@ -19,7 +19,7 @@ namespace media {
// callback can be passed in by value or as const-refs. Find a better solution
// to handle this.
template <typename F, typename... T>
class MojoCdmPromise : public CdmPromiseTemplate<T...> {
class MojoCdmPromise final : public CdmPromiseTemplate<T...> {
public:
using CallbackType = base::OnceCallback<F>;
......
......@@ -32,7 +32,8 @@ class CdmFactory;
// A mojom::ContentDecryptionModule implementation backed by a
// media::ContentDecryptionModule.
class MEDIA_MOJO_EXPORT MojoCdmService : public mojom::ContentDecryptionModule {
class MEDIA_MOJO_EXPORT MojoCdmService final
: public mojom::ContentDecryptionModule {
public:
using CdmServiceCreatedCB =
base::OnceCallback<void(std::unique_ptr<MojoCdmService> mojo_cdm_service,
......
......@@ -26,7 +26,7 @@ class MojoDecoderBufferWriter;
// A mojom::Decryptor implementation that proxies decryptor calls to a
// media::Decryptor.
class MEDIA_MOJO_EXPORT MojoDecryptorService : public mojom::Decryptor {
class MEDIA_MOJO_EXPORT MojoDecryptorService final : public mojom::Decryptor {
public:
using StreamType = media::Decryptor::StreamType;
using Status = media::Decryptor::Status;
......
......@@ -17,7 +17,7 @@
namespace media {
// 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:
explicit MojoProvisionFetcher(
mojo::PendingRemote<mojom::ProvisionFetcher> provision_fetcher);
......
......@@ -36,8 +36,8 @@ class Renderer;
// A mojom::Renderer implementation that use a media::Renderer to render
// media streams.
class MEDIA_MOJO_EXPORT MojoRendererService : public mojom::Renderer,
public RendererClient {
class MEDIA_MOJO_EXPORT MojoRendererService final : public mojom::Renderer,
public RendererClient {
public:
// Helper function to bind MojoRendererService with a SelfOwendReceiver,
// which is safely accessible via the returned SelfOwnedReceiverRef.
......
......@@ -12,7 +12,8 @@
namespace media {
class MEDIA_MOJO_EXPORT PlaybackEventsRecorder : public mojom::PlaybackEventsRecorder {
class MEDIA_MOJO_EXPORT PlaybackEventsRecorder final
: public mojom::PlaybackEventsRecorder {
public:
static void Create(
mojo::PendingReceiver<mojom::PlaybackEventsRecorder> receiver);
......
......@@ -22,7 +22,7 @@ class RendererFactory;
class VideoRendererSink;
// Test MojoMediaClient for MediaService.
class TestMojoMediaClient : public MojoMediaClient {
class TestMojoMediaClient final : public MojoMediaClient {
public:
TestMojoMediaClient();
~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