Bug 1756070 - Part 2: Apply modernize-use-override to dom/file r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D145662
This commit is contained in:
Kagami Sascha Rosylight
2022-05-06 09:00:27 +00:00
parent 29f4b19708
commit 77dc6a1017
26 changed files with 68 additions and 75 deletions

View File

@@ -57,24 +57,22 @@ class BaseBlobImpl : public BlobImpl {
mContentType.SetIsVoid(false);
}
virtual void GetName(nsAString& aName) const override;
void GetName(nsAString& aName) const override;
virtual void GetDOMPath(nsAString& aName) const override;
void GetDOMPath(nsAString& aName) const override;
virtual void SetDOMPath(const nsAString& aName) override;
void SetDOMPath(const nsAString& aName) override;
virtual int64_t GetLastModified(ErrorResult& aRv) override;
int64_t GetLastModified(ErrorResult& aRv) override;
virtual void GetMozFullPath(nsAString& aName,
SystemCallerGuarantee /* unused */,
ErrorResult& aRv) override;
void GetMozFullPath(nsAString& aName, SystemCallerGuarantee /* unused */,
ErrorResult& aRv) override;
virtual void GetMozFullPathInternal(nsAString& aFileName,
ErrorResult& aRv) override;
void GetMozFullPathInternal(nsAString& aFileName, ErrorResult& aRv) override;
virtual uint64_t GetSize(ErrorResult& aRv) override { return mLength; }
uint64_t GetSize(ErrorResult& aRv) override { return mLength; }
virtual void GetType(nsAString& aType) override;
void GetType(nsAString& aType) override;
size_t GetAllocationSize() const override { return 0; }
@@ -83,29 +81,26 @@ class BaseBlobImpl : public BlobImpl {
return GetAllocationSize();
}
virtual uint64_t GetSerialNumber() const override { return mSerialNumber; }
uint64_t GetSerialNumber() const override { return mSerialNumber; }
virtual already_AddRefed<BlobImpl> CreateSlice(uint64_t aStart,
uint64_t aLength,
const nsAString& aContentType,
ErrorResult& aRv) override {
already_AddRefed<BlobImpl> CreateSlice(uint64_t aStart, uint64_t aLength,
const nsAString& aContentType,
ErrorResult& aRv) override {
return nullptr;
}
virtual const nsTArray<RefPtr<BlobImpl>>* GetSubBlobImpls() const override {
const nsTArray<RefPtr<BlobImpl>>* GetSubBlobImpls() const override {
return nullptr;
}
virtual void CreateInputStream(nsIInputStream** aStream,
ErrorResult& aRv) override {
void CreateInputStream(nsIInputStream** aStream, ErrorResult& aRv) override {
aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);
}
virtual int64_t GetFileId() override;
int64_t GetFileId() override;
virtual void SetLazyData(const nsAString& aName,
const nsAString& aContentType, uint64_t aLength,
int64_t aLastModifiedDate) override {
void SetLazyData(const nsAString& aName, const nsAString& aContentType,
uint64_t aLength, int64_t aLastModifiedDate) override {
mName = aName;
mContentType = aContentType;
mLength = aLength;
@@ -113,16 +108,16 @@ class BaseBlobImpl : public BlobImpl {
mIsFile = !aName.IsVoid();
}
virtual bool IsMemoryFile() const override { return false; }
bool IsMemoryFile() const override { return false; }
virtual bool IsFile() const override { return mIsFile; }
bool IsFile() const override { return mIsFile; }
virtual void GetBlobImplType(nsAString& aBlobImplType) const override {
void GetBlobImplType(nsAString& aBlobImplType) const override {
aBlobImplType = u"BaseBlobImpl"_ns;
}
protected:
virtual ~BaseBlobImpl() = default;
~BaseBlobImpl() override = default;
/**
* Returns a new, effectively-unique serial number. This should be used

View File

@@ -321,7 +321,7 @@ class BlobBodyStreamHolder final : public BodyStreamHolder {
RefPtr<ReadableStream> mStream;
protected:
virtual ~BlobBodyStreamHolder() { NullifyStream(); }
~BlobBodyStreamHolder() override { NullifyStream(); }
};
NS_IMPL_CYCLE_COLLECTION_CLASS(BlobBodyStreamHolder)

View File

@@ -101,8 +101,8 @@ class Blob : public nsSupportsWeakReference, public nsWrapperCache {
const GlobalObject& aGlobal, const Optional<Sequence<BlobPart>>& aData,
const BlobPropertyBag& aBag, ErrorResult& aRv);
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
uint64_t GetSize(ErrorResult& aRv);

View File

@@ -33,7 +33,7 @@ class EmptyBlobImpl final : public BaseBlobImpl {
}
private:
~EmptyBlobImpl() = default;
~EmptyBlobImpl() override = default;
};
} // namespace dom

View File

@@ -56,8 +56,8 @@ class File final : public Blob {
// WebIDL methods
virtual JSObject* WrapObject(JSContext* cx,
JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* cx,
JS::Handle<JSObject*> aGivenProto) override;
// File constructor
static already_AddRefed<File> Constructor(const GlobalObject& aGlobal,
@@ -90,13 +90,13 @@ class File final : public Blob {
void GetMozFullPathInternal(nsAString& aName, ErrorResult& aRv);
protected:
virtual bool HasFileInterface() const override { return true; }
bool HasFileInterface() const override { return true; }
private:
// File constructor should never be used directly. Use Blob::Create or
// File::Create.
File(nsIGlobalObject* aGlobal, BlobImpl* aImpl);
~File();
~File() override;
};
} // namespace dom

View File

@@ -178,7 +178,7 @@ class FileBlobImpl::GetTypeRunnable final : public WorkerMainThreadRunnable {
}
private:
~GetTypeRunnable() = default;
~GetTypeRunnable() override = default;
RefPtr<FileBlobImpl> mBlobImpl;
const MutexAutoLock& mProofOfLock;

View File

@@ -68,7 +68,7 @@ class FileBlobImpl : public BlobImpl {
void GetType(nsAString& aType) override;
virtual void GetBlobImplType(nsAString& aBlobImplType) const override;
void GetBlobImplType(nsAString& aBlobImplType) const override;
size_t GetAllocationSize() const override { return 0; }
@@ -83,8 +83,8 @@ class FileBlobImpl : public BlobImpl {
return nullptr;
}
virtual void CreateInputStream(nsIInputStream** aInputStream,
ErrorResult& aRv) override;
void CreateInputStream(nsIInputStream** aInputStream,
ErrorResult& aRv) override;
int64_t GetFileId() override { return mFileId; }
@@ -116,7 +116,7 @@ class FileBlobImpl : public BlobImpl {
}
protected:
~FileBlobImpl() = default;
~FileBlobImpl() override = default;
// Create slice
FileBlobImpl(const FileBlobImpl* aOther, uint64_t aStart, uint64_t aLength,

View File

@@ -36,8 +36,8 @@ class FileList final : public nsISupports, public nsWrapperCache {
explicit FileList(nsISupports* aParent);
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
nsISupports* GetParentObject() { return mParent; }

View File

@@ -67,8 +67,8 @@ class FileReader final : public DOMEventTargetHelper,
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(FileReader,
DOMEventTargetHelper)
virtual JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
JSObject* WrapObject(JSContext* aCx,
JS::Handle<JSObject*> aGivenProto) override;
// WebIDL
static already_AddRefed<FileReader> Constructor(const GlobalObject& aGlobal);
@@ -121,7 +121,7 @@ class FileReader final : public DOMEventTargetHelper,
void InitialAsyncWait();
private:
virtual ~FileReader();
~FileReader() override;
// This must be in sync with dom/webidl/FileReader.webidl
enum eReadyState { EMPTY = 0, LOADING = 1, DONE = 2 };

View File

@@ -334,7 +334,7 @@ class ReadReadyRunnable final : public WorkerSyncRunnable {
}
private:
~ReadReadyRunnable() = default;
~ReadReadyRunnable() override = default;
};
// This class implements nsIInputStreamCallback and it will be called when the

View File

@@ -123,7 +123,7 @@ class MemoryBlobImpl final : public BaseBlobImpl {
size_t SizeOfExcludingThisEvenIfShared(MallocSizeOf) override { return 0; }
private:
~DataOwnerAdapter() = default;
~DataOwnerAdapter() override = default;
DataOwnerAdapter(DataOwner* aDataOwner, Span<const char> aData)
: mDataOwner(aDataOwner), mData(aData) {}
@@ -149,7 +149,7 @@ class MemoryBlobImpl final : public BaseBlobImpl {
MOZ_ASSERT(mDataOwner && mDataOwner->mData, "must have data");
}
~MemoryBlobImpl() = default;
~MemoryBlobImpl() override = default;
// Used when backed by a memory store
RefPtr<DataOwner> mDataOwner;

View File

@@ -91,7 +91,7 @@ class MultipartBlobImpl final : public BaseBlobImpl {
: BaseBlobImpl(aContentType, MULTIPARTBLOBIMPL_UNKNOWN_LENGTH),
mBlobImpls(std::move(aBlobImpls)) {}
~MultipartBlobImpl() = default;
~MultipartBlobImpl() override = default;
void SetLengthAndModifiedDate(const Maybe<bool>& aCrossOriginIsolated,
ErrorResult& aRv);

View File

@@ -54,7 +54,7 @@ class BlobCreationDoneRunnable final : public Runnable {
}
private:
~BlobCreationDoneRunnable() {
~BlobCreationDoneRunnable() override {
MOZ_ASSERT(mBlobStorage);
// If something when wrong, we still have to release these objects in the
// correct thread.
@@ -147,7 +147,7 @@ class WriteRunnable final : public Runnable {
MOZ_ASSERT(aData);
}
~WriteRunnable() { free(mData); }
~WriteRunnable() override { free(mData); }
RefPtr<MutableBlobStorage> mBlobStorage;
void* mData;
@@ -170,7 +170,7 @@ class CloseFileRunnable final : public Runnable {
}
private:
~CloseFileRunnable() {
~CloseFileRunnable() override {
if (mFD) {
PR_Close(mFD);
}
@@ -218,7 +218,7 @@ class CreateBlobRunnable final : public Runnable,
}
private:
~CreateBlobRunnable() {
~CreateBlobRunnable() override {
MOZ_ASSERT(mBlobStorage);
// If something when wrong, we still have to release data in the correct
// thread.
@@ -258,7 +258,7 @@ class LastRunnable final : public Runnable {
}
private:
~LastRunnable() {
~LastRunnable() override {
MOZ_ASSERT(mBlobStorage);
// If something when wrong, we still have to release data in the correct
// thread.

View File

@@ -77,7 +77,7 @@ class StreamBlobImpl final : public BaseBlobImpl, public nsIMemoryReporter {
int64_t aLastModifiedDate, uint64_t aLength,
const nsAString& aBlobImplType);
~StreamBlobImpl();
~StreamBlobImpl() override;
void MaybeRegisterMemoryReporter();

View File

@@ -43,7 +43,7 @@ class StringBlobImpl final : public BaseBlobImpl, public nsIMemoryReporter {
private:
StringBlobImpl(const nsACString& aData, const nsAString& aContentType);
~StringBlobImpl();
~StringBlobImpl() override;
nsCString mData;
};

View File

@@ -75,7 +75,7 @@ class TemporaryFileInputStream final : public nsFileInputStream {
MOZ_ASSERT(XRE_IsParentProcess());
}
~TemporaryFileInputStream() {
~TemporaryFileInputStream() override {
// Let's delete the file on the RemoteLazyInputStream Thread.
RefPtr<RemoteLazyInputStreamThread> thread =
RemoteLazyInputStreamThread::GetOrCreate();

View File

@@ -35,7 +35,7 @@ class TemporaryFileBlobImpl final : public FileBlobImpl {
}
protected:
~TemporaryFileBlobImpl();
~TemporaryFileBlobImpl() override;
private:
already_AddRefed<BlobImpl> CreateSlice(uint64_t aStart, uint64_t aLength,

View File

@@ -17,7 +17,7 @@ class FileCreatorChild final : public mozilla::dom::PFileCreatorChild {
public:
FileCreatorChild();
~FileCreatorChild();
~FileCreatorChild() override;
void SetPromise(Promise* aPromise);

View File

@@ -28,7 +28,7 @@ class FileCreatorParent final : public mozilla::dom::PFileCreatorParent {
const bool& aIsFromNsIFile);
private:
~FileCreatorParent();
~FileCreatorParent() override;
void ActorDestroy(ActorDestroyReason aWhy) override;

View File

@@ -70,7 +70,7 @@ class RemoteLazyInputStreamChild final : public PRemoteLazyInputStreamChild {
void Migrated();
private:
~RemoteLazyInputStreamChild();
~RemoteLazyInputStreamChild() override;
// Raw pointers because these streams keep this actor alive. When the last
// stream is unregister, the actor will be deleted. This list is protected by

View File

@@ -89,7 +89,7 @@ class RemoteLazyInputStreamParent final : public PRemoteLazyInputStreamParent {
RemoteLazyInputStreamParent(const nsID& aID, uint64_t aSize,
mozilla::net::SocketProcessParent* aManager);
~RemoteLazyInputStreamParent() = default;
~RemoteLazyInputStreamParent() override = default;
const nsID mID;
const uint64_t mSize;

View File

@@ -36,7 +36,7 @@ class TemporaryIPCBlobChild final : public PTemporaryIPCBlobChild {
const nsACString& aContentType, PRFileDesc* aFD);
private:
~TemporaryIPCBlobChild();
~TemporaryIPCBlobChild() override;
mozilla::ipc::IPCResult RecvFileDesc(const FileDescriptor& aFD);

View File

@@ -24,7 +24,7 @@ class TemporaryIPCBlobParent final : public PTemporaryIPCBlobParent {
mozilla::ipc::IPCResult CreateAndShareFile();
private:
~TemporaryIPCBlobParent();
~TemporaryIPCBlobParent() override;
mozilla::ipc::IPCResult RecvOperationFailed();

View File

@@ -51,17 +51,15 @@ class BlobURL final : public mozilla::net::nsSimpleURI {
NS_DECL_NSISERIALIZABLE
// Override CloneInternal() and EqualsInternal()
virtual nsresult CloneInternal(RefHandlingEnum aRefHandlingMode,
const nsACString& newRef,
nsIURI** aClone) override;
virtual nsresult EqualsInternal(nsIURI* aOther,
RefHandlingEnum aRefHandlingMode,
bool* aResult) override;
nsresult CloneInternal(RefHandlingEnum aRefHandlingMode,
const nsACString& newRef, nsIURI** aClone) override;
nsresult EqualsInternal(nsIURI* aOther, RefHandlingEnum aRefHandlingMode,
bool* aResult) override;
NS_IMETHOD_(void) Serialize(mozilla::ipc::URIParams& aParams) override;
// Override StartClone to hand back a BlobURL
virtual mozilla::net::nsSimpleURI* StartClone(
RefHandlingEnum refHandlingMode, const nsACString& newRef) override {
mozilla::net::nsSimpleURI* StartClone(RefHandlingEnum refHandlingMode,
const nsACString& newRef) override {
BlobURL* url = new BlobURL();
SetRefOnClone(url, refHandlingMode, newRef);
return url;
@@ -72,7 +70,7 @@ class BlobURL final : public mozilla::net::nsSimpleURI {
NS_IMETHOD Mutate(nsIURIMutator** _retval) override;
private:
virtual ~BlobURL() = default;
~BlobURL() override = default;
nsresult SetScheme(const nsACString& aProtocol) override;
bool Deserialize(const mozilla::ipc::URIParams&);

View File

@@ -23,7 +23,7 @@ class BlobURLChannel final : public nsBaseChannel {
BlobURLChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo);
private:
~BlobURLChannel();
~BlobURLChannel() override;
nsresult OpenContentStream(bool aAsync, nsIInputStream** aResult,
nsIChannel** aChannel) override;

View File

@@ -468,7 +468,7 @@ class ReleasingTimerHolder final : public Runnable,
explicit ReleasingTimerHolder(const nsACString& aURI)
: Runnable("ReleasingTimerHolder"), mURI(aURI) {}
~ReleasingTimerHolder() = default;
~ReleasingTimerHolder() override = default;
void RevokeURI() {
// Remove the shutting down blocker