Closed Bug 790593 Opened 7 years ago Closed 7 years ago

Allow to register a listener for profiler start/stop events

Categories

(Core :: Gecko Profiler, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file, 2 obsolete files)

No description provided.
Comment on attachment 660399 [details] [diff] [review]
Allow to register a listener for profiler start/stop events

Review of attachment 660399 [details] [diff] [review]:
-----------------------------------------------------------------

What do you think of exposing AddObserver to the IDL ehsan? I can see other occurrences in the code but I'm not certain it's much of a saver since the script still needs to know about all the events it cares about.

::: tools/profiler/nsIProfiler.idl
@@ +10,1 @@
>  [scriptable, uuid(e388fded-1321-41af-a988-861a2bc5cfc3)]

Update the uuid.
Attachment #660399 - Flags: review?(ehsan)
Attachment #660399 - Flags: review?(bgirard)
Attachment #660399 - Flags: review+
Updated uuid.
Attachment #660409 - Flags: review?(ehsan)
Attachment #660399 - Attachment is obsolete: true
Attachment #660399 - Flags: review?(ehsan)
Comment on attachment 660409 [details] [diff] [review]
Allow to register a listener for profiler start/stop events

Review of attachment 660409 [details] [diff] [review]:
-----------------------------------------------------------------

We usually don't add AddObserver/RemoveObserver methods like this unless the object handles notifying the observers itself.  For the purpose of this bug, you can just use the observer service (as you currently do) and let the observers register with the observer service directly.

Also, for consistency with most other notifications, I'd prefer topic names such as profiler-started, etc.
Attachment #660409 - Flags: review?(ehsan) → review-
Also moved where the notifications are sent, so that they are not emitted, e.g, when the profiler is stopped and stopProfiler is called.
Attachment #660586 - Flags: review?(ehsan)
Attachment #660409 - Attachment is obsolete: true
Attachment #660586 - Flags: review?(ehsan) → review+
Blocks: 792855
https://hg.mozilla.org/mozilla-central/rev/5543e5e5bcd3
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.