Commit 4957560c 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: Ib2ef4b92369ac7eb61ad148254a4506c02467fd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2468941Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Zentaro Kavanagh <zentaro@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817323}
parent 9cb650eb
...@@ -135,7 +135,8 @@ class WaitableDownloadLoggerObserver : public download::Logger::Observer { ...@@ -135,7 +135,8 @@ class WaitableDownloadLoggerObserver : public download::Logger::Observer {
// Observes the offline item collection's content provider and then invokes the // Observes the offline item collection's content provider and then invokes the
// associated test callbacks when one has been provided. // associated test callbacks when one has been provided.
class OfflineContentProviderObserver : public OfflineContentProvider::Observer { class OfflineContentProviderObserver final
: public OfflineContentProvider::Observer {
public: public:
using ItemsAddedCallback = using ItemsAddedCallback =
base::OnceCallback<void(const std::vector<OfflineItem>&)>; base::OnceCallback<void(const std::vector<OfflineItem>&)>;
......
...@@ -27,7 +27,7 @@ namespace { ...@@ -27,7 +27,7 @@ namespace {
// An implementation of the BrowsingDataMediaLicenseHelper interface that // An implementation of the BrowsingDataMediaLicenseHelper interface that
// determine data on media licenses in a given |filesystem_context| and // determine data on media licenses in a given |filesystem_context| and
// returns a list of MediaLicenseInfo items to a client. // returns a list of MediaLicenseInfo items to a client.
class BrowsingDataMediaLicenseHelperImpl class BrowsingDataMediaLicenseHelperImpl final
: public BrowsingDataMediaLicenseHelper { : public BrowsingDataMediaLicenseHelper {
public: public:
// BrowsingDataMediaLicenseHelper implementation // BrowsingDataMediaLicenseHelper implementation
......
...@@ -14,7 +14,7 @@ using ManagementAuthorityTrustworthiness = ...@@ -14,7 +14,7 @@ using ManagementAuthorityTrustworthiness =
class Profile; class Profile;
class BrowserCloudManagementStatusProvider class BrowserCloudManagementStatusProvider final
: public policy::ManagementStatusProvider { : public policy::ManagementStatusProvider {
public: public:
BrowserCloudManagementStatusProvider(); BrowserCloudManagementStatusProvider();
...@@ -23,7 +23,7 @@ class BrowserCloudManagementStatusProvider ...@@ -23,7 +23,7 @@ class BrowserCloudManagementStatusProvider
EnterpriseManagementAuthority GetAuthority() final; EnterpriseManagementAuthority GetAuthority() final;
}; };
class LocalBrowserManagementStatusProvider class LocalBrowserManagementStatusProvider final
: public policy::ManagementStatusProvider { : public policy::ManagementStatusProvider {
public: public:
LocalBrowserManagementStatusProvider(); LocalBrowserManagementStatusProvider();
...@@ -32,7 +32,7 @@ class LocalBrowserManagementStatusProvider ...@@ -32,7 +32,7 @@ class LocalBrowserManagementStatusProvider
EnterpriseManagementAuthority GetAuthority() final; EnterpriseManagementAuthority GetAuthority() final;
}; };
class ProfileCloudManagementStatusProvider class ProfileCloudManagementStatusProvider final
: public policy::ManagementStatusProvider { : public policy::ManagementStatusProvider {
public: public:
explicit ProfileCloudManagementStatusProvider(Profile* profile); explicit ProfileCloudManagementStatusProvider(Profile* profile);
......
...@@ -22,7 +22,7 @@ extern const char* const kStableChromecastExtensionId; ...@@ -22,7 +22,7 @@ extern const char* const kStableChromecastExtensionId;
// Extension ids for the chromecast. // Extension ids for the chromecast.
extern const char* const kChromecastExtensionIds[6]; extern const char* const kChromecastExtensionIds[6];
class TabCaptureCaptureFunction : public ExtensionFunction { class TabCaptureCaptureFunction final : public ExtensionFunction {
public: public:
DECLARE_EXTENSION_FUNCTION("tabCapture.capture", TABCAPTURE_CAPTURE) DECLARE_EXTENSION_FUNCTION("tabCapture.capture", TABCAPTURE_CAPTURE)
...@@ -33,7 +33,7 @@ class TabCaptureCaptureFunction : public ExtensionFunction { ...@@ -33,7 +33,7 @@ class TabCaptureCaptureFunction : public ExtensionFunction {
ResponseAction Run() final; ResponseAction Run() final;
}; };
class TabCaptureGetCapturedTabsFunction : public ExtensionFunction { class TabCaptureGetCapturedTabsFunction final : public ExtensionFunction {
public: public:
DECLARE_EXTENSION_FUNCTION("tabCapture.getCapturedTabs", DECLARE_EXTENSION_FUNCTION("tabCapture.getCapturedTabs",
TABCAPTURE_GETCAPTUREDTABS) TABCAPTURE_GETCAPTUREDTABS)
...@@ -45,7 +45,7 @@ class TabCaptureGetCapturedTabsFunction : public ExtensionFunction { ...@@ -45,7 +45,7 @@ class TabCaptureGetCapturedTabsFunction : public ExtensionFunction {
ResponseAction Run() final; ResponseAction Run() final;
}; };
class TabCaptureCaptureOffscreenTabFunction : public ExtensionFunction { class TabCaptureCaptureOffscreenTabFunction final : public ExtensionFunction {
public: public:
DECLARE_EXTENSION_FUNCTION("tabCapture.captureOffscreenTab", DECLARE_EXTENSION_FUNCTION("tabCapture.captureOffscreenTab",
TABCAPTURE_CAPTUREOFFSCREENTAB) TABCAPTURE_CAPTUREOFFSCREENTAB)
...@@ -62,7 +62,7 @@ class TabCaptureCaptureOffscreenTabFunction : public ExtensionFunction { ...@@ -62,7 +62,7 @@ class TabCaptureCaptureOffscreenTabFunction : public ExtensionFunction {
ResponseAction Run() final; ResponseAction Run() final;
}; };
class TabCaptureGetMediaStreamIdFunction : public ExtensionFunction { class TabCaptureGetMediaStreamIdFunction final : public ExtensionFunction {
public: public:
DECLARE_EXTENSION_FUNCTION("tabCapture.getMediaStreamId", DECLARE_EXTENSION_FUNCTION("tabCapture.getMediaStreamId",
TABCAPTURE_GETMEDIASTREAMID) TABCAPTURE_GETMEDIASTREAMID)
......
...@@ -37,7 +37,8 @@ using media::mojom::RemotingStartFailReason; ...@@ -37,7 +37,8 @@ using media::mojom::RemotingStartFailReason;
using media::mojom::RemotingStopReason; using media::mojom::RemotingStopReason;
using media::mojom::RemotingSinkMetadata; using media::mojom::RemotingSinkMetadata;
class CastRemotingConnector::RemotingBridge : public media::mojom::Remoter { class CastRemotingConnector::RemotingBridge final
: public media::mojom::Remoter {
public: public:
// Constructs a "bridge" to delegate calls between the given |source| and // Constructs a "bridge" to delegate calls between the given |source| and
// |connector|. |connector| must be valid at the time of construction, but is // |connector|. |connector| must be valid at the time of construction, but is
......
...@@ -75,7 +75,7 @@ class MediaRouter; ...@@ -75,7 +75,7 @@ class MediaRouter;
// Please see the unit tests in cast_remoting_connector_unittest.cc as a // Please see the unit tests in cast_remoting_connector_unittest.cc as a
// reference for how CastRemotingConnector and a MediaRemoter interact to // reference for how CastRemotingConnector and a MediaRemoter interact to
// start/execute/stop remoting sessions. // start/execute/stop remoting sessions.
class CastRemotingConnector : public base::SupportsUserData::Data, class CastRemotingConnector final : public base::SupportsUserData::Data,
public media::mojom::RemotingSource { public media::mojom::RemotingSource {
public: public:
~CastRemotingConnector() final; ~CastRemotingConnector() final;
......
...@@ -48,7 +48,7 @@ constexpr base::TimeDelta kPollInterval = base::TimeDelta::FromSeconds(1); ...@@ -48,7 +48,7 @@ constexpr base::TimeDelta kPollInterval = base::TimeDelta::FromSeconds(1);
// capture functionality. The WebContents native view, although attached to the // capture functionality. The WebContents native view, although attached to the
// window tree, does not become visible on-screen (until it is properly made // window tree, does not become visible on-screen (until it is properly made
// visible by the user, for example by switching to the tab). // visible by the user, for example by switching to the tab).
class OffscreenTab::WindowAdoptionAgent : protected aura::WindowObserver { class OffscreenTab::WindowAdoptionAgent final : protected aura::WindowObserver {
public: public:
explicit WindowAdoptionAgent(aura::Window* content_window) explicit WindowAdoptionAgent(aura::Window* content_window)
: content_window_(content_window) { : content_window_(content_window) {
......
...@@ -43,7 +43,7 @@ class BrowserContext; ...@@ -43,7 +43,7 @@ class BrowserContext;
// 3. Automatically, when the associated profile is destroyed. // 3. Automatically, when the associated profile is destroyed.
// //
// This class operates exclusively on the UI thread and so is not thread-safe. // This class operates exclusively on the UI thread and so is not thread-safe.
class OffscreenTab : public ProfileObserver, class OffscreenTab final : public ProfileObserver,
protected content::WebContentsDelegate, protected content::WebContentsDelegate,
protected content::WebContentsObserver { protected content::WebContentsObserver {
public: public:
......
...@@ -157,7 +157,7 @@ class PictureInPictureWindowControllerBrowserTest ...@@ -157,7 +157,7 @@ class PictureInPictureWindowControllerBrowserTest
EXPECT_FALSE(in_picture_in_picture); EXPECT_FALSE(in_picture_in_picture);
} }
class WidgetBoundsChangeWaiter : public views::WidgetObserver { class WidgetBoundsChangeWaiter final : public views::WidgetObserver {
public: public:
explicit WidgetBoundsChangeWaiter(views::Widget* widget) explicit WidgetBoundsChangeWaiter(views::Widget* widget)
: widget_(widget), initial_bounds_(widget->GetWindowBoundsInScreen()) { : widget_(widget), initial_bounds_(widget->GetWindowBoundsInScreen()) {
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_observer.h"
#include "ui/gfx/geometry/size.h" #include "ui/gfx/geometry/size.h"
class PictureInPictureWindowManager::ContentsObserver class PictureInPictureWindowManager::ContentsObserver final
: public content::WebContentsObserver { : public content::WebContentsObserver {
public: public:
ContentsObserver(PictureInPictureWindowManager* owner, ContentsObserver(PictureInPictureWindowManager* owner,
......
...@@ -19,7 +19,7 @@ namespace media_router { ...@@ -19,7 +19,7 @@ namespace media_router {
class StartPresentationContext; class StartPresentationContext;
} // namespace media_router } // namespace media_router
class PresentationRequestNotificationItem class PresentationRequestNotificationItem final
: public media_message_center::MediaNotificationItem { : public media_message_center::MediaNotificationItem {
public: public:
PresentationRequestNotificationItem( PresentationRequestNotificationItem(
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
// Once a Cast/Presentation session has been created, this class is no longer // Once a Cast/Presentation session has been created, this class is no longer
// involved; at that point CastMediaNotificationProvider become responsible for // involved; at that point CastMediaNotificationProvider become responsible for
// managing the notification for an active session. // managing the notification for an active session.
class PresentationRequestNotificationProvider class PresentationRequestNotificationProvider final
: public media_router::WebContentsPresentationManager::Observer, : public media_router::WebContentsPresentationManager::Observer,
public MediaNotificationServiceObserver { public MediaNotificationServiceObserver {
public: public:
......
...@@ -63,7 +63,7 @@ class PopupBrowserTest : public InProcessBrowserTest, ...@@ -63,7 +63,7 @@ class PopupBrowserTest : public InProcessBrowserTest,
INSTANTIATE_TEST_SUITE_P(All, PopupBrowserTest, ::testing::Bool()); INSTANTIATE_TEST_SUITE_P(All, PopupBrowserTest, ::testing::Bool());
// A helper class to wait for widget bounds changes beyond given thresholds. // A helper class to wait for widget bounds changes beyond given thresholds.
class WidgetBoundsChangeWaiter : public views::WidgetObserver { class WidgetBoundsChangeWaiter final : public views::WidgetObserver {
public: public:
WidgetBoundsChangeWaiter(views::Widget* widget, int move_by, int resize_by) WidgetBoundsChangeWaiter(views::Widget* widget, int move_by, int resize_by)
: widget_(widget), : widget_(widget),
......
...@@ -51,7 +51,7 @@ class WebAppSyncBridge; ...@@ -51,7 +51,7 @@ class WebAppSyncBridge;
// user_display_mode for their web apps to kBrowser after migration. This clean // user_display_mode for their web apps to kBrowser after migration. This clean
// up CL will erroneously undo such a change. To mitigate this we only run the // up CL will erroneously undo such a change. To mitigate this we only run the
// clean up once per migrated device. // clean up once per migrated device.
class WebAppMigrationUserDisplayModeCleanUp class WebAppMigrationUserDisplayModeCleanUp final
: public syncer::SyncServiceObserver { : public syncer::SyncServiceObserver {
public: public:
static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
......
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