Closed Bug 1376951 Opened 7 years ago Closed 7 years ago

Let's use CheckedUint32 more broadly in WebSocket code

Categories

(Core :: DOM: Core & HTML, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: baku, Assigned: baku)

Details

Attachments

(1 file)

      No description provided.
Attached patch checked.patchSplinter Review
Attachment #8881968 - Flags: review?(michael)
Comment on attachment 8881968 [details] [diff] [review]
checked.patch

Review of attachment 8881968 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/WebSocket.cpp
@@ +851,5 @@
>    if (mDisconnectingOrDisconnected) {
>      return NS_OK;
>    }
>  
> +  MOZ_ASSERT(mWebSocket->mOutgoingBufferedAmount.isValid());

value() asserts this already - either change this to a RELEASE_ASSERT or remove this line. I'd prefer a RELEASE_ASSERT if we can afford the extra cost.

@@ +2176,5 @@
>        {
>          if (mListenerManager->HasListenersFor(MESSAGE_EVENT_STRING) ||
>              mListenerManager->HasListenersFor(ERROR_EVENT_STRING) ||
>              mListenerManager->HasListenersFor(CLOSE_EVENT_STRING) ||
> +            mOutgoingBufferedAmount.value() != 0) {

Consider release asserting the validity here?

@@ +2358,5 @@
>  uint32_t
>  WebSocket::BufferedAmount() const
>  {
>    AssertIsOnTargetThread();
> +  MOZ_ASSERT(mOutgoingBufferedAmount.isValid());

value() asserts this already - either change this to a RELEASE_ASSERT or remove this line. I'd prefer a RELEASE_ASSERT if we can afford the extra cost.
Attachment #8881968 - Flags: review?(michael) → review+
Pushed by amarchesini@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f938bf69a11f
Let's use CheckedUint32 more broadly in WebSocket code, r=mystor
https://hg.mozilla.org/mozilla-central/rev/f938bf69a11f
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.