Skip to content

Move websocket creation to resource task - #8867

Merged
bors-servo merged 1 commit into
servo:masterfrom
nfallen:6638-websocket_loader
Dec 8, 2015
Merged

bors-servo merged 1 commit into
servo:masterfrom
nfallen:6638-websocket_loader

Conversation

@nfallen

@nfallen nfallen commented Dec 7, 2015

Copy link
Copy Markdown

This is a pull request for part of #6638

It includes the following changes:
-The websocket networking code (ie. making a connection, receiving data, and sending data) has been extracted out of components/script/dom/websocket.rs and into the new file components/net/websocket_loader.rs.
-websocket.rs now communicates with the resource task (components/net/resource_task.rs) to instruct it to initiate a new websocket connection

  • websocket_loader.rs now provides an API sent over an IPCChannel that allows websocket.rs to receive feedback about this process and to subsequently send and receive data

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 7, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #8861) made this pull request unmergeable. Please resolve the merge conflicts.

@highfive highfive added S-needs-rebase There are merge conflict errors. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Dec 7, 2015
@jdm jdm self-assigned this Dec 7, 2015
@nfallen
nfallen force-pushed the 6638-websocket_loader branch from 01957c0 to 93861c9 Compare December 7, 2015 18:18
@ghost ghost removed the S-needs-rebase There are merge conflict errors. label Dec 7, 2015
@jdm

jdm commented Dec 7, 2015

Copy link
Copy Markdown
Member

This looks really great! There are a couple changes we can make for efficiency, but I'm really happy with how this PR turned out :D
-S-awaiting-review +S-needs-code-changes


Reviewed 8 of 8 files at r1.
Review status: all files reviewed at latest revision, 8 unresolved discussions.


components/net/resource_task.rs, line 180 [r1] (raw file):
I'm not clear on what this is asking.


components/net/resource_task.rs, line 359 [r1] (raw file):
No need for mut here.


components/net/websocket_loader.rs, line 45 [r1] (raw file):
Let's call this connect instead.


components/net/websocket_loader.rs, line 57 [r1] (raw file):
Instead of creating these senders and receivers here and immediately sending them, we could create them in the DOM constructor and send the resource_action_receiver and resource_event_sender values as part of the initial connection request.


components/net/websocket_loader.rs, line 120 [r1] (raw file):
Let's use while let Ok(dom_action) = resource_action_receiver.recv() { instead.


components/script/dom/websocket.rs, line 143 [r1] (raw file):
I don't think we need the Arc<Mutex< anymore.


components/script/dom/websocket.rs, line 239 [r1] (raw file):
We should be able to store this in self.sender immediatlely, rather than holding on to it for the ConnectionEstablishedTask later.


components/servo/Cargo.lock, line 1159 [r1] (raw file):
We'll need to run ./mach update-cargo -p net in order to automatically update ports/cef/Cargo.lock and ports/gonk/Cargo.lock with these changes, too.


Comments from the review on Reviewable.io

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Dec 7, 2015
@nfallen

nfallen commented Dec 7, 2015

Copy link
Copy Markdown
Author

Made a new commit with the updates so you can see the changes more easily, but I can squash the commits when the PR is ready!

@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Dec 7, 2015
@jdm

jdm commented Dec 8, 2015

Copy link
Copy Markdown
Member

One last change required - please squash the commits together while doing so, and I'll merge it :)
-S-awaiting-review +S-needs-code-changes +S-needs-squash


Reviewed 6 of 6 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion.


components/net/websocket_loader.rs, line 45 [r1] (raw file):
connect?


Comments from the review on Reviewable.io

@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. S-needs-squash Some (or all) of the commits in the PR should be combined. and removed S-awaiting-review There is new code that needs to be reviewed. labels Dec 8, 2015
@nfallen
nfallen force-pushed the 6638-websocket_loader branch from a248e62 to e8c8277 Compare December 8, 2015 07:05
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Dec 8, 2015
@Ms2ger

Ms2ger commented Dec 8, 2015

Copy link
Copy Markdown
Contributor

@bors-servo r=jdm

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit e8c8277 has been approved by jdm

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit e8c8277 with merge 951ab56...

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-squash Some (or all) of the commits in the PR should be combined. labels Dec 8, 2015
bors-servo pushed a commit that referenced this pull request Dec 8, 2015
Move websocket creation to resource task

This is a pull request for part of #6638

It includes the following changes:
-The websocket networking code (ie. making a connection, receiving data, and sending data) has been extracted out of components/script/dom/websocket.rs and into the new file components/net/websocket_loader.rs.
-websocket.rs now communicates with the resource task (components/net/resource_task.rs) to instruct it to initiate a new websocket connection
- websocket_loader.rs now provides an API sent over an IPCChannel that allows websocket.rs to receive feedback about this process and to subsequently send and receive data

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8867)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit e8c8277 into servo:master Dec 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants