mark DEBUG only variables as ifdef DEBUG in content

ASSIGNED
Assigned to

Status

()

Core
DOM
ASSIGNED
7 years ago
7 years ago

People

(Reporter: timeless, Assigned: timeless)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
this is part of a crusade to get rid of compilation warnings
(Assignee)

Comment 1

7 years ago
Created attachment 463524 [details] [diff] [review]
using #ifdef DEBUG
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #463524 - Flags: review?(jst)
Comment on attachment 463524 [details] [diff] [review]
using #ifdef DEBUG

- In content/base/src/nsWebSocket.cpp:

+++ b/content/base/src/nsWebSocket.cpp
@@ -1731,10 +1731,12 @@ IMPL_RUNNABLE_ON_MAIN_THREAD_METHOD_BEGI
                "serialization list.");
 #endif
 
-  PRBool inserted =
-    !!(sWSsConnecting->InsertElementSorted(this, nsWSNetAddressComparator()));
-  NS_ASSERTION(inserted, "Couldn't insert the ws connection into the "
-                         "serialization list.");
+#ifdef DEBUG
+  nsRefPtr<nsWebSocketEstablishedConnection>* inserted =
+#endif
+    sWSsConnecting->InsertElementSorted(this, nsWSNetAddressComparator());
+  NS_ASSERTION(!!inserted, "Couldn't insert the ws connection into the "
+                           "serialization list.");

That should be a raw pointer and not an nsRefPtr to avoid causing differences in behavior here (i.e. more reference counting in debug builds for no good reason AFAICT).

r=jst with that.
Attachment #463524 - Flags: review?(jst) → review+
(Assignee)

Comment 3

7 years ago
  static nsTArray<nsRefPtr<nsWebSocketEstablishedConnection> >* sWSsConnecting;

because of the declaration, the returned object is an nsRefPtr and it will always be addref'd/released.
You need to log in before you can comment on or make changes to this bug.