Bug 1307364 - Use MOZ_MUST_USE in netwerk/protocol/file r?valentin draft
authorWei-Cheng Pan <wpan@mozilla.com>
Mon, 03 Oct 2016 14:54:40 +0800
changeset 421007 ae2b82daf0187912641802c04b4bdfe3f8ace9d2
parent 420017 955840bfd3c20eb24dd5a01be27bdc55c489a285
child 532945 95b5d888d20a7c21b723ec40ff81e50309e6a490
push id31349
push userbmo:wpan@mozilla.com
push dateWed, 05 Oct 2016 04:02:02 +0000
reviewersvalentin
bugs1307364
milestone52.0a1
Bug 1307364 - Use MOZ_MUST_USE in netwerk/protocol/file r?valentin MozReview-Commit-ID: 4EaTsMOpy0n
netwerk/protocol/file/nsFileChannel.h
netwerk/protocol/file/nsFileProtocolHandler.h
--- a/netwerk/protocol/file/nsFileChannel.h
+++ b/netwerk/protocol/file/nsFileChannel.h
@@ -24,20 +24,22 @@ public:
 
 protected:
   ~nsFileChannel();
 
   // Called to construct a blocking file input stream for the given file.  This
   // 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.
-  nsresult MakeFileInputStream(nsIFile *file, nsCOMPtr<nsIInputStream> &stream,
-                               nsCString &contentType, bool async);
+  MOZ_MUST_USE nsresult MakeFileInputStream(nsIFile *file,
+                                            nsCOMPtr<nsIInputStream> &stream,
+                                            nsCString &contentType, bool async);
 
-  virtual nsresult OpenContentStream(bool async, nsIInputStream **result,
-                                     nsIChannel** channel) override;
+  virtual MOZ_MUST_USE nsresult OpenContentStream(bool async,
+                                                  nsIInputStream **result,
+                                                  nsIChannel** channel) override;
 
 private:
   nsCOMPtr<nsIInputStream> mUploadStream;
   int64_t mUploadLength;
 };
 
 #endif // !nsFileChannel_h__
--- a/netwerk/protocol/file/nsFileProtocolHandler.h
+++ b/netwerk/protocol/file/nsFileProtocolHandler.h
@@ -16,12 +16,12 @@ class nsFileProtocolHandler : public nsI
 
 public:
     NS_DECL_THREADSAFE_ISUPPORTS
     NS_DECL_NSIPROTOCOLHANDLER
     NS_DECL_NSIFILEPROTOCOLHANDLER
 
     nsFileProtocolHandler();
 
-    nsresult Init();
+    MOZ_MUST_USE nsresult Init();
 };
 
 #endif // !nsFileProtocolHandler_h__