Closed
Bug 913761
Opened 12 years ago
Closed 12 years ago
Something is wrong when transferring MessagePort object via MessageChannel
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: sunhaitao, Assigned: baku)
Details
Attachments
(1 file)
|
8.13 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; rv:26.0) Gecko/20100101 Firefox/26.0 (Beta/Release)
Build ID: 20130903144150
Steps to reproduce:
0 Make sure 'dom.messageChannel.enabled' is set to true;
1 Open Scratchpad
2 Run the following code:
var transportChannel = new MessageChannel();
transportChannel.port1.onmessage = function (event) {
console.log('Port Returned.');
var portToService = (event.ports || event.data.ports)[0];
portToService.onmessage = function (event) {
console.log(event.data);
};
portToService.postMessage('READY?');
}
var serviceChannel = new MessageChannel();
serviceChannel.port1.onmessage = function (event) {
if (event.data == 'READY?') {
this.postMessage('READY!');
}
}
//Actually, this should be (See Bug 912456):
//transportChannel.port2.postMessage(null, [serviceChannel.port2]);
transportChannel.port2.postMessage({ports:[serviceChannel.port2]});
Actual results:
Only 'Port Returned.' is printed in console.
Expected results:
Both 'Port Returned.' and 'READY!' are printed.
| Assignee | ||
Comment 1•12 years ago
|
||
Thanks for this bug and the piece of code for reproducing it.
Attachment #801096 -
Flags: review?(bugs)
Comment 2•12 years ago
|
||
Comment on attachment 801096 [details] [diff] [review]
patch
Could we someone guarantee that Cloned port without owner window isn't
ever used by JS?
Perhaps add a method to nsDOMEventTargetHelper which sets
mHasOrHasHadOwner to true and call it in Clone()
Attachment #801096 -
Flags: review?(bugs) → review+
| Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → amarchesini
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 7 → All
Hardware: x86 → All
Comment 3•12 years ago
|
||
(Yet another) reminder - your commit message should say what your patch is doing, not restating the bug summary.
https://hg.mozilla.org/integration/mozilla-inbound/rev/1585fa81edfc
Flags: in-testsuite+
Keywords: checkin-needed
Comment 4•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•