aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/websocket.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-05-24 18:27:26 -0500
committerbors-servo <metajack+bors@gmail.com>2015-05-24 18:27:26 -0500
commit542519ebfd073662bc9421ac5fa0aa01ebc0d6fe (patch)
tree4f6814d089be78af598f1d9f536c18a6a61f8e54 /components/script/dom/websocket.rs
parent16f19b628fa630aab8cfd275a90128da7b59723b (diff)
parent5793add4cdc9e96930160dfc90025f43607f9f5d (diff)
downloadservo-542519ebfd073662bc9421ac5fa0aa01ebc0d6fe.tar.gz
servo-542519ebfd073662bc9421ac5fa0aa01ebc0d6fe.zip
Auto merge of #6174 - frewsxcv:cleanup-long-lines, r=SimonSapin
Part of https://github.com/servo/servo/issues/6041 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6174) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/websocket.rs')
-rw-r--r--components/script/dom/websocket.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs
index 94a65fc611f..c0c6a624862 100644
--- a/components/script/dom/websocket.rs
+++ b/components/script/dom/websocket.rs
@@ -162,7 +162,8 @@ impl WebSocket {
//Create everything necessary for starting the open asynchronous task, then begin the task.
let global_root = ws_root.global.root();
- let addr: Trusted<WebSocket> = Trusted::new(global_root.r().get_cx(), ws_root, global_root.r().script_chan().clone());
+ let addr: Trusted<WebSocket> =
+ Trusted::new(global_root.r().get_cx(), ws_root, global_root.r().script_chan().clone());
let open_task = box WebSocketTaskHandler::new(addr.clone(), WebSocketTask::Open);
global_root.r().script_chan().send(ScriptMsg::RunnableMsg(open_task)).unwrap();
//TODO: Spawn thread here for receive loop
@@ -200,7 +201,8 @@ impl<'a> WebSocketMethods for JSRef<'a, WebSocket> {
}
fn Send(self, data: Option<USVString>)-> Fallible<()>{
- /*TODO: This is not up to spec see http://html.spec.whatwg.org/multipage/comms.html search for "If argument is a string"
+ /*TODO: This is not up to spec see http://html.spec.whatwg.org/multipage/comms.html search for
+ "If argument is a string"
TODO: Need to buffer data
TODO: bufferedAmount attribute returns the size of the buffer in bytes -
this is a required attribute defined in the websocket.webidl file
@@ -240,9 +242,11 @@ impl<'a> WebSocketMethods for JSRef<'a, WebSocket> {
self.failed.set(true);
self.sendCloseFrame.set(true);
//Dispatch send task to send close frame
- //TODO: Sending here is just empty string, though no string is really needed. Another send, empty send, could be used.
+ //TODO: Sending here is just empty string, though no string is really needed. Another send, empty
+ // send, could be used.
let _ = self.Send(None);
- //Note: After sending the close message, the receive loop confirms a close message from the server and must fire a close event
+ //Note: After sending the close message, the receive loop confirms a close message from the server and
+ // must fire a close event
}
WebSocketRequestState::Open => {
//Closing handshake not started - still in open
@@ -257,7 +261,8 @@ impl<'a> WebSocketMethods for JSRef<'a, WebSocket> {
self.sendCloseFrame.set(true);
//Dispatch send task to send close frame
let _ = self.Send(None);
- //Note: After sending the close message, the receive loop confirms a close message from the server and must fire a close event
+ //Note: After sending the close message, the receive loop confirms a close message from the server and
+ // must fire a close event
}
}
Ok(()) //Return Ok