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 {
// Observes the offline item collection's content provider and then invokes the
// associated test callbacks when one has been provided.
class OfflineContentProviderObserver : public OfflineContentProvider::Observer {
class OfflineContentProviderObserver final
: public OfflineContentProvider::Observer {
public:
using ItemsAddedCallback =
base::OnceCallback<void(const std::vector<OfflineItem>&)>;
......
......@@ -27,7 +27,7 @@ namespace {
// An implementation of the BrowsingDataMediaLicenseHelper interface that
// determine data on media licenses in a given |filesystem_context| and
// returns a list of MediaLicenseInfo items to a client.
class BrowsingDataMediaLicenseHelperImpl
class BrowsingDataMediaLicenseHelperImpl final
: public BrowsingDataMediaLicenseHelper {
public:
// BrowsingDataMediaLicenseHelper implementation
......
......@@ -14,7 +14,7 @@ using ManagementAuthorityTrustworthiness =
class Profile;
class BrowserCloudManagementStatusProvider
class BrowserCloudManagementStatusProvider final
: public policy::ManagementStatusProvider {
public:
BrowserCloudManagementStatusProvider();
......@@ -23,7 +23,7 @@ class BrowserCloudManagementStatusProvider
EnterpriseManagementAuthority GetAuthority() final;
};
class LocalBrowserManagementStatusProvider
class LocalBrowserManagementStatusProvider final
: public policy::ManagementStatusProvider {
public:
LocalBrowserManagementStatusProvider();
......@@ -32,7 +32,7 @@ class LocalBrowserManagementStatusProvider
EnterpriseManagementAuthority GetAuthority() final;
};
class ProfileCloudManagementStatusProvider
class ProfileCloudManagementStatusProvider final
: public policy::ManagementStatusProvider {
public:
explicit ProfileCloudManagementStatusProvider(Profile* profile);
......
......@@ -22,7 +22,7 @@ extern const char* const kStableChromecastExtensionId;
// Extension ids for the chromecast.
extern const char* const kChromecastExtensionIds[6];
class TabCaptureCaptureFunction : public ExtensionFunction {
class TabCaptureCaptureFunction final : public ExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("tabCapture.capture", TABCAPTURE_CAPTURE)
......@@ -33,7 +33,7 @@ class TabCaptureCaptureFunction : public ExtensionFunction {
ResponseAction Run() final;
};
class TabCaptureGetCapturedTabsFunction : public ExtensionFunction {
class TabCaptureGetCapturedTabsFunction final : public ExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("tabCapture.getCapturedTabs",
TABCAPTURE_GETCAPTUREDTABS)
......@@ -45,7 +45,7 @@ class TabCaptureGetCapturedTabsFunction : public ExtensionFunction {
ResponseAction Run() final;
};
class TabCaptureCaptureOffscreenTabFunction : public ExtensionFunction {
class TabCaptureCaptureOffscreenTabFunction final : public ExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("tabCapture.captureOffscreenTab",
TABCAPTURE_CAPTUREOFFSCREENTAB)
......@@ -62,7 +62,7 @@ class TabCaptureCaptureOffscreenTabFunction : public ExtensionFunction {
ResponseAction Run() final;
};
class TabCaptureGetMediaStreamIdFunction : public ExtensionFunction {
class TabCaptureGetMediaStreamIdFunction final : public ExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("tabCapture.getMediaStreamId",
TABCAPTURE_GETMEDIASTREAMID)
......
......@@ -37,7 +37,8 @@ using media::mojom::RemotingStartFailReason;
using media::mojom::RemotingStopReason;
using media::mojom::RemotingSinkMetadata;
class CastRemotingConnector::RemotingBridge : public media::mojom::Remoter {
class CastRemotingConnector::RemotingBridge final
: public media::mojom::Remoter {
public:
// Constructs a "bridge" to delegate calls between the given |source| and
// |connector|. |connector| must be valid at the time of construction, but is
......
......@@ -75,7 +75,7 @@ class MediaRouter;
// Please see the unit tests in cast_remoting_connector_unittest.cc as a
// reference for how CastRemotingConnector and a MediaRemoter interact to
// start/execute/stop remoting sessions.
class CastRemotingConnector : public base::SupportsUserData::Data,
class CastRemotingConnector final : public base::SupportsUserData::Data,
public media::mojom::RemotingSource {
public:
~CastRemotingConnector() final;
......
......@@ -48,7 +48,7 @@ constexpr base::TimeDelta kPollInterval = base::TimeDelta::FromSeconds(1);
// capture functionality. The WebContents native view, although attached to the
// window tree, does not become visible on-screen (until it is properly made
// 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:
explicit WindowAdoptionAgent(aura::Window* content_window)
: content_window_(content_window) {
......
......@@ -43,7 +43,7 @@ class BrowserContext;
// 3. Automatically, when the associated profile is destroyed.
//
// 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::WebContentsObserver {
public:
......
......@@ -157,7 +157,7 @@ class PictureInPictureWindowControllerBrowserTest
EXPECT_FALSE(in_picture_in_picture);
}
class WidgetBoundsChangeWaiter : public views::WidgetObserver {
class WidgetBoundsChangeWaiter final : public views::WidgetObserver {
public:
explicit WidgetBoundsChangeWaiter(views::Widget* widget)
: widget_(widget), initial_bounds_(widget->GetWindowBoundsInScreen()) {
......
......@@ -11,7 +11,7 @@
#include "content/public/browser/web_contents_observer.h"
#include "ui/gfx/geometry/size.h"
class PictureInPictureWindowManager::ContentsObserver
class PictureInPictureWindowManager::ContentsObserver final
: public content::WebContentsObserver {
public:
ContentsObserver(PictureInPictureWindowManager* owner,
......
......@@ -19,7 +19,7 @@ namespace media_router {
class StartPresentationContext;
} // namespace media_router
class PresentationRequestNotificationItem
class PresentationRequestNotificationItem final
: public media_message_center::MediaNotificationItem {
public:
PresentationRequestNotificationItem(
......
......@@ -38,7 +38,7 @@
// Once a Cast/Presentation session has been created, this class is no longer
// involved; at that point CastMediaNotificationProvider become responsible for
// managing the notification for an active session.
class PresentationRequestNotificationProvider
class PresentationRequestNotificationProvider final
: public media_router::WebContentsPresentationManager::Observer,
public MediaNotificationServiceObserver {
public:
......
......@@ -63,7 +63,7 @@ class PopupBrowserTest : public InProcessBrowserTest,
INSTANTIATE_TEST_SUITE_P(All, PopupBrowserTest, ::testing::Bool());
// A helper class to wait for widget bounds changes beyond given thresholds.
class WidgetBoundsChangeWaiter : public views::WidgetObserver {
class WidgetBoundsChangeWaiter final : public views::WidgetObserver {
public:
WidgetBoundsChangeWaiter(views::Widget* widget, int move_by, int resize_by)
: widget_(widget),
......
......@@ -51,7 +51,7 @@ class WebAppSyncBridge;
// 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
// clean up once per migrated device.
class WebAppMigrationUserDisplayModeCleanUp
class WebAppMigrationUserDisplayModeCleanUp final
: public syncer::SyncServiceObserver {
public:
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