summaryrefslogtreecommitdiff
path: root/uriloader
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-11-05 00:59:31 +0100
committerMoonchild <moonchild@palemoon.org>2023-11-08 13:49:51 +0100
commitccc8c3b988375858400e8cbb5cd3ed665ece7aa4 (patch)
tree0dfab44af42ba7db171eaff6893c6b543835fe5b /uriloader
parentd53992cc127fb85a63a23c01cd92347901bf2371 (diff)
downloaduxp-ccc8c3b988375858400e8cbb5cd3ed665ece7aa4.tar.gz
Issue #2342: Use [[nodiscard]] in /uriloader /widget
Also a few misc low-volume places.
Diffstat (limited to 'uriloader')
-rw-r--r--uriloader/base/nsDocLoader.h14
-rw-r--r--uriloader/base/nsURILoader.h10
-rw-r--r--uriloader/exthandler/ContentHandlerService.h2
-rw-r--r--uriloader/exthandler/ExternalHelperAppChild.h2
-rw-r--r--uriloader/exthandler/mac/nsDecodeAppleFile.h2
-rw-r--r--uriloader/exthandler/mac/nsMIMEInfoMac.h8
-rw-r--r--uriloader/exthandler/mac/nsOSHelperAppService.h6
-rw-r--r--uriloader/exthandler/nsExternalHelperAppService.h2
8 files changed, 23 insertions, 23 deletions
diff --git a/uriloader/base/nsDocLoader.h b/uriloader/base/nsDocLoader.h
index b469b8e079..1c50df24b1 100644
--- a/uriloader/base/nsDocLoader.h
+++ b/uriloader/base/nsDocLoader.h
@@ -58,7 +58,7 @@ public:
nsDocLoader();
- virtual MOZ_MUST_USE nsresult Init();
+ [[nodiscard]] virtual nsresult Init();
static already_AddRefed<nsDocLoader> GetAsDocLoader(nsISupports* aSupports);
// Needed to deal with ambiguous inheritance from nsISupports...
@@ -67,7 +67,7 @@ public:
}
// Add aDocLoader as a child to the docloader service.
- static MOZ_MUST_USE nsresult AddDocLoaderAsChildOfRoot(nsDocLoader* aDocLoader);
+ [[nodiscard]] static nsresult AddDocLoaderAsChildOfRoot(nsDocLoader* aDocLoader);
NS_DECL_ISUPPORTS
NS_DECL_NSIDOCUMENTLOADER
@@ -89,10 +89,10 @@ public:
// Remove aChild from our childlist. This nulls out the child's mParent
// pointer.
- MOZ_MUST_USE nsresult RemoveChildLoader(nsDocLoader *aChild);
+ [[nodiscard]] nsresult RemoveChildLoader(nsDocLoader *aChild);
// Add aChild to our child list. This will set aChild's mParent pointer to
// |this|.
- MOZ_MUST_USE nsresult AddChildLoader(nsDocLoader* aChild);
+ [[nodiscard]] nsresult AddChildLoader(nsDocLoader* aChild);
nsDocLoader* GetParent() const { return mParent; }
struct nsListenerInfo {
@@ -114,7 +114,7 @@ public:
protected:
virtual ~nsDocLoader();
- virtual MOZ_MUST_USE nsresult SetDocLoaderParent(nsDocLoader * aLoader);
+ [[nodiscard]] virtual nsresult SetDocLoaderParent(nsDocLoader * aLoader);
bool IsBusy();
@@ -166,7 +166,7 @@ protected:
nsIURI *aUri,
uint32_t aFlags);
- MOZ_MUST_USE bool RefreshAttempted(nsIWebProgress* aWebProgress,
+ [[nodiscard]] bool RefreshAttempted(nsIWebProgress* aWebProgress,
nsIURI *aURI,
int32_t aDelay,
bool aSameURI);
@@ -189,7 +189,7 @@ protected:
// Inform a parent docloader that aChild is about to call its onload
// handler.
- MOZ_MUST_USE bool ChildEnteringOnload(nsIDocumentLoader* aChild) {
+ [[nodiscard]] bool ChildEnteringOnload(nsIDocumentLoader* aChild) {
// It's ok if we're already in the list -- we'll just be in there twice
// and then the RemoveObject calls from ChildDoneWithOnload will remove
// us.
diff --git a/uriloader/base/nsURILoader.h b/uriloader/base/nsURILoader.h
index 2c5648dbae..3e92eec452 100644
--- a/uriloader/base/nsURILoader.h
+++ b/uriloader/base/nsURILoader.h
@@ -35,11 +35,11 @@ protected:
* Equivalent to nsIURILoader::openChannel, but allows specifying whether the
* channel is opened already.
*/
- MOZ_MUST_USE nsresult OpenChannel(nsIChannel* channel,
- uint32_t aFlags,
- nsIInterfaceRequestor* aWindowContext,
- bool aChannelOpen,
- nsIStreamListener** aListener);
+ [[nodiscard]] nsresult OpenChannel(nsIChannel* channel,
+ uint32_t aFlags,
+ nsIInterfaceRequestor* aWindowContext,
+ bool aChannelOpen,
+ nsIStreamListener** aListener);
/**
* we shouldn't need to have an owning ref count on registered
diff --git a/uriloader/exthandler/ContentHandlerService.h b/uriloader/exthandler/ContentHandlerService.h
index e39e89bc90..1781bbe69c 100644
--- a/uriloader/exthandler/ContentHandlerService.h
+++ b/uriloader/exthandler/ContentHandlerService.h
@@ -21,7 +21,7 @@ public:
NS_DECL_NSIHANDLERSERVICE
ContentHandlerService();
- MOZ_MUST_USE nsresult Init();
+ [[nodiscard]] nsresult Init();
static void nsIHandlerInfoToHandlerInfo(nsIHandlerInfo* aInfo, HandlerInfo* aHandlerInfo);
private:
diff --git a/uriloader/exthandler/ExternalHelperAppChild.h b/uriloader/exthandler/ExternalHelperAppChild.h
index 0e3b09848c..ee5057857e 100644
--- a/uriloader/exthandler/ExternalHelperAppChild.h
+++ b/uriloader/exthandler/ExternalHelperAppChild.h
@@ -32,7 +32,7 @@ public:
virtual bool RecvCancel(const nsresult& aStatus) override;
private:
virtual ~ExternalHelperAppChild();
- MOZ_MUST_USE nsresult DivertToParent(nsIDivertableChannel *divertable, nsIRequest *request);
+ [[nodiscard]] nsresult DivertToParent(nsIDivertableChannel *divertable, nsIRequest *request);
RefPtr<nsExternalAppHandler> mHandler;
nsresult mStatus;
diff --git a/uriloader/exthandler/mac/nsDecodeAppleFile.h b/uriloader/exthandler/mac/nsDecodeAppleFile.h
index cea2d701ec..8433b533af 100644
--- a/uriloader/exthandler/mac/nsDecodeAppleFile.h
+++ b/uriloader/exthandler/mac/nsDecodeAppleFile.h
@@ -83,7 +83,7 @@ public:
nsDecodeAppleFile();
virtual ~nsDecodeAppleFile();
- MOZ_MUST_USE nsresult Initialize(nsIOutputStream *output, nsIFile *file);
+ [[nodiscard]] nsresult Initialize(nsIOutputStream *output, nsIFile *file);
private:
#define MAX_BUFFERSIZE 1024
diff --git a/uriloader/exthandler/mac/nsMIMEInfoMac.h b/uriloader/exthandler/mac/nsMIMEInfoMac.h
index 298357f757..d301234c87 100644
--- a/uriloader/exthandler/mac/nsMIMEInfoMac.h
+++ b/uriloader/exthandler/mac/nsMIMEInfoMac.h
@@ -16,15 +16,15 @@ class nsMIMEInfoMac : public nsMIMEInfoImpl {
NS_IMETHOD LaunchWithFile(nsIFile* aFile);
protected:
- virtual MOZ_MUST_USE nsresult LoadUriInternal(nsIURI *aURI);
+ [[nodiscard]] virtual nsresult LoadUriInternal(nsIURI *aURI);
#ifdef DEBUG
- virtual MOZ_MUST_USE nsresult LaunchDefaultWithFile(nsIFile* aFile) {
+ [[nodiscard]] virtual nsresult LaunchDefaultWithFile(nsIFile* aFile) {
NS_NOTREACHED("do not call this method, use LaunchWithFile");
return NS_ERROR_UNEXPECTED;
}
#endif
- static MOZ_MUST_USE nsresult OpenApplicationWithURI(nsIFile *aApplication,
- const nsCString& aURI);
+ [[nodiscard]] static nsresult OpenApplicationWithURI(nsIFile *aApplication,
+ const nsCString& aURI);
NS_IMETHOD GetDefaultDescription(nsAString& aDefaultDescription);
diff --git a/uriloader/exthandler/mac/nsOSHelperAppService.h b/uriloader/exthandler/mac/nsOSHelperAppService.h
index 7371e1f42d..05e71d4b1b 100644
--- a/uriloader/exthandler/mac/nsOSHelperAppService.h
+++ b/uriloader/exthandler/mac/nsOSHelperAppService.h
@@ -36,10 +36,10 @@ public:
// platformAppPath --> a platform specific path to an application that we got out of the
// rdf data source. This can be a mac file spec, a unix path or a windows path depending on the platform
// aFile --> an nsIFile representation of that platform application path.
- virtual MOZ_MUST_USE nsresult GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile);
+ [[nodiscard]] virtual nsresult GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile);
- MOZ_MUST_USE nsresult OSProtocolHandlerExists(const char * aScheme,
- bool * aHandlerExists);
+ [[nodiscard]] nsresult OSProtocolHandlerExists(const char * aScheme,
+ bool * aHandlerExists);
private:
uint32_t mPermissions;
diff --git a/uriloader/exthandler/nsExternalHelperAppService.h b/uriloader/exthandler/nsExternalHelperAppService.h
index 13dcbb7122..7956b70b2d 100644
--- a/uriloader/exthandler/nsExternalHelperAppService.h
+++ b/uriloader/exthandler/nsExternalHelperAppService.h
@@ -67,7 +67,7 @@ public:
* Initializes internal state. Will be called automatically when
* this service is first instantiated.
*/
- MOZ_MUST_USE nsresult Init();
+ [[nodiscard]] nsresult Init();
/**
* Given a mimetype and an extension, looks up a mime info from the OS.