Bug 1307360 - Use MOZ_MUST_USE in netwerk/protocol/device r?valentin draft
authorWei-Cheng Pan <wpan@mozilla.com>
Mon, 03 Oct 2016 14:54:10 +0800
changeset 421006 06fd0ad1f87459e208e4b6a4e9a90c724907eef2
parent 420017 955840bfd3c20eb24dd5a01be27bdc55c489a285
child 532944 56722f73f9a7fb7a20f62595f6fac7cb953369f8
push id31348
push userbmo:wpan@mozilla.com
push dateWed, 05 Oct 2016 03:58:53 +0000
reviewersvalentin
bugs1307360
milestone52.0a1
Bug 1307360 - Use MOZ_MUST_USE in netwerk/protocol/device r?valentin MozReview-Commit-ID: Kc7a7GksoZl
netwerk/protocol/device/AndroidCaptureProvider.h
netwerk/protocol/device/CameraStreamImpl.h
netwerk/protocol/device/nsDeviceCaptureProvider.h
netwerk/protocol/device/nsDeviceChannel.h
netwerk/protocol/device/nsDeviceProtocolHandler.h
--- a/netwerk/protocol/device/AndroidCaptureProvider.h
+++ b/netwerk/protocol/device/AndroidCaptureProvider.h
@@ -20,17 +20,17 @@ class AndroidCaptureProvider final : pub
   private:
     ~AndroidCaptureProvider();
 
   public:
     AndroidCaptureProvider();
 
     NS_DECL_THREADSAFE_ISUPPORTS
 
-    nsresult Init(nsACString& aContentType, nsCaptureParams* aParams, nsIInputStream** aStream) override;
+    MOZ_MUST_USE nsresult Init(nsACString& aContentType, nsCaptureParams* aParams, nsIInputStream** aStream) override;
     static AndroidCaptureProvider* sInstance;
 };
 
 class AndroidCameraInputStream final : public nsIAsyncInputStream, mozilla::net::CameraStreamImpl::FrameCallback {
   private:
     ~AndroidCameraInputStream();
 
   public:
--- a/netwerk/protocol/device/CameraStreamImpl.h
+++ b/netwerk/protocol/device/CameraStreamImpl.h
@@ -32,17 +32,17 @@ public:
     bool initNeeded() {
         return !mInit;
     }
 
     FrameCallback* GetFrameCallback() {
         return mCallback;
     }
 
-    bool Init(const nsCString& contentType, const uint32_t& camera, const uint32_t& width, const uint32_t& height, FrameCallback* callback);
+    MOZ_MUST_USE bool Init(const nsCString& contentType, const uint32_t& camera, const uint32_t& width, const uint32_t& height, FrameCallback* callback);
     void Close();
 
     uint32_t GetWidth() { return mWidth; }
     uint32_t GetHeight() { return mHeight; }
     uint32_t GetFps() { return mFps; }
 
     void takePicture(const nsAString& aFileName);
 
--- a/netwerk/protocol/device/nsDeviceCaptureProvider.h
+++ b/netwerk/protocol/device/nsDeviceCaptureProvider.h
@@ -18,14 +18,14 @@ struct nsCaptureParams {
   uint32_t height;
   uint32_t bpp;
   uint32_t camera;
 };
 
 class nsDeviceCaptureProvider : public nsISupports
 {
 public:
-  virtual nsresult Init(nsACString& aContentType,
-                        nsCaptureParams* aParams,
-                        nsIInputStream** aStream) = 0;
+  virtual MOZ_MUST_USE nsresult Init(nsACString& aContentType,
+                                     nsCaptureParams* aParams,
+                                     nsIInputStream** aStream) = 0;
 };
 
 #endif
--- a/netwerk/protocol/device/nsDeviceChannel.h
+++ b/netwerk/protocol/device/nsDeviceChannel.h
@@ -10,17 +10,17 @@
 
 class nsDeviceChannel : public nsBaseChannel
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
 
   nsDeviceChannel();
 
-  nsresult Init(nsIURI* uri);
-  nsresult OpenContentStream(bool aAsync,
-                             nsIInputStream **aStream,
-                             nsIChannel **aChannel) override;
+  MOZ_MUST_USE nsresult Init(nsIURI* uri);
+  MOZ_MUST_USE nsresult OpenContentStream(bool aAsync,
+                                          nsIInputStream **aStream,
+                                          nsIChannel **aChannel) override;
 
 protected:
   ~nsDeviceChannel();
 };
 #endif
--- a/netwerk/protocol/device/nsDeviceProtocolHandler.h
+++ b/netwerk/protocol/device/nsDeviceProtocolHandler.h
@@ -21,14 +21,14 @@ class nsDeviceProtocolHandler final : pu
   ~nsDeviceProtocolHandler() {}
 
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIPROTOCOLHANDLER
 
   nsDeviceProtocolHandler() {}
 
-  nsresult Init();
+  MOZ_MUST_USE nsresult Init();
 };
 
 } // namespace net
 } // namespace mozilla
 #endif