diff options
Diffstat (limited to 'components/script/dom/websocket.rs')
-rw-r--r-- | components/script/dom/websocket.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/dom/websocket.rs b/components/script/dom/websocket.rs index 141b2c680f2..08e528297a2 100644 --- a/components/script/dom/websocket.rs +++ b/components/script/dom/websocket.rs @@ -9,7 +9,7 @@ use dom::bindings::codegen::Bindings::WebSocketBinding; use dom::bindings::codegen::Bindings::WebSocketBinding::{BinaryType, WebSocketMethods}; use dom::bindings::conversions::{ToJSValConvertible}; use dom::bindings::error::{Error, Fallible}; -use dom::bindings::global::{GlobalRef, global_root_from_reflector}; +use dom::bindings::global::GlobalRef; use dom::bindings::inheritance::Castable; use dom::bindings::js::Root; use dom::bindings::refcounted::Trusted; @@ -292,7 +292,7 @@ impl WebSocket { WebSocketRequestState::Closing | WebSocketRequestState::Closed => true, }; - let global = global_root_from_reflector(self); + let global = self.global(); let chan = global.r().networking_thread_source(); let address = Trusted::new(self, chan.clone()); @@ -460,7 +460,7 @@ struct ConnectionEstablishedTask { impl Runnable for ConnectionEstablishedTask { fn handler(self: Box<Self>) { let ws = self.addr.root(); - let global = global_root_from_reflector(ws.r()); + let global = ws.r().global(); // Step 1: Protocols. if !self.protocols.is_empty() && self.headers.get::<WebSocketProtocol>().is_none() { @@ -519,7 +519,7 @@ impl Runnable for CloseTask { fn handler(self: Box<Self>) { let ws = self.addr.root(); let ws = ws.r(); - let global = global_root_from_reflector(ws); + let global = ws.global(); ws.ready_state.set(WebSocketRequestState::Closed); //If failed or full, fire error event if ws.failed.get() || ws.full.get() { @@ -565,7 +565,7 @@ impl Runnable for MessageReceivedTask { } // Step 2-5. - let global = global_root_from_reflector(ws.r()); + let global = ws.r().global(); // global.get_cx() returns a valid `JSContext` pointer, so this is safe. unsafe { let cx = global.r().get_cx(); |