Bug 1966547 - Remove unnecessary virtual specifiers. r=nika,necko-reviewers,media-playback-reviewers,permissions-reviewers,timhuang,kershaw,padenot

clang 21 now warns about them.

Differential Revision: https://phabricator.services.mozilla.com/D249517
This commit is contained in:
Mike Hommey
2025-05-22 03:36:44 +00:00
committed by mh@glandium.org
parent 66ee19892a
commit c9818c67e7
33 changed files with 50 additions and 51 deletions

View File

@@ -30,7 +30,7 @@ class CanonicalBrowsingContext;
class BrowsingContextWebProgress final : public nsIWebProgress,
public nsIWebProgressListener {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(BrowsingContextWebProgress,
nsIWebProgress)
NS_DECL_NSIWEBPROGRESS
@@ -69,7 +69,7 @@ class BrowsingContextWebProgress final : public nsIWebProgress,
void DropBounceTrackingState();
private:
virtual ~BrowsingContextWebProgress();
~BrowsingContextWebProgress();
void UpdateAndNotifyListeners(
uint32_t aFlag,

View File

@@ -147,7 +147,7 @@ class DOMRectList final : public nsISupports, public nsWrapperCache {
public:
explicit DOMRectList(nsISupports* aParent) : mParent(aParent) {}
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DOMRectList)
JSObject* WrapObject(JSContext*, JS::Handle<JSObject*> aGivenProto) override;

View File

@@ -55,7 +55,7 @@ class nsNodeSupportsWeakRefTearoff final : public nsISupportsWeakReference {
explicit nsNodeSupportsWeakRefTearoff(nsINode* aNode) : mNode(aNode) {}
// nsISupports
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
// nsISupportsWeakReference
NS_DECL_NSISUPPORTSWEAKREFERENCE

View File

@@ -36,7 +36,7 @@ class Location final : public nsISupports,
explicit Location(nsPIDOMWindowInner* aWindow);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(Location)
// WebIDL API:
@@ -113,7 +113,7 @@ class Location final : public nsISupports,
void ClearCachedValues();
protected:
virtual ~Location();
~Location();
BrowsingContext* GetBrowsingContext() override;
nsIDocShell* GetDocShell() override;

View File

@@ -75,7 +75,7 @@ class ScriptTimeoutHandler : public TimeoutHandler {
class CallbackTimeoutHandler final : public TimeoutHandler {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CallbackTimeoutHandler)
CallbackTimeoutHandler(JSContext* aCx, nsIGlobalObject* aGlobal,

View File

@@ -34,7 +34,7 @@ class UserActivation final : public nsISupports, public nsWrapperCache {
public:
// WebIDL UserActivation
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(UserActivation)
explicit UserActivation(nsPIDOMWindowInner* aWindow);

View File

@@ -338,7 +338,7 @@ class nsGlobalWindowInner final : public mozilla::dom::EventTarget,
virtual bool HasActiveIndexedDBDatabases() const override;
virtual bool HasActivePeerConnections() override;
virtual bool HasOpenWebSockets() const override;
virtual void AudioPlaybackChanged(bool aIsPlayingAudio);
void AudioPlaybackChanged(bool aIsPlayingAudio);
virtual bool HasScheduledNormalOrHighPriorityWebTasks() const override;
void SyncStateFromParentWindow();
virtual void UpdateWebSocketCount(int32_t aDelta) override;

View File

@@ -20,7 +20,7 @@ class DebuggerNotificationObserver;
class DebuggerNotificationManager final : public nsISupports {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DebuggerNotificationManager)
static RefPtr<DebuggerNotificationManager> ForDispatch(

View File

@@ -22,7 +22,7 @@ class DebuggerNotification;
class DebuggerNotificationObserver final : public nsISupports,
public nsWrapperCache {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(DebuggerNotificationObserver)
static already_AddRefed<DebuggerNotificationObserver> Constructor(

View File

@@ -118,7 +118,7 @@ class JSActor : public nsISupports, public nsWrapperCache {
// message.
class QueryHandler final : public PromiseNativeHandler {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_CLASS(QueryHandler)
QueryHandler(JSActor* aActor, const JSActorMessageMeta& aMetadata,

View File

@@ -42,7 +42,7 @@ class MediaMetadata final : public nsISupports,
private MediaMetadataBase {
public:
// Ref counting and cycle collection
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaMetadata)
// WebIDL methods

View File

@@ -50,7 +50,7 @@ struct PositionState {
class MediaSession final : public nsIDocumentActivity, public nsWrapperCache {
public:
// Ref counting and cycle collection
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(MediaSession)
NS_DECL_NSIDOCUMENTACTIVITY

View File

@@ -76,7 +76,7 @@ class PDMFactory final {
};
private:
virtual ~PDMFactory();
~PDMFactory();
void CreatePDMs();
void CreateNullPDM();

View File

@@ -139,7 +139,7 @@ class ScriptLoader final : public JS::loader::ScriptLoaderInterface {
explicit ScriptLoader(Document* aDocument);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_CLASS(ScriptLoader)
/**
@@ -417,14 +417,13 @@ class ScriptLoader final : public JS::loader::ScriptLoaderInterface {
* @param aScriptFromHead Whether or not the script was a child of head
*/
virtual void PreloadURI(nsIURI* aURI, const nsAString& aCharset,
const nsAString& aType, const nsAString& aCrossOrigin,
const nsAString& aNonce,
const nsAString& aFetchPriority,
const nsAString& aIntegrity, bool aScriptFromHead,
bool aAsync, bool aDefer, bool aLinkPreload,
const ReferrerPolicy aReferrerPolicy,
uint64_t aEarlyHintPreloaderId);
void PreloadURI(nsIURI* aURI, const nsAString& aCharset,
const nsAString& aType, const nsAString& aCrossOrigin,
const nsAString& aNonce, const nsAString& aFetchPriority,
const nsAString& aIntegrity, bool aScriptFromHead,
bool aAsync, bool aDefer, bool aLinkPreload,
const ReferrerPolicy aReferrerPolicy,
uint64_t aEarlyHintPreloaderId);
/**
* Process a request that was deferred so that the script could be compiled
@@ -604,7 +603,7 @@ class ScriptLoader final : public JS::loader::ScriptLoaderInterface {
*
* This function is virtual to allow cross-library calls to SetEnabled()
*/
virtual void ProcessPendingRequestsAsync();
void ProcessPendingRequestsAsync();
void ProcessPendingRequestsAsyncBypassParserBlocking();

View File

@@ -120,7 +120,7 @@ class ScriptLoadData final
public nsISupports,
public SharedSubResourceCacheLoadingValueBase<ScriptLoadData> {
protected:
virtual ~ScriptLoadData() {}
~ScriptLoadData() {}
public:
ScriptLoadData(ScriptLoader* aLoader,

View File

@@ -78,7 +78,7 @@ class FeaturePolicy final : public nsISupports, public nsWrapperCache {
friend class FeaturePolicyUtils;
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(FeaturePolicy)
explicit FeaturePolicy(nsINode* aNode);

View File

@@ -44,7 +44,7 @@ class WindowContext;
class PermissionDelegateHandler final : public nsIPermissionDelegateHandler {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_CLASS(PermissionDelegateHandler)
NS_DECL_NSIPERMISSIONDELEGATEHANDLER

View File

@@ -225,7 +225,7 @@ class BufferRecycleBin final {
void RecycleBuffer(mozilla::UniquePtr<uint8_t[]> aBuffer, uint32_t aSize);
// Returns a recycled buffer of the right size, or allocates a new buffer.
mozilla::UniquePtr<uint8_t[]> GetBuffer(uint32_t aSize);
virtual void ClearRecycledBuffers();
void ClearRecycledBuffers();
private:
typedef mozilla::Mutex Mutex;

View File

@@ -49,7 +49,7 @@ class MemoryPressureObserver final : public nsIObserver {
private:
explicit MemoryPressureObserver(MemoryPressureListener* aListener);
virtual ~MemoryPressureObserver();
~MemoryPressureObserver();
MemoryPressureListener* mListener;
};

View File

@@ -87,7 +87,7 @@ class FluentBundle final : public nsWrapperCache {
nsTArray<ffi::L10nArg>& aRetVal);
protected:
virtual ~FluentBundle();
~FluentBundle();
nsCOMPtr<nsISupports> mParent;
UniquePtr<ffi::FluentBundleRc> mRaw;

View File

@@ -140,7 +140,7 @@ class L10nRegistry final : public nsWrapperCache {
const ffi::GeckoL10nRegistry* Raw() const { return mRaw; }
protected:
virtual ~L10nRegistry() = default;
~L10nRegistry() = default;
nsCOMPtr<nsIGlobalObject> mGlobal;
const RefPtr<const ffi::GeckoL10nRegistry> mRaw;
static bool PopulateError(ErrorResult& aError,

View File

@@ -236,10 +236,10 @@ class ModuleLoaderBase : public nsISupports {
* These are tracked in the mFetchingModules map.
*/
class LoadingRequest final : public nsISupports {
virtual ~LoadingRequest() = default;
~LoadingRequest() = default;
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_CLASS(LoadingRequest)
// The request that initiated the load and which is currently fetching or

View File

@@ -47,7 +47,7 @@ class nsTreeColumn final : public nsISupports, public nsWrapperCache {
NS_INLINE_DECL_STATIC_IID(NS_TREECOLUMN_IMPL_CID)
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsTreeColumn)
// WebIDL
@@ -155,7 +155,7 @@ class nsTreeColumns final : public nsISupports, public nsWrapperCache {
public:
explicit nsTreeColumns(nsTreeBodyFrame* aTree);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(nsTreeColumns)
nsIContent* GetParentObject() const;

View File

@@ -440,7 +440,7 @@ class Preferences final : public nsIPrefService,
bool AllowOffMainThreadSave();
private:
virtual ~Preferences();
~Preferences();
nsresult NotifyServiceObservers(const char* aSubject);

View File

@@ -136,7 +136,7 @@ class nsSocketTransportService final : public nsPISocketTransportService,
bool UpdatePortRemapPreference(nsACString const& aPortMappingPref);
protected:
virtual ~nsSocketTransportService();
~nsSocketTransportService();
private:
//-------------------------------------------------------------------------

View File

@@ -30,7 +30,7 @@ class nsNSSCertificate final : public nsIX509Cert,
explicit nsNSSCertificate(nsTArray<uint8_t>&& der);
private:
virtual ~nsNSSCertificate() = default;
~nsNSSCertificate() = default;
nsresult GetCertificateHash(nsAString& aFingerprint, SECOidTag aHashAlg);
mozilla::UniqueCERTCertificate GetOrInstantiateCert();

View File

@@ -33,7 +33,7 @@ class nsNSSCertificateDB final : public nsIX509CertDB
nsTArray<RefPtr<nsIX509Cert>>& aCertListOut);
protected:
virtual ~nsNSSCertificateDB() = default;
~nsNSSCertificateDB() = default;
private:
// Use this function to generate a default nickname for a user

View File

@@ -104,7 +104,7 @@ class nsNSSComponent final : public nsINSSComponent, public nsIObserver {
static void DoClearSSLExternalAndInternalSessionCache();
protected:
virtual ~nsNSSComponent();
~nsNSSComponent();
private:
nsresult InitializeNSS();

View File

@@ -34,7 +34,7 @@ class SessionStoreRestoreData final : public nsISessionStoreRestoreData {
};
private:
virtual ~SessionStoreRestoreData() = default;
~SessionStoreRestoreData() = default;
void AddFormEntry(bool aIsXPath, const nsAString& aIdOrXPath,
sessionstore::FormEntryValue aValue);

View File

@@ -492,10 +492,10 @@ class InterfaceNeedsThreadSafeRefCnt : public std::false_type {};
\
public:
#define NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL \
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_META(final) \
NS_IMETHOD_(void) DeleteCycleCollectable(void); \
\
#define NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL \
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_META(final) \
NS_METHOD_(void) DeleteCycleCollectable(void); \
\
public:
#define NS_DECL_CYCLE_COLLECTING_ISUPPORTS_META(...) \

View File

@@ -60,7 +60,7 @@ class nsArrayCC final : public nsArrayBase {
friend class nsArrayBase;
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsArrayCC, nsIMutableArray)
private:

View File

@@ -59,18 +59,18 @@ class nsHashPropertyBagOMT final : public nsHashPropertyBagBase {
protected:
// Doesn't need to dispatch to main thread because it cannot contain
// XPCVariants
virtual ~nsHashPropertyBagOMT() = default;
~nsHashPropertyBagOMT() = default;
};
/* A cycle collected nsHashPropertyBag for main-thread-only use. */
class nsHashPropertyBagCC final : public nsHashPropertyBagBase {
public:
nsHashPropertyBagCC() = default;
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsHashPropertyBagCC,
nsIWritablePropertyBag)
protected:
virtual ~nsHashPropertyBagCC() = default;
~nsHashPropertyBagCC() = default;
};
inline nsISupports* ToSupports(nsHashPropertyBagBase* aPropertyBag) {

View File

@@ -199,7 +199,7 @@ class nsVariant final : public nsVariantBase {
class nsVariantCC final : public nsVariantBase {
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTING_ISUPPORTS_FINAL
NS_DECL_CYCLE_COLLECTION_CLASS(nsVariantCC)
nsVariantCC() = default;