Remove global observers functionality from the observer service

RESOLVED FIXED in Firefox 62

Status

()

enhancement
RESOLVED FIXED
Last year
Last year

People

(Reporter: gsvelto, Assigned: gsvelto)

Tracking

(Blocks 1 bug)

unspecified
mozilla62
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox62 fixed)

Details

Attachments

(1 attachment)

+++ This bug was initially created as a clone of Bug #1435683 +++

While working on bug 1435683 I stumbled upon a snippet of code in the observer service used to implement "global observers" [1] by sending *all* notifications to whatever observer registers the "*" string. It looked rather weird because it's bracketed by an #ifdef statement which happens to be always defined in the same file [2]. This behavior also seems to be undocumented.

Since this smelled like old cruft I decided to do some digging. First of all there doesn't seem to be any users of this code, neither in C++ nor in JS code. I did a bunch of grep's so I can't be 100% sure but looking at the observer service log I couldn't find runtime uses either when launching Firefox. Since I was curious who might have used it I hg blame'd this code only to find out that it was already present in version 1.

My take on this is that it's something ancient that we haven't been using for a while but we forgot to remove. If there are no opinions against the removal (or users I might have missed) I'll just cut it.

[1] https://searchfox.org/mozilla-central/rev/bf4def01bf8f6ff0d18f02f2d7e9efc73e12c63f/xpcom/ds/nsObserverService.cpp#300-305
[2] https://searchfox.org/mozilla-central/rev/bf4def01bf8f6ff0d18f02f2d7e9efc73e12c63f/xpcom/ds/nsObserverService.cpp#26
Assignee

Comment 1

Last year
Here's a try-run with that bit removed just to check if tests fail or something:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=4ec37998863a97b7fb1f506b0bbf868a1b36ee4b
Assignee

Comment 2

Last year
Alright, there doesn't seem to be any failures, let's remove this.
Assignee

Updated

Last year
Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Assignee

Updated

Last year
Blocks: 1435683
No longer depends on: 1435683

Comment 4

Last year
mozreview-review
Comment on attachment 8981085 [details]
Bug 1464252 - Remove global observers functionality from the observer service;

https://reviewboard.mozilla.org/r/247196/#review253288

Thank you!
Attachment #8981085 - Flags: review?(nfroyd) → review+

Comment 5

Last year
Pushed by gsvelto@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e70e3d46d441
Remove global observers functionality from the observer service; r=froydnj

Comment 6

Last year
bugherder
https://hg.mozilla.org/mozilla-central/rev/e70e3d46d441
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.