summaryrefslogtreecommitdiff
path: root/netwerk/protocol
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-11-11 01:55:07 +0000
committerMoonchild <moonchild@palemoon.org>2023-11-11 01:55:07 +0000
commitc789882a294d29b3e5450a972ad67c4839c75e23 (patch)
tree4234880ff76df9da2caaf06983da144e42032a09 /netwerk/protocol
parent93eee35e84c29e1e64cb1531a0830b8ab2a7c5fa (diff)
parentf9ad6258221d89d8ee8e543c2ff8b21a42dbd285 (diff)
downloaduxp-c789882a294d29b3e5450a972ad67c4839c75e23.tar.gz
Merge pull request 'Replace MOZ_MUST_USE with [[nodiscard]]' (#2375) from 2342-nodiscard-work into master
Reviewed-on: https://repo.palemoon.org/MoonchildProductions/UXP/pulls/2375
Diffstat (limited to 'netwerk/protocol')
-rw-r--r--netwerk/protocol/about/nsAboutCache.h14
-rw-r--r--netwerk/protocol/about/nsAboutCacheEntry.h18
-rw-r--r--netwerk/protocol/about/nsAboutProtocolUtils.h2
-rw-r--r--netwerk/protocol/data/DataChannelParent.h2
-rw-r--r--netwerk/protocol/data/nsDataChannel.h6
-rw-r--r--netwerk/protocol/data/nsDataHandler.h12
-rw-r--r--netwerk/protocol/device/nsDeviceCaptureProvider.h6
-rw-r--r--netwerk/protocol/device/nsDeviceChannel.h8
-rw-r--r--netwerk/protocol/device/nsDeviceProtocolHandler.h2
-rw-r--r--netwerk/protocol/file/nsFileChannel.h12
-rw-r--r--netwerk/protocol/file/nsFileProtocolHandler.h2
-rw-r--r--netwerk/protocol/http/TunnelUtils.h2
-rw-r--r--netwerk/protocol/http/nsHttpChannel.h2
13 files changed, 44 insertions, 44 deletions
diff --git a/netwerk/protocol/about/nsAboutCache.h b/netwerk/protocol/about/nsAboutCache.h
index 6fb837eacd..a1fe77324f 100644
--- a/netwerk/protocol/about/nsAboutCache.h
+++ b/netwerk/protocol/about/nsAboutCache.h
@@ -49,10 +49,10 @@ public:
nsAboutCache() {}
- static MOZ_MUST_USE nsresult
+ [[nodiscard]] static nsresult
Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);
- static MOZ_MUST_USE nsresult
+ [[nodiscard]] static nsresult
GetStorage(nsACString const & storageName, nsILoadContextInfo* loadInfo,
nsICacheStorage **storage);
@@ -75,13 +75,13 @@ protected:
virtual ~Channel() {}
public:
- MOZ_MUST_USE nsresult Init(nsIURI* aURI, nsILoadInfo* aLoadInfo);
- MOZ_MUST_USE nsresult ParseURI(nsIURI * uri, nsACString & storage);
+ [[nodiscard]] nsresult Init(nsIURI* aURI, nsILoadInfo* aLoadInfo);
+ [[nodiscard]] nsresult ParseURI(nsIURI * uri, nsACString & storage);
// Finds a next storage we wish to visit (we use this method
// even there is a specified storage name, which is the only
// one in the list then.) Posts FireVisitStorage() when found.
- MOZ_MUST_USE nsresult VisitNextStorage();
+ [[nodiscard]] nsresult VisitNextStorage();
// Helper method that calls VisitStorage() for the current storage.
// When it fails, OnCacheEntryVisitCompleted is simulated to close
// the output stream and thus the about:cache channel.
@@ -89,13 +89,13 @@ protected:
// Kiks the visit cycle for the given storage, names can be:
// "disk", "memory", "appcache"
// Note: any newly added storage type has to be manually handled here.
- MOZ_MUST_USE nsresult VisitStorage(nsACString const & storageName);
+ [[nodiscard]] nsresult VisitStorage(nsACString const & storageName);
// Writes content of mBuffer to mStream and truncates
// the buffer. It may fail when the input stream is closed by canceling
// the input stream channel. It can be used to stop the cache iteration
// process.
- MOZ_MUST_USE nsresult FlushBuffer();
+ [[nodiscard]] nsresult FlushBuffer();
// Whether we are showing overview status of all available
// storages.
diff --git a/netwerk/protocol/about/nsAboutCacheEntry.h b/netwerk/protocol/about/nsAboutCacheEntry.h
index 8bfa0aa723..f770a9fa2e 100644
--- a/netwerk/protocol/about/nsAboutCacheEntry.h
+++ b/netwerk/protocol/about/nsAboutCacheEntry.h
@@ -53,20 +53,20 @@ private:
virtual ~Channel() {}
public:
- MOZ_MUST_USE nsresult Init(nsIURI* uri, nsILoadInfo* aLoadInfo);
-
- MOZ_MUST_USE nsresult GetContentStream(nsIURI *, nsIInputStream **);
- MOZ_MUST_USE nsresult OpenCacheEntry(nsIURI *);
- MOZ_MUST_USE nsresult OpenCacheEntry();
- MOZ_MUST_USE nsresult WriteCacheEntryDescription(nsICacheEntry *);
- MOZ_MUST_USE nsresult WriteCacheEntryUnavailable();
- MOZ_MUST_USE nsresult ParseURI(nsIURI *uri, nsACString &storageName,
+ [[nodiscard]] nsresult Init(nsIURI* uri, nsILoadInfo* aLoadInfo);
+
+ [[nodiscard]] nsresult GetContentStream(nsIURI *, nsIInputStream **);
+ [[nodiscard]] nsresult OpenCacheEntry(nsIURI *);
+ [[nodiscard]] nsresult OpenCacheEntry();
+ [[nodiscard]] nsresult WriteCacheEntryDescription(nsICacheEntry *);
+ [[nodiscard]] nsresult WriteCacheEntryUnavailable();
+ [[nodiscard]] nsresult ParseURI(nsIURI *uri, nsACString &storageName,
nsILoadContextInfo **loadInfo,
nsCString &enahnceID,
nsIURI **cacheUri);
void CloseContent();
- static MOZ_MUST_USE nsresult
+ [[nodiscard]] static nsresult
PrintCacheData(nsIInputStream *aInStream,
void *aClosure,
const char *aFromSegment,
diff --git a/netwerk/protocol/about/nsAboutProtocolUtils.h b/netwerk/protocol/about/nsAboutProtocolUtils.h
index c5946412b0..ec4e51e857 100644
--- a/netwerk/protocol/about/nsAboutProtocolUtils.h
+++ b/netwerk/protocol/about/nsAboutProtocolUtils.h
@@ -12,7 +12,7 @@
#include "nsServiceManagerUtils.h"
#include "prtime.h"
-inline MOZ_MUST_USE nsresult
+[[nodiscard]] inline nsresult
NS_GetAboutModuleName(nsIURI *aAboutURI, nsCString& aModule)
{
#ifdef DEBUG
diff --git a/netwerk/protocol/data/DataChannelParent.h b/netwerk/protocol/data/DataChannelParent.h
index 48c610d6a4..c36a3c8822 100644
--- a/netwerk/protocol/data/DataChannelParent.h
+++ b/netwerk/protocol/data/DataChannelParent.h
@@ -26,7 +26,7 @@ public:
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
- MOZ_MUST_USE bool Init(const uint32_t& aArgs);
+ [[nodiscard]] bool Init(const uint32_t& aArgs);
private:
~DataChannelParent();
diff --git a/netwerk/protocol/data/nsDataChannel.h b/netwerk/protocol/data/nsDataChannel.h
index c986fba1e9..b5599f0909 100644
--- a/netwerk/protocol/data/nsDataChannel.h
+++ b/netwerk/protocol/data/nsDataChannel.h
@@ -20,9 +20,9 @@ public:
}
protected:
- virtual MOZ_MUST_USE nsresult OpenContentStream(bool async,
- nsIInputStream **result,
- nsIChannel** channel);
+ [[nodiscard]] virtual nsresult OpenContentStream(bool async,
+ nsIInputStream **result,
+ nsIChannel** channel);
};
#endif /* nsDataChannel_h___ */
diff --git a/netwerk/protocol/data/nsDataHandler.h b/netwerk/protocol/data/nsDataHandler.h
index 75f873e174..3c4adbffa3 100644
--- a/netwerk/protocol/data/nsDataHandler.h
+++ b/netwerk/protocol/data/nsDataHandler.h
@@ -24,18 +24,18 @@ public:
nsDataHandler();
// Define a Create method to be used with a factory:
- static MOZ_MUST_USE nsresult
+ [[nodiscard]] static nsresult
Create(nsISupports* aOuter, const nsIID& aIID, void* *aResult);
// Parse a data: URI and return the individual parts
// (the given spec will temporarily be modified but will be returned
// to the original before returning)
// contentCharset and dataBuffer can be nullptr if they are not needed.
- static MOZ_MUST_USE nsresult ParseURI(nsCString& spec,
- nsCString& contentType,
- nsCString* contentCharset,
- bool& isBase64,
- nsCString* dataBuffer);
+ [[nodiscard]] static nsresult ParseURI(nsCString& spec,
+ nsCString& contentType,
+ nsCString* contentCharset,
+ bool& isBase64,
+ nsCString* dataBuffer);
};
#endif /* nsDataHandler_h___ */
diff --git a/netwerk/protocol/device/nsDeviceCaptureProvider.h b/netwerk/protocol/device/nsDeviceCaptureProvider.h
index 024f6689d6..423ef231b8 100644
--- a/netwerk/protocol/device/nsDeviceCaptureProvider.h
+++ b/netwerk/protocol/device/nsDeviceCaptureProvider.h
@@ -23,9 +23,9 @@ struct nsCaptureParams {
class nsDeviceCaptureProvider : public nsISupports
{
public:
- virtual MOZ_MUST_USE nsresult Init(nsACString& aContentType,
- nsCaptureParams* aParams,
- nsIInputStream** aStream) = 0;
+ [[nodiscard]] virtual nsresult Init(nsACString& aContentType,
+ nsCaptureParams* aParams,
+ nsIInputStream** aStream) = 0;
};
#endif
diff --git a/netwerk/protocol/device/nsDeviceChannel.h b/netwerk/protocol/device/nsDeviceChannel.h
index 8c3e447931..f58b2716b5 100644
--- a/netwerk/protocol/device/nsDeviceChannel.h
+++ b/netwerk/protocol/device/nsDeviceChannel.h
@@ -15,10 +15,10 @@ public:
nsDeviceChannel();
- MOZ_MUST_USE nsresult Init(nsIURI* uri);
- MOZ_MUST_USE nsresult OpenContentStream(bool aAsync,
- nsIInputStream **aStream,
- nsIChannel **aChannel) override;
+ [[nodiscard]] nsresult Init(nsIURI* uri);
+ [[nodiscard]] nsresult OpenContentStream(bool aAsync,
+ nsIInputStream **aStream,
+ nsIChannel **aChannel) override;
protected:
~nsDeviceChannel();
diff --git a/netwerk/protocol/device/nsDeviceProtocolHandler.h b/netwerk/protocol/device/nsDeviceProtocolHandler.h
index dee9b4f8f0..8188e3e9e0 100644
--- a/netwerk/protocol/device/nsDeviceProtocolHandler.h
+++ b/netwerk/protocol/device/nsDeviceProtocolHandler.h
@@ -26,7 +26,7 @@ public:
nsDeviceProtocolHandler() {}
- MOZ_MUST_USE nsresult Init();
+ [[nodiscard]] nsresult Init();
};
} // namespace net
diff --git a/netwerk/protocol/file/nsFileChannel.h b/netwerk/protocol/file/nsFileChannel.h
index 4f28b9ed01..090b4bb403 100644
--- a/netwerk/protocol/file/nsFileChannel.h
+++ b/netwerk/protocol/file/nsFileChannel.h
@@ -28,13 +28,13 @@ protected:
// method also returns a best guess at the content-type for the data stream.
// NOTE: If the channel has a type hint set, contentType will be left
// untouched. The caller should not use it in that case.
- MOZ_MUST_USE nsresult MakeFileInputStream(nsIFile *file,
- nsCOMPtr<nsIInputStream> &stream,
- nsCString &contentType, bool async);
+ [[nodiscard]] nsresult MakeFileInputStream(nsIFile *file,
+ nsCOMPtr<nsIInputStream> &stream,
+ nsCString &contentType, bool async);
- virtual MOZ_MUST_USE nsresult OpenContentStream(bool async,
- nsIInputStream **result,
- nsIChannel** channel) override;
+ [[nodiscard]] virtual nsresult OpenContentStream(bool async,
+ nsIInputStream **result,
+ nsIChannel** channel) override;
private:
nsCOMPtr<nsIInputStream> mUploadStream;
diff --git a/netwerk/protocol/file/nsFileProtocolHandler.h b/netwerk/protocol/file/nsFileProtocolHandler.h
index 211eb2873e..1da0713284 100644
--- a/netwerk/protocol/file/nsFileProtocolHandler.h
+++ b/netwerk/protocol/file/nsFileProtocolHandler.h
@@ -21,7 +21,7 @@ public:
nsFileProtocolHandler();
- MOZ_MUST_USE nsresult Init();
+ [[nodiscard]] nsresult Init();
};
#endif // !nsFileProtocolHandler_h__
diff --git a/netwerk/protocol/http/TunnelUtils.h b/netwerk/protocol/http/TunnelUtils.h
index 4a003082ec..2d56fb0932 100644
--- a/netwerk/protocol/http/TunnelUtils.h
+++ b/netwerk/protocol/http/TunnelUtils.h
@@ -122,7 +122,7 @@ public:
nsresult CommitToSegmentSize(uint32_t size, bool forceCommitment) override;
nsresult GetTransactionSecurityInfo(nsISupports **) override;
nsresult NudgeTunnel(NudgeTunnelCallback *callback);
- MOZ_MUST_USE nsresult SetProxiedTransaction(nsAHttpTransaction *aTrans,
+ [[nodiscard]] nsresult SetProxiedTransaction(nsAHttpTransaction *aTrans,
nsAHttpTransaction *aSpdyConnectTransaction = nullptr);
void newIODriver(nsIAsyncInputStream *aSocketIn,
nsIAsyncOutputStream *aSocketOut,
diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h
index 2681f34764..8ae7035822 100644
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -282,7 +282,7 @@ private:
bool RequestIsConditional();
nsresult BeginConnect();
void HandleBeginConnectContinue();
- MOZ_MUST_USE nsresult BeginConnectContinue();
+ [[nodiscard]] nsresult BeginConnectContinue();
nsresult ContinueBeginConnectWithResult();
void ContinueBeginConnect();
nsresult Connect();