mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1625828 - Replace MOZ_MUST_USE with [[nodiscard]] in image. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D68746 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
83187b55b3
commit
f749ec9f1f
@ -270,7 +270,7 @@ class ImageSurfaceCache {
|
||||
return bytes;
|
||||
}
|
||||
|
||||
MOZ_MUST_USE bool Insert(NotNull<CachedSurface*> aSurface) {
|
||||
[[nodiscard]] bool Insert(NotNull<CachedSurface*> aSurface) {
|
||||
MOZ_ASSERT(!mLocked || aSurface->IsPlaceholder() || aSurface->IsLocked(),
|
||||
"Inserting an unlocked surface for a locked image");
|
||||
return mSurfaces.Put(aSurface->GetSurfaceKey(),
|
||||
|
@ -49,8 +49,8 @@ class nsIconChannel final : public nsIChannel, public nsIStreamListener {
|
||||
nsCOMPtr<nsIStreamListener> mListener;
|
||||
bool mCanceled = false;
|
||||
|
||||
MOZ_MUST_USE nsresult MakeInputStream(nsIInputStream** _retval,
|
||||
bool nonBlocking);
|
||||
[[nodiscard]] nsresult MakeInputStream(nsIInputStream** _retval,
|
||||
bool nonBlocking);
|
||||
|
||||
nsresult ExtractIconInfoFromUrl(nsIFile** aLocalFile,
|
||||
uint32_t* aDesiredImageSize,
|
||||
|
@ -84,7 +84,7 @@ class nsMozIconURI final : public nsIMozIconURI,
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
MOZ_MUST_USE NS_IMETHOD Read(nsIObjectInputStream* aStream) override {
|
||||
[[nodiscard]] NS_IMETHOD Read(nsIObjectInputStream* aStream) override {
|
||||
return InitFromInputStream(aStream);
|
||||
}
|
||||
|
||||
|
@ -69,8 +69,8 @@ class nsIconChannel final : public nsIChannel, public nsIStreamListener {
|
||||
nsresult GetHIconFromFile(bool aNonBlocking, HICON* hIcon);
|
||||
nsresult GetHIconFromFile(nsIFile* aLocalFile, const nsAutoString& aPath,
|
||||
UINT aInfoFlags, HICON* hIcon);
|
||||
MOZ_MUST_USE nsresult MakeInputStream(nsIInputStream** _retval,
|
||||
bool aNonBlocking, HICON aIcon);
|
||||
[[nodiscard]] nsresult MakeInputStream(nsIInputStream** _retval,
|
||||
bool aNonBlocking, HICON aIcon);
|
||||
|
||||
// Functions specific to Vista and above
|
||||
protected:
|
||||
|
@ -239,7 +239,7 @@ class imgLoader final : public imgILoader,
|
||||
imgLoader();
|
||||
nsresult Init();
|
||||
|
||||
MOZ_MUST_USE nsresult LoadImage(
|
||||
[[nodiscard]] nsresult LoadImage(
|
||||
nsIURI* aURI, nsIURI* aInitialDocumentURI, nsIReferrerInfo* aReferrerInfo,
|
||||
nsIPrincipal* aLoadingPrincipal, uint64_t aRequestContextID,
|
||||
nsILoadGroup* aLoadGroup, imgINotificationObserver* aObserver,
|
||||
@ -248,10 +248,10 @@ class imgLoader final : public imgILoader,
|
||||
nsContentPolicyType aContentPolicyType, const nsAString& initiatorType,
|
||||
bool aUseUrgentStartForChannel, imgRequestProxy** _retval);
|
||||
|
||||
MOZ_MUST_USE nsresult
|
||||
LoadImageWithChannel(nsIChannel* channel, imgINotificationObserver* aObserver,
|
||||
nsISupports* aCX, nsIStreamListener** listener,
|
||||
imgRequestProxy** _retval);
|
||||
[[nodiscard]] nsresult LoadImageWithChannel(
|
||||
nsIChannel* channel, imgINotificationObserver* aObserver,
|
||||
nsISupports* aCX, nsIStreamListener** listener,
|
||||
imgRequestProxy** _retval);
|
||||
|
||||
static nsresult GetMimeTypeFromContent(const char* aContents,
|
||||
uint32_t aLength,
|
||||
|
@ -62,12 +62,12 @@ class imgRequest final : public nsIStreamListener,
|
||||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
|
||||
|
||||
MOZ_MUST_USE nsresult Init(nsIURI* aURI, nsIURI* aFinalURI,
|
||||
bool aHadInsecureRedirect, nsIRequest* aRequest,
|
||||
nsIChannel* aChannel, imgCacheEntry* aCacheEntry,
|
||||
nsISupports* aCX,
|
||||
nsIPrincipal* aTriggeringPrincipal,
|
||||
int32_t aCORSMode, nsIReferrerInfo* aReferrerInfo);
|
||||
[[nodiscard]] nsresult
|
||||
Init(nsIURI* aURI, nsIURI* aFinalURI, bool aHadInsecureRedirect,
|
||||
nsIRequest* aRequest, nsIChannel* aChannel,
|
||||
imgCacheEntry* aCacheEntry, nsISupports* aCX,
|
||||
nsIPrincipal* aTriggeringPrincipal, int32_t aCORSMode,
|
||||
nsIReferrerInfo* aReferrerInfo);
|
||||
|
||||
void ClearLoader();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user