Closed Bug 988787 Opened 10 years ago Closed 10 years ago

Should fire "handle-system-messages-done" at a correct time point

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla31

People

(Reporter: airpingu, Assigned: airpingu)

References

Details

Attachments

(1 file)

      No description provided.
Attached patch PatchSplinter Review
I noticed this bug when I'm trying to solve bug 874353. To be honest, I don't have a good solution to strip out "handle-system-messages-done" for now but I'm sure the way of firing it is wrong.

The reason is, imaging if we have two consecutive messages that need to be dispatched. When the first one is handled, the second one will be queued and returned by _dispatchMessage(). This will make the original notification fail:

  if (!dispatcher || !dispatcher.isHandling) {
    Services.obs.notifyObservers(/* aSubject */ null,
                                 "handle-system-messages-done",
                                 /* aData */ null);
  }

because |dispatcher.isHandling| is true. We should move it to a better time point to fire. Otherwise, the ContentChild/ContentParent will rely on the 30-second timeout to release the CPU wake lock, which is power consuming.

"handle-system-messages-done" has to be fired when the last message has been handled for sure.
Attachment #8397735 - Flags: review?(fabrice)
Blocks: 874353
Attachment #8397735 - Flags: review?(fabrice) → review+
https://hg.mozilla.org/mozilla-central/rev/b8dc4e025d76
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Depends on: 1013671
No longer depends on: 1013671
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: