Closed Bug 245283 Opened 20 years ago Closed 20 years ago

Add a * topic for the observerservice

Categories

(Core :: XPCOM, enhancement)

x86
Windows XP
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: timeless)

Details

Attachments

(1 file)

There are many topics out there, but there's no easy way to fish for them.

dougt and I have decided that "*" would be a good topic to mean "I want them all".
I *so* hate this. Can't we use NSPR logging level 5 to discover observer topics?
If not, make this DEBUG-only?
Attachment #149785 - Flags: review?(dougt)
I kinda like it. :-)
Benjamin: why exactly do you "*so* hate this"?  it seems harmless enough to
me... what are your concerns?
I really don't like this because I'm afraid people might actually use it. 

Receiving all observer notifications will be a performance drag, and I haven't
seen a use-case other than "discovery" of observer topics, which should be
handled through documentation and can be worked-around through PRlogging.
Comment on attachment 149785 [details] [diff] [review]
support global observers, and sample consumer

Put the nsObserverLogger.js example in mozilla/xpcom/sample/.  Also, add a
license to the file.

Be prepared to disable if tb numbers go up.  Also, the logic in the if
statement needs a comment above it.
Attachment #149785 - Flags: review?(dougt) → review+
> Put the nsObserverLogger.js example in mozilla/xpcom/sample/.  Also, add a
> license to the file.

Hmm... that doesn't seem like the best place for this file.  xpcom/sample is an
isolated code sample that demonstrates how to write a basic component (in C++ or
JS) and create a basic executable that uses xpcom.  I think nsObserverLogger.js
would just be noise in that directory for anyone trying to use xpcom/sample as a
learning tool.  Perhaps we should have subdirectories, or perhaps this should
simply live elsewhere.  Either way, it seems wrong to lump them together.

btw, i also have a webprogresslistener.js file that i've been meaning to add to
the source tree.  i just haven't figured out a good place for it.  it seems like
we could have a collection of helpful components like these that live in some
gecko tools directory or something like that.
i think it is a okay sample of how to use js components and the nsIObserver
service.  
oh, absolutely... it's good to have samples.  but, should they all live in this
one directory?  it seems like xpcom/sample is nice because it demonstrates the
basics of interface and implementation without clutter.  there's great value in
that for newbies imo.
timeless, just land the code and forget about landing the sample.  maybe the
wiki is a better place.
mozilla/xpcom/ds/nsObserverService.cpp 	3.31 	
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: