aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/websocket.rs
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2015-08-27 22:15:54 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2015-08-27 22:27:43 +0200
commit709d347872e37ab2358e057d24557b9977238ecd (patch)
tree89f726bf207325eea8a8ca316f6d77d8c88432cb /components/script/dom/websocket.rs
parent856fda7f2e3fe4abd6de247e8bdaf8cedf3764c2 (diff)
downloadservo-709d347872e37ab2358e057d24557b9977238ecd.tar.gz
servo-709d347872e37ab2358e057d24557b9977238ecd.zip
Make the traits for the IDL interfaces take &self
Diffstat (limited to 'components/script/dom/websocket.rs')
-rw-r--r--components/script/dom/websocket.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs
index 59d11e239d2..f92d484c4e5 100644
--- a/components/script/dom/websocket.rs
+++ b/components/script/dom/websocket.rs
@@ -226,34 +226,34 @@ impl WebSocket {
}
}
-impl<'a> WebSocketMethods for &'a WebSocket {
+impl WebSocketMethods for WebSocket {
event_handler!(open, GetOnopen, SetOnopen);
event_handler!(close, GetOnclose, SetOnclose);
event_handler!(error, GetOnerror, SetOnerror);
event_handler!(message, GetOnmessage, SetOnmessage);
// https://html.spec.whatwg.org/multipage/#dom-websocket-url
- fn Url(self) -> DOMString {
+ fn Url(&self) -> DOMString {
self.url.serialize()
}
// https://html.spec.whatwg.org/multipage/#dom-websocket-readystate
- fn ReadyState(self) -> u16 {
+ fn ReadyState(&self) -> u16 {
self.ready_state.get() as u16
}
// https://html.spec.whatwg.org/multipage/#dom-websocket-binarytype
- fn BinaryType(self) -> BinaryType {
+ fn BinaryType(&self) -> BinaryType {
self.binary_type.get()
}
// https://html.spec.whatwg.org/multipage/#dom-websocket-binarytype
- fn SetBinaryType(self, btype: BinaryType) {
+ fn SetBinaryType(&self, btype: BinaryType) {
self.binary_type.set(btype)
}
// https://html.spec.whatwg.org/multipage/#dom-websocket-send
- fn Send(self, data: Option<USVString>) -> Fallible<()> {
+ fn Send(&self, data: Option<USVString>) -> Fallible<()> {
match self.ready_state.get() {
WebSocketRequestState::Connecting => {
return Err(Error::InvalidState);
@@ -280,7 +280,7 @@ impl<'a> WebSocketMethods for &'a WebSocket {
}
// https://html.spec.whatwg.org/multipage/#dom-websocket-close
- fn Close(self, code: Option<u16>, reason: Option<USVString>) -> Fallible<()>{
+ fn Close(&self, code: Option<u16>, reason: Option<USVString>) -> Fallible<()>{
fn send_close(this: &WebSocket) {
this.ready_state.set(WebSocketRequestState::Closing);