Bug 1307331 - Use MOZ_MUST_USE in netwerk/protocol/data r=valentin
authorWei-Cheng Pan <wpan@mozilla.com>
Mon, 03 Oct 2016 14:54:01 +0800
changeset 343199 dbc29ba0397ba999b09d9142a95d2f8d93664e24
parent 343198 f13827811dccd8eb242c90d574448b5b3722e23f
child 343200 4dc7f22c700fdbfd0328e64e20be6b65408bb098
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1307331
milestone52.0a1
Bug 1307331 - Use MOZ_MUST_USE in netwerk/protocol/data r=valentin MozReview-Commit-ID: IikVyLjQN31
netwerk/ipc/NeckoParent.cpp
netwerk/protocol/data/DataChannelParent.h
netwerk/protocol/data/nsDataChannel.h
netwerk/protocol/data/nsDataHandler.h
--- a/netwerk/ipc/NeckoParent.cpp
+++ b/netwerk/ipc/NeckoParent.cpp
@@ -410,17 +410,17 @@ NeckoParent::DeallocPDataChannelParent(P
   return true;
 }
 
 bool
 NeckoParent::RecvPDataChannelConstructor(PDataChannelParent* actor,
                                          const uint32_t& channelId)
 {
   DataChannelParent* p = static_cast<DataChannelParent*>(actor);
-  p->Init(channelId);
+  MOZ_DIAGNOSTIC_ASSERT(p->Init(channelId));
   return true;
 }
 
 PRtspControllerParent*
 NeckoParent::AllocPRtspControllerParent()
 {
 #ifdef NECKO_PROTOCOL_rtsp
   RtspControllerParent* p = new RtspControllerParent();
--- a/netwerk/protocol/data/DataChannelParent.h
+++ b/netwerk/protocol/data/DataChannelParent.h
@@ -22,17 +22,17 @@ class DataChannelParent : public nsIPare
                         , public PDataChannelParent
 {
 public:
     NS_DECL_ISUPPORTS
     NS_DECL_NSIPARENTCHANNEL
     NS_DECL_NSIREQUESTOBSERVER
     NS_DECL_NSISTREAMLISTENER
 
-    bool Init(const uint32_t& aArgs);
+    MOZ_MUST_USE bool Init(const uint32_t& aArgs);
 
 private:
     ~DataChannelParent();
 
     virtual void ActorDestroy(ActorDestroyReason why) override;
 };
 
 } // namespace net
--- a/netwerk/protocol/data/nsDataChannel.h
+++ b/netwerk/protocol/data/nsDataChannel.h
@@ -15,13 +15,14 @@ class nsIInputStream;
 class nsDataChannel : public nsBaseChannel
 {
 public:
     explicit nsDataChannel(nsIURI *uri) {
         SetURI(uri);
     }
 
 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___ */
--- a/netwerk/protocol/data/nsDataHandler.h
+++ b/netwerk/protocol/data/nsDataHandler.h
@@ -19,23 +19,23 @@ public:
 
     // nsIProtocolHandler methods:
     NS_DECL_NSIPROTOCOLHANDLER
 
     // nsDataHandler methods:
     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___ */