diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-08-27 15:08:41 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-08-27 15:08:41 -0600 |
commit | 71b277d5675556e61a82ae9dbf3105449c3a8275 (patch) | |
tree | 89f726bf207325eea8a8ca316f6d77d8c88432cb /components/script/dom/websocket.rs | |
parent | 856fda7f2e3fe4abd6de247e8bdaf8cedf3764c2 (diff) | |
parent | 709d347872e37ab2358e057d24557b9977238ecd (diff) | |
download | servo-71b277d5675556e61a82ae9dbf3105449c3a8275.tar.gz servo-71b277d5675556e61a82ae9dbf3105449c3a8275.zip |
Auto merge of #7416 - nox:methods-ref, r=frewsxcv
Make the traits for the IDL interfaces take &self
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7416)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/websocket.rs')
-rw-r--r-- | components/script/dom/websocket.rs | 14 |
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); |