Open Bug 585008 Opened 14 years ago Updated 2 years ago

mark DEBUG only variables as ifdef DEBUG in content

Categories

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

x86
macOS
defect

Tracking

()

People

(Reporter: timeless, Unassigned)

References

Details

Attachments

(1 file)

this is part of a crusade to get rid of compilation warnings
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+
  static nsTArray<nsRefPtr<nsWebSocketEstablishedConnection> >* sWSsConnecting;

because of the declaration, the returned object is an nsRefPtr and it will always be addref'd/released.
Component: DOM → DOM: Core & HTML

The bug assignee is inactive on Bugzilla, so the assignee is being reset.

Assignee: timeless → nobody
Status: ASSIGNED → NEW
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: