Closed
Bug 174225
Opened 22 years ago
Closed 22 years ago
make NS_IMPL_OWNINGTHREAD (and NS_INIT_ISUPPORTS) unnecessary
Categories
(Core :: XPCOM, defect, P2)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla1.3alpha
People
(Reporter: dbaron, Assigned: dbaron)
References
Details
(Whiteboard: [patch])
Attachments
(1 file)
(deleted),
patch
|
dougt
:
review+
alecf
:
superreview+
|
Details | Diff | Splinter Review |
This is a followup to bug 166147. If we make NS_IMPL_OWNINGTHREAD (the debug
code for our threadsafety warnings) based on a class with a constructor, we can
make NS_IMPL_ISUPPORTS unnecessary and just remove it.
Assignee | ||
Comment 1•22 years ago
|
||
This isn't tested yet, since my build is only part of the way through.
Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: [patch]
Target Milestone: --- → mozilla1.3alpha
Assignee | ||
Comment 2•22 years ago
|
||
I've tested that the assertions still work by removing some "THREADSAFE_" in
places that need it in my tree, and seeing that assertions do fire.
Also, in comment 0, I meant NS_INIT_ISUPPORTS rather than NS_IMPL_ISUPPORTS.
Comment 3•22 years ago
|
||
Comment on attachment 102723 [details] [diff] [review]
patch
I am not sure that we should mark NS_INIT_ISUPPORTS deprecated or suggest that
developers not use this macro. This reason, although minor, is that it allows
us to hook into xpcom object constructors quite easily. For example, a bloat
too could redefine this macro to do something.
Thoughts?
Attachment #102723 -
Flags: review+
Assignee | ||
Comment 4•22 years ago
|
||
Anybody else who wants to hook in can just use the same method that this uses
and that the refcount uses (bug 166147) -- hook in via NS_DECL_ISUPPORTS and a
class with a constructor (and if they don't want to take up space, they could
use one of the two existing constructors created by this bug and bug 166147 --
one is used always and the other is #ifdef DEBUG).
(Am I the only one who finds NS_INIT_ISUPPORTS() somewhat ugly in a C++ world,
where member initializers are preferred to assigments in the constructor? I
also usually forget it when I'm implementing nsISupports.)
Comment 5•22 years ago
|
||
if there is another way, great. After thinking about this for a bit, the DECL
macro could probably do everything we need. Before you land this, please post
an announcement to the xpcom ng.
Assignee | ||
Comment 6•22 years ago
|
||
Comment 7•22 years ago
|
||
Comment on attachment 102723 [details] [diff] [review]
patch
nice! sr=alecf
Attachment #102723 -
Flags: superreview+
Assignee | ||
Updated•22 years ago
|
Summary: make NS_IMPL_OWNINGTHREAD unnecessary → make NS_IMPL_OWNINGTHREAD (and NS_IMPL_ISUPPORTS) unnecessary
Comment 8•22 years ago
|
||
GetThread should probably be a const function.
Assignee | ||
Updated•22 years ago
|
Summary: make NS_IMPL_OWNINGTHREAD (and NS_IMPL_ISUPPORTS) unnecessary → make NS_IMPL_OWNINGTHREAD (and NS_INIT_ISUPPORTS) unnecessary
Assignee | ||
Comment 9•22 years ago
|
||
Fix checked in to trunk, 2002-11-06 05:09 PDT, with bbaetz's comment addressed
by adding |const|.
I filed bug 178643 on eventually removing the uses of NS_INIT_ISUPPORTS from the
tree.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 10•22 years ago
|
||
Yay!
Comment 11•21 years ago
|
||
*** Bug 172845 has been marked as a duplicate of this bug. ***
You need to log in
before you can comment on or make changes to this bug.
Description
•