Closed Bug 777200 Opened 12 years ago Closed 12 years ago

SettingsChangeNotifier should only notify processes with settings-change listeners

Categories

(Core :: DOM: Device Interfaces, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla18
blocking-basecamp +

People

(Reporter: cjones, Assigned: gwagner)

References

Details

(Keywords: feature, Whiteboard: [WebAPI:P3][LOE:S])

Attachments

(1 file, 2 obsolete files)

Currently they're broadcast to all processes, if I'm reading things correctly.  We should only allow processes with settings-read permissions to listen to settings changes.

Christoph/Gregor, one of you guys want to take this?
Assignee: nobody → anygregor
Attached patch patch (obsolete) — Splinter Review
Attachment #645811 - Flags: review?(jones.chris.g)
Attachment #645811 - Flags: review?(jones.chris.g) → review+
This doesn't completely address the problem here, but Gregor says another patch is on the way.
Depends on: 777508
blocking-basecamp: --- → +
Whiteboard: [WebAPI:P3]
Comment on attachment 645811 [details] [diff] [review]
patch

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

::: dom/settings/SettingsChangeNotifier.jsm
@@ +38,5 @@
>  
>    receiveMessage: function(aMessage) {
>      debug("receiveMessage");
>      let msg = aMessage.json;
> +    let mm = aMessage.target.QueryInterface(Ci.nsIFrameMessageManager);

The QI is no longer needed (and nsIFrameMessageManager doesn't exist anymore anyway.)
Keywords: feature
Whiteboard: [WebAPI:P3] → [WebAPI:P3][LOE:S]
No longer blocks: 791910, 791911
Attached patch patch (obsolete) — Splinter Review
This versions makes some simplifications:

We have 2 notification systems for setting changes:
onsettingschange is called whenever a setting changes
addObserver can be used to listen to a single setting change.

It gets complicated to track all additions and removal of listeners so once somebody adds an observer, the process always gets notified.
I think the use-case of removing observers is pretty rare and we can ignore this.

If somebody adds an observer for a single setting, we also notify the process if another setting changed. We might want to change this if it becomes a problem.
Attachment #645811 - Attachment is obsolete: true
Attachment #663182 - Flags: review?(fabrice)
(In reply to Gregor Wagner [:gwagner] from comment #4)
> It gets complicated to track all additions and removal of listeners so once
> somebody adds an observer, the process always gets notified.
> I think the use-case of removing observers is pretty rare and we can ignore
> this.

Won't you have to deal with child processes dying (as in bug 791910)? Also, isn't it a little weird to send messages twice to a manager that happens to have two observers?
(In reply to Blake Kaplan (:mrbkap) from comment #6)
> (In reply to Gregor Wagner [:gwagner] from comment #4)
> > It gets complicated to track all additions and removal of listeners so once
> > somebody adds an observer, the process always gets notified.
> > I think the use-case of removing observers is pretty rare and we can ignore
> > this.
> 
> Won't you have to deal with child processes dying (as in bug 791910)?

Thats bug 777508.

 Also,
> isn't it a little weird to send messages twice to a manager that happens to
> have two observers?

Right we don't want this. I thought I have a test for it but let me check again.
Attached patch patchSplinter Review
Fixed the multiple register problem.
Attachment #663182 - Attachment is obsolete: true
Attachment #663182 - Flags: review?(fabrice)
Attachment #663207 - Flags: review?(fabrice)
Attachment #663207 - Flags: review?(fabrice) → review+
https://hg.mozilla.org/mozilla-central/rev/24e6cf3628ae
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
This was landed before bug 777508 (and obviously doesn't make use of that notification), so I'm removing the dependency here.
No longer depends on: 777508
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: