зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
83187b55b3
Коммит
f749ec9f1f
|
@ -270,7 +270,7 @@ class ImageSurfaceCache {
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_MUST_USE bool Insert(NotNull<CachedSurface*> aSurface) {
|
[[nodiscard]] bool Insert(NotNull<CachedSurface*> aSurface) {
|
||||||
MOZ_ASSERT(!mLocked || aSurface->IsPlaceholder() || aSurface->IsLocked(),
|
MOZ_ASSERT(!mLocked || aSurface->IsPlaceholder() || aSurface->IsLocked(),
|
||||||
"Inserting an unlocked surface for a locked image");
|
"Inserting an unlocked surface for a locked image");
|
||||||
return mSurfaces.Put(aSurface->GetSurfaceKey(),
|
return mSurfaces.Put(aSurface->GetSurfaceKey(),
|
||||||
|
|
|
@ -49,8 +49,8 @@ class nsIconChannel final : public nsIChannel, public nsIStreamListener {
|
||||||
nsCOMPtr<nsIStreamListener> mListener;
|
nsCOMPtr<nsIStreamListener> mListener;
|
||||||
bool mCanceled = false;
|
bool mCanceled = false;
|
||||||
|
|
||||||
MOZ_MUST_USE nsresult MakeInputStream(nsIInputStream** _retval,
|
[[nodiscard]] nsresult MakeInputStream(nsIInputStream** _retval,
|
||||||
bool nonBlocking);
|
bool nonBlocking);
|
||||||
|
|
||||||
nsresult ExtractIconInfoFromUrl(nsIFile** aLocalFile,
|
nsresult ExtractIconInfoFromUrl(nsIFile** aLocalFile,
|
||||||
uint32_t* aDesiredImageSize,
|
uint32_t* aDesiredImageSize,
|
||||||
|
|
|
@ -84,7 +84,7 @@ class nsMozIconURI final : public nsIMozIconURI,
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
MOZ_MUST_USE NS_IMETHOD Read(nsIObjectInputStream* aStream) override {
|
[[nodiscard]] NS_IMETHOD Read(nsIObjectInputStream* aStream) override {
|
||||||
return InitFromInputStream(aStream);
|
return InitFromInputStream(aStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,8 +69,8 @@ class nsIconChannel final : public nsIChannel, public nsIStreamListener {
|
||||||
nsresult GetHIconFromFile(bool aNonBlocking, HICON* hIcon);
|
nsresult GetHIconFromFile(bool aNonBlocking, HICON* hIcon);
|
||||||
nsresult GetHIconFromFile(nsIFile* aLocalFile, const nsAutoString& aPath,
|
nsresult GetHIconFromFile(nsIFile* aLocalFile, const nsAutoString& aPath,
|
||||||
UINT aInfoFlags, HICON* hIcon);
|
UINT aInfoFlags, HICON* hIcon);
|
||||||
MOZ_MUST_USE nsresult MakeInputStream(nsIInputStream** _retval,
|
[[nodiscard]] nsresult MakeInputStream(nsIInputStream** _retval,
|
||||||
bool aNonBlocking, HICON aIcon);
|
bool aNonBlocking, HICON aIcon);
|
||||||
|
|
||||||
// Functions specific to Vista and above
|
// Functions specific to Vista and above
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -239,7 +239,7 @@ class imgLoader final : public imgILoader,
|
||||||
imgLoader();
|
imgLoader();
|
||||||
nsresult Init();
|
nsresult Init();
|
||||||
|
|
||||||
MOZ_MUST_USE nsresult LoadImage(
|
[[nodiscard]] nsresult LoadImage(
|
||||||
nsIURI* aURI, nsIURI* aInitialDocumentURI, nsIReferrerInfo* aReferrerInfo,
|
nsIURI* aURI, nsIURI* aInitialDocumentURI, nsIReferrerInfo* aReferrerInfo,
|
||||||
nsIPrincipal* aLoadingPrincipal, uint64_t aRequestContextID,
|
nsIPrincipal* aLoadingPrincipal, uint64_t aRequestContextID,
|
||||||
nsILoadGroup* aLoadGroup, imgINotificationObserver* aObserver,
|
nsILoadGroup* aLoadGroup, imgINotificationObserver* aObserver,
|
||||||
|
@ -248,10 +248,10 @@ class imgLoader final : public imgILoader,
|
||||||
nsContentPolicyType aContentPolicyType, const nsAString& initiatorType,
|
nsContentPolicyType aContentPolicyType, const nsAString& initiatorType,
|
||||||
bool aUseUrgentStartForChannel, imgRequestProxy** _retval);
|
bool aUseUrgentStartForChannel, imgRequestProxy** _retval);
|
||||||
|
|
||||||
MOZ_MUST_USE nsresult
|
[[nodiscard]] nsresult LoadImageWithChannel(
|
||||||
LoadImageWithChannel(nsIChannel* channel, imgINotificationObserver* aObserver,
|
nsIChannel* channel, imgINotificationObserver* aObserver,
|
||||||
nsISupports* aCX, nsIStreamListener** listener,
|
nsISupports* aCX, nsIStreamListener** listener,
|
||||||
imgRequestProxy** _retval);
|
imgRequestProxy** _retval);
|
||||||
|
|
||||||
static nsresult GetMimeTypeFromContent(const char* aContents,
|
static nsresult GetMimeTypeFromContent(const char* aContents,
|
||||||
uint32_t aLength,
|
uint32_t aLength,
|
||||||
|
|
|
@ -62,12 +62,12 @@ class imgRequest final : public nsIStreamListener,
|
||||||
NS_DECL_NSIINTERFACEREQUESTOR
|
NS_DECL_NSIINTERFACEREQUESTOR
|
||||||
NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
|
NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK
|
||||||
|
|
||||||
MOZ_MUST_USE nsresult Init(nsIURI* aURI, nsIURI* aFinalURI,
|
[[nodiscard]] nsresult
|
||||||
bool aHadInsecureRedirect, nsIRequest* aRequest,
|
Init(nsIURI* aURI, nsIURI* aFinalURI, bool aHadInsecureRedirect,
|
||||||
nsIChannel* aChannel, imgCacheEntry* aCacheEntry,
|
nsIRequest* aRequest, nsIChannel* aChannel,
|
||||||
nsISupports* aCX,
|
imgCacheEntry* aCacheEntry, nsISupports* aCX,
|
||||||
nsIPrincipal* aTriggeringPrincipal,
|
nsIPrincipal* aTriggeringPrincipal, int32_t aCORSMode,
|
||||||
int32_t aCORSMode, nsIReferrerInfo* aReferrerInfo);
|
nsIReferrerInfo* aReferrerInfo);
|
||||||
|
|
||||||
void ClearLoader();
|
void ClearLoader();
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче