Closed Bug 380674 Opened 18 years ago Closed 18 years ago

Move nsTObserverArray from content/* to xpcom/*

Categories

(Core :: XPCOM, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Assigned: smaug)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

nsTObserverArray would be useful outside gecko. I think the name should be changed too. nsTMutableArray is not right, nor is nsTIterativeArray, but the current name isn't good one either, IMO, if the class will be used also with objects that aren't observers (presShell are only sort of observers, bug 378776). What would be the right place, xpcom/ds or xpcom/glue? I guess the latter one where also nsTArray and nsVoidArray etc. are. Btw, if CVS move (with history data and all) is needed, I don't know how to do that.
nsTIterationSafeArray, nsTMutationSafeArray, nsTIterableArray.
Though, because observer array doesn't work like a normal array, maybe the current name is good enough.
Attached patch v1Splinter Review
Would this be ok? Do we want nsTObserverArray in SDK_HEADERS?
Attachment #264864 - Flags: review?
Attachment #264864 - Flags: review? → review?(benjamin)
Comment on attachment 264864 [details] [diff] [review] v1 >--- /dev/null 2007-05-12 20:28:07.458080988 +0300 >+++ xpcom/glue/nsTObserverArray.h 2007-05-15 13:22:54.000000000 +0300 >+// XXXbz I wish I didn't have to pass in the observer type, but I >+// don't see a way to get it out of array_. You can, actually. You just need a typedef in nsTObserverArray typedef T elementtype; (You might need "typename T" to get it to compile.) Then instead of having to specify obstype_, you can just use array_::elementtype
Attachment #264864 - Flags: review?(benjamin) → review+
Oh, good point! Let's do that, possibly as a followup!
Blocks: 381474
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee: nobody → Olli.Pettay
Status: REOPENED → NEW
Status: NEW → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
Flags: in-testsuite-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: