[Bug 23327] New: MessagePort should provide onstart/onclose event handlers

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23327

            Bug ID: 23327
           Summary: MessagePort should provide onstart/onclose event
                    handlers
           Product: WebAppsWG
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DOM
          Assignee: annevk@annevk.nl
          Reporter: gene.lian@mozilla.com
        QA Contact: public-webapps-bugzilla@w3.org
                CC: bugs@pettay.fi, gene.lian@mozilla.com, ian@hixie.ch,
                    mike@w3.org, www-dom@w3.org

Please refer to [1] for the motivation.

It could be necessary and useful for a message port to know if the message port
on other end is started or closed, so that the message port can decide if it
needs to start or stop posting/receiving messages.

For example, through the message port, an Music App can post its now-playing
song info to the Lock Screen App and show it on the screen. However, the Lock
Screen App still needs a dynamic way to know if the message port on the Music
App side is still alive or not (message port can be dead when the Music App is
killed). Otherwise, the Lock Screen App would misunderstand the message port on
the Music App stops posting, but it is actually dead, thus failing to turn off
the now-playing song info.

We hope to add onstart/onclose event handlers in addition to onmessage, which
will be triggered when:

1. the message port on the other end explicitly calls start()/close() or
2. the message port is killed and the system will be in chage of firing
onstart/onclose events.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=915880

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Monday, 23 September 2013 11:40:16 UTC