Skip to content

Commit

Permalink
Implemented name for Runnable trait in WebSocket Runnables
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilshagri committed Jul 23, 2016
1 parent 8e79709 commit 8a05e7a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/script/dom/websocket.rs
Expand Up @@ -461,6 +461,8 @@ struct ConnectionEstablishedTask {
}

impl Runnable for ConnectionEstablishedTask {
fn name(&self) -> &'static str { "ConnectionEstablishedTask" }

fn handler(self: Box<Self>) {
let ws = self.address.root();
let global = ws.r().global();
Expand Down Expand Up @@ -510,6 +512,8 @@ impl Runnable for BufferedAmountTask {
// To be compliant with standards, we need to reset bufferedAmount only when the event loop
// reaches step 1. In our implementation, the bytes will already have been sent on a background
// thread.
fn name(&self) -> &'static str { "BufferedAmountTask" }

fn handler(self: Box<Self>) {
let ws = self.address.root();

Expand All @@ -526,6 +530,8 @@ struct CloseTask {
}

impl Runnable for CloseTask {
fn name(&self) -> &'static str { "CloseTask" }

fn handler(self: Box<Self>) {
let ws = self.address.root();
let ws = ws.r();
Expand Down Expand Up @@ -568,6 +574,8 @@ struct MessageReceivedTask {
}

impl Runnable for MessageReceivedTask {
fn name(&self) -> &'static str { "MessageReceivedTask" }

#[allow(unsafe_code)]
fn handler(self: Box<Self>) {
let ws = self.address.root();
Expand Down

0 comments on commit 8a05e7a

Please sign in to comment.