From d82b36b981a3fcafada807bf57ca0e1fb14491e1 Mon Sep 17 00:00:00 2001 From: Wei-Cheng Pan Date: Mon, 3 Oct 2016 14:54:01 +0800 Subject: [PATCH] Bug 1307331 - Use MOZ_MUST_USE in netwerk/protocol/data r=valentin MozReview-Commit-ID: IikVyLjQN31 --HG-- extra : rebase_source : 574d28a6534c4a0e0ed92576896d9404e671fa7d --- netwerk/ipc/NeckoParent.cpp | 2 +- netwerk/protocol/data/DataChannelParent.h | 2 +- netwerk/protocol/data/nsDataChannel.h | 5 +++-- netwerk/protocol/data/nsDataHandler.h | 12 ++++++------ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/netwerk/ipc/NeckoParent.cpp b/netwerk/ipc/NeckoParent.cpp index 595745cc8600..7a673f85d98a 100644 --- a/netwerk/ipc/NeckoParent.cpp +++ b/netwerk/ipc/NeckoParent.cpp @@ -415,7 +415,7 @@ NeckoParent::RecvPDataChannelConstructor(PDataChannelParent* actor, const uint32_t& channelId) { DataChannelParent* p = static_cast(actor); - p->Init(channelId); + MOZ_DIAGNOSTIC_ASSERT(p->Init(channelId)); return true; } diff --git a/netwerk/protocol/data/DataChannelParent.h b/netwerk/protocol/data/DataChannelParent.h index e75fa737ed47..415672a44445 100644 --- a/netwerk/protocol/data/DataChannelParent.h +++ b/netwerk/protocol/data/DataChannelParent.h @@ -27,7 +27,7 @@ public: NS_DECL_NSIREQUESTOBSERVER NS_DECL_NSISTREAMLISTENER - bool Init(const uint32_t& aArgs); + MOZ_MUST_USE bool Init(const uint32_t& aArgs); private: ~DataChannelParent(); diff --git a/netwerk/protocol/data/nsDataChannel.h b/netwerk/protocol/data/nsDataChannel.h index 20bf861fed5e..c986fba1e99d 100644 --- a/netwerk/protocol/data/nsDataChannel.h +++ b/netwerk/protocol/data/nsDataChannel.h @@ -20,8 +20,9 @@ public: } protected: - virtual nsresult OpenContentStream(bool async, nsIInputStream **result, - nsIChannel** channel); + virtual MOZ_MUST_USE 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 e46190c249e5..75f873e17418 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 nsresult + static MOZ_MUST_USE 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 nsresult ParseURI(nsCString& spec, - nsCString& contentType, - nsCString* contentCharset, - bool& isBase64, - nsCString* dataBuffer); + static MOZ_MUST_USE nsresult ParseURI(nsCString& spec, + nsCString& contentType, + nsCString* contentCharset, + bool& isBase64, + nsCString* dataBuffer); }; #endif /* nsDataHandler_h___ */