Introduce GlobalScope::get_next_worker_id

This commit is contained in:
Anthony Ramine 2016-09-27 14:07:45 +02:00
parent 38273fe7a8
commit 3e5c0c386c
6 changed files with 17 additions and 32 deletions

View file

@ -7,7 +7,7 @@
//! This module contains smart pointers to global scopes, to simplify writing
//! code that works in workers as well as window scopes.
use devtools_traits::{ScriptToDevtoolsControlMsg, WorkerId};
use devtools_traits::ScriptToDevtoolsControlMsg;
use dom::bindings::codegen::Bindings::WindowBinding::WindowMethods;
use dom::bindings::conversions::root_from_object;
use dom::bindings::error::{ErrorInfo, report_pending_exception};
@ -145,14 +145,6 @@ impl<'a> GlobalRef<'a> {
self.resource_threads().sender()
}
/// Get next worker id.
pub fn get_next_worker_id(&self) -> WorkerId {
match *self {
GlobalRef::Window(ref window) => window.get_next_worker_id(),
GlobalRef::Worker(ref worker) => worker.get_next_worker_id(),
}
}
/// Get the URL for this global scope.
pub fn get_url(&self) -> Url {
match *self {