Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement cross-thread postMessage #15679
Conversation
highfive
commented
Feb 21, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Feb 21, 2017
|
cc @jdm |
|
|
6ea3d04
to
53043b3
|
|
53043b3
to
73acf86
73acf86
to
72cd111
|
|
72cd111
to
f560c80
|
r=me |
| @@ -1795,6 +1799,21 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> | |||
| } | |||
| } | |||
|
|
|||
| fn handle_post_message_msg(&mut self, frame_id: FrameId, origin: Option<ImmutableOrigin>, data: Vec<u8>) { | |||
| let pipeline_id = match self.frames.get(&frame_id) { | |||
| None => return warn!("postMessage to closed frame {}.", frame_id), | |||
This comment has been minimized.
This comment has been minimized.
emilio
Mar 15, 2017
Member
(As a side note, I seriously believe that we should convert all these to panics during testing).
This comment has been minimized.
This comment has been minimized.
asajeffrey
Mar 15, 2017
Author
Member
That's an interesting idea. These warnings can happen during correct execution (e.g. post a message to an iframe's content window after it's been removed from the frame tree) but I don't think that should come up in wpt testing. File an issue?
| @@ -0,0 +1,13 @@ | |||
| <!DOCTYPE html> | |||
| <html> | |||
| <head> | |||
This comment has been minimized.
This comment has been minimized.
emilio
Mar 15, 2017
Member
A lot of the tags here (and in the other tests) can go away and would make this a bit less noisy, but your choice :)
This comment has been minimized.
This comment has been minimized.
| <body> | ||
| <script> | ||
| window.addEventListener("message", function(e) { | ||
| window.location.href = e.data; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| // child1 is a dissimilar-origin document | ||
| var childURL1 = new URL("cross-origin-postMessage-child1.html", document.location); | ||
| childURL1.hostname = "127.0.0.1"; | ||
| // child2 is a same-orogin document |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks for the quick review! |
| @@ -1795,6 +1799,21 @@ impl<Message, LTF, STF> Constellation<Message, LTF, STF> | |||
| } | |||
| } | |||
|
|
|||
| fn handle_post_message_msg(&mut self, frame_id: FrameId, origin: Option<ImmutableOrigin>, data: Vec<u8>) { | |||
| let pipeline_id = match self.frames.get(&frame_id) { | |||
| None => return warn!("postMessage to closed frame {}.", frame_id), | |||
This comment has been minimized.
This comment has been minimized.
asajeffrey
Mar 15, 2017
Author
Member
That's an interesting idea. These warnings can happen during correct execution (e.g. post a message to an iframe's content window after it's been removed from the frame tree) but I don't think that should come up in wpt testing. File an issue?
| @@ -0,0 +1,13 @@ | |||
| <!DOCTYPE html> | |||
| <html> | |||
| <head> | |||
This comment has been minimized.
This comment has been minimized.
| <body> | ||
| <script> | ||
| window.addEventListener("message", function(e) { | ||
| window.location.href = e.data; |
This comment has been minimized.
This comment has been minimized.
| // child1 is a dissimilar-origin document | ||
| var childURL1 = new URL("cross-origin-postMessage-child1.html", document.location); | ||
| childURL1.hostname = "127.0.0.1"; | ||
| // child2 is a same-orogin document |
This comment has been minimized.
This comment has been minimized.
f560c80
to
f9c5d0c
|
@bors-servo r=emilio |
|
|
Implement cross-thread postMessage <!-- Please describe your changes on the following line: --> This PR implements cross-thread postMessage, It builds on #15438 and #15478, only the last commit is part of this PR. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15679) <!-- Reviewable:end -->
|
|
asajeffrey commentedFeb 21, 2017
•
edited by larsbergstrom
This PR implements cross-thread postMessage,
It builds on #15438 and #15478, only the last commit is part of this PR.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is