nsIObserverService needs cleanup.

RESOLVED FIXED in mozilla1.0

Status

()

Core
XPCOM
RESOLVED FIXED
17 years ago
17 years ago

People

(Reporter: Judson Valeski, Assigned: dougt)

Tracking

Trunk
mozilla1.0
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
per API review meeting.
- rename to nsINotifierService
- nsIEnumerator needs to be turned into nsISimpleEnumerator
- first char in method names need to be lower case
- the key should be an atom rather than a string.
(Reporter)

Updated

17 years ago
Blocks: 68201
(Reporter)

Updated

17 years ago
Blocks: 68204

Comment 1

17 years ago
there was some discussion in another bug (I'll try to find it) about the
ownership model - right now, the observer service is smart enough to hold a weak
reference when the object supports weak refs, and to hold a strong ref when it
doesn't support it... the problem is that you may want to support weak
references for one object, but want the observer service to hold a strong
reference... 

see bug 66950 for some relevant discussion.

I'm imagining something like adding a boolean parameter to addObserver() which
specifies if you want a strong or weak reference.
No longer blocks: 68204
(Reporter)

Updated

17 years ago
Blocks: 68204
(Reporter)

Comment 2

17 years ago
nom. 0.9
Blocks: 64833
Keywords: mozilla0.9

Updated

17 years ago
Status: NEW → ASSIGNED
OS: Windows 2000 → All
Hardware: PC → All
Target Milestone: --- → mozilla0.9

Updated

17 years ago
No longer blocks: 64833
(Reporter)

Updated

17 years ago
No longer blocks: 68201, 68204

Updated

17 years ago
Target Milestone: mozilla0.9 → mozilla1.0
From bug 94349:

nsIObserverService doesn't handle element removal
during iteration. What happens is this:

1) nsAutoConfig also observes the "profile-after-change" topic (news to me) and
it is the first thing to register for that topic - before mfcEmbed.
2) When nsAutoConfig observes this change for the first time, it removes itself
as an  observer by calling nsIObserverService::RemoveObserver().
3) This causes the iteration to skip the next observer (mfcEmbed)

It needs to be possible for an observer to call RemoveObserver() from it's
Observe() method. If not, it at least needs to be documented in the API.
(Assignee)

Comment 4

17 years ago
the nsIObserver and nsIObserverService has been froze.  This address items 2,3
of the intial bug.  (1) was not done and imo doesn't need to be. (4), the topic
was changed to c strings.

Scott, this bug could be marked fix.  

The bug conrad points out is 94636

Comment 5

17 years ago
dougt, you did the work, you should get the FIXED :)
 reassigning to you and marking fixed..
Assignee: scc → dougt
Status: ASSIGNED → NEW

Comment 6

17 years ago
dougt fixed this.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.