Closed Bug 1323949 Opened 8 years ago Closed 8 years ago

Use MOZ_MUST_USE in netwerk/protocol/websocket

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: wcpan, Assigned: wcpan)

References

Details

(Whiteboard: [necko-would-take])

Attachments

(1 file)

Assignee: nobody → wpan
Blocks: 1303701
Whiteboard: [necko-would-take]
Comment on attachment 8824848 [details] Bug 1323949 - Use MOZ_MUST_USE in netwerk/protocol/websocket https://reviewboard.mozilla.org/r/103142/#review106266 ::: netwerk/protocol/websocket/WebSocketChannel.cpp:606 (Diff revision 1) > - mData); > + mData); > } else { > - mListenerMT->mListener->OnBinaryMessageAvailable(mListenerMT->mContext, > + rv = mListenerMT->mListener->OnBinaryMessageAvailable(mListenerMT->mContext, > - mData); > + mData); > } > + MOZ_ASSERT(NS_SUCCEEDED(rv)); NS_WARNING instead. I suspect both of these may fail during shutdown. ::: netwerk/protocol/websocket/WebSocketChannel.cpp:606 (Diff revision 1) > - mData); > + mData); > } else { > - mListenerMT->mListener->OnBinaryMessageAvailable(mListenerMT->mContext, > + rv = mListenerMT->mListener->OnBinaryMessageAvailable(mListenerMT->mContext, > - mData); > + mData); > } > + MOZ_ASSERT(NS_SUCCEEDED(rv)); NS_WARNING and/or LOG instead. I suspect both of these may fail during shutdown. ::: netwerk/protocol/websocket/WebSocketChannel.cpp:2951 (Diff revision 1) > LOG(("WebSocketChannel::StartWebsocketData Notifying Listener %p", > mListenerMT ? mListenerMT->mListener.get() : nullptr)); > > if (mListenerMT) { > - mListenerMT->mListener->OnStart(mListenerMT->mContext); > + rv = mListenerMT->mListener->OnStart(mListenerMT->mContext); > + MOZ_ASSERT(NS_SUCCEEDED(rv)); LOG it instead. ::: netwerk/protocol/websocket/WebSocketChannelChild.cpp:240 (Diff revision 1) > mEncrypted = aEncrypted; > > if (mListenerMT) { > AutoEventEnqueuer ensureSerialDispatch(mEventQ); > - mListenerMT->mListener->OnStart(mListenerMT->mContext); > + DebugOnly<nsresult> rv = mListenerMT->mListener->OnStart(mListenerMT->mContext); > + MOZ_ASSERT(NS_SUCCEEDED(rv)); use LOG() instead ::: netwerk/protocol/websocket/WebSocketChannelChild.cpp:280 (Diff revision 1) > LOG(("WebSocketChannelChild::RecvOnStop() %p\n", this)); > if (mListenerMT) { > AutoEventEnqueuer ensureSerialDispatch(mEventQ); > + DebugOnly<nsresult> rv = > - mListenerMT->mListener->OnStop(mListenerMT->mContext, aStatusCode); > + mListenerMT->mListener->OnStop(mListenerMT->mContext, aStatusCode); > + MOZ_ASSERT(NS_SUCCEEDED(rv)); LOG it instead ::: netwerk/protocol/websocket/WebSocketChannelChild.cpp:327 (Diff revision 1) > LOG(("WebSocketChannelChild::RecvOnMessageAvailable() %p\n", this)); > if (mListenerMT) { > AutoEventEnqueuer ensureSerialDispatch(mEventQ); > + DebugOnly<nsresult> rv = > - mListenerMT->mListener->OnMessageAvailable(mListenerMT->mContext, aMsg); > + mListenerMT->mListener->OnMessageAvailable(mListenerMT->mContext, aMsg); > + MOZ_ASSERT(NS_SUCCEEDED(rv)); May fail. Log it instead. NS_WARNING also good. ::: netwerk/protocol/websocket/WebSocketChannelChild.cpp:350 (Diff revision 1) > if (mListenerMT) { > AutoEventEnqueuer ensureSerialDispatch(mEventQ); > + DebugOnly<nsresult> rv = > - mListenerMT->mListener->OnBinaryMessageAvailable(mListenerMT->mContext, > + mListenerMT->mListener->OnBinaryMessageAvailable(mListenerMT->mContext, > - aMsg); > + aMsg); > + MOZ_ASSERT(NS_SUCCEEDED(rv)); May fail. Log it instead. NS_WARNING also ok. ::: netwerk/protocol/websocket/WebSocketChannelChild.cpp:390 (Diff revision 1) > LOG(("WebSocketChannelChild::RecvOnAcknowledge() %p\n", this)); > if (mListenerMT) { > AutoEventEnqueuer ensureSerialDispatch(mEventQ); > + DebugOnly<nsresult> rv = > - mListenerMT->mListener->OnAcknowledge(mListenerMT->mContext, aSize); > + mListenerMT->mListener->OnAcknowledge(mListenerMT->mContext, aSize); > + MOZ_ASSERT(NS_SUCCEEDED(rv)); LOG and/or NS_WARNING
Attachment #8824848 - Flags: review?(valentin.gosu) → review+
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: