Closed Bug 801257 Opened 7 years ago Closed 7 years ago

System Message API: Page would wrongly handle messages to be sent to other pages

Categories

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

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla19
blocking-basecamp +
Tracking Status
firefox18 --- fixed
firefox19 --- fixed

People

(Reporter: airpingu, Assigned: airpingu)

References

Details

Attachments

(1 file, 2 obsolete files)

This only happens within the same App. When calling SystemMessageInternal.sendMessage(), it would send the message to all the pages that used to be registered in the _listeners[aManifestURI.spec], which is wrong. I think we need to add a check in the SystemMessageManager to handle only the message that has the matched page URI; otherwise, ignore it. This fix can also prevent this page from wrongly clearing the pending messages in other pages when sending back an acknowledgement later.
Assignee: nobody → clian
Attached patch Patch (obsolete) — Splinter Review
Hi Fabrice, 

Could you please review this when you have a chance? Changes are trivial. Please see comment #0 for why we need to fix that. In summary, pageA would wrongly handle the message that should be sent to pageB (within the same App).

Thanks Fabrice again!
Attachment #671050 - Flags: review?(fabrice)
Attached patch Patch 1.1 (obsolete) — Splinter Review
NIT: add braces for one line if-block.
Attachment #671050 - Attachment is obsolete: true
Attachment #671050 - Flags: review?(fabrice)
Attachment #671051 - Flags: review?(fabrice)
Attached patch Patch 1.1Splinter Review
Attachment #671051 - Attachment is obsolete: true
Attachment #671051 - Flags: review?(fabrice)
Attachment #671052 - Flags: review?(fabrice)
Attachment #671052 - Flags: review?(fabrice) → review+
blocking-basecamp: --- → ?
blocking-basecamp: ? → +
No, thanks. :)
Flags: in-testsuite? → in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/37fead15ae60
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.