mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Add a constructor for DedicatedWorkerGlobalScope.
This commit is contained in:
parent
2d74f4d8d8
commit
7b7303e6bc
2 changed files with 26 additions and 1 deletions
|
@ -2,18 +2,35 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::codegen::Bindings::DedicatedWorkerGlobalScopeBinding;
|
||||
use dom::bindings::codegen::InheritTypes::DedicatedWorkerGlobalScopeDerived;
|
||||
use dom::bindings::js::Temporary;
|
||||
use dom::bindings::utils::{Reflectable, Reflector};
|
||||
use dom::eventtarget::EventTarget;
|
||||
use dom::eventtarget::WorkerGlobalScopeTypeId;
|
||||
use dom::workerglobalscope::DedicatedGlobalScope;
|
||||
use dom::workerglobalscope::WorkerGlobalScope;
|
||||
|
||||
use js::jsapi::JSContext;
|
||||
|
||||
#[deriving(Encodable)]
|
||||
pub struct DedicatedWorkerGlobalScope {
|
||||
workerglobalscope: WorkerGlobalScope,
|
||||
}
|
||||
|
||||
impl DedicatedWorkerGlobalScope {
|
||||
pub fn new_inherited() -> DedicatedWorkerGlobalScope {
|
||||
DedicatedWorkerGlobalScope {
|
||||
workerglobalscope: WorkerGlobalScope::new_inherited(DedicatedGlobalScope),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new(cx: *mut JSContext) -> Temporary<DedicatedWorkerGlobalScope> {
|
||||
let scope = box DedicatedWorkerGlobalScope::new_inherited();
|
||||
DedicatedWorkerGlobalScopeBinding::Wrap(cx, scope)
|
||||
}
|
||||
}
|
||||
|
||||
pub trait DedicatedWorkerGlobalScopeMethods {
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use dom::bindings::utils::{Reflectable, Reflector};
|
||||
use dom::eventtarget::EventTarget;
|
||||
use dom::eventtarget::{EventTarget, WorkerGlobalScopeTypeId};
|
||||
|
||||
#[deriving(PartialEq,Encodable)]
|
||||
pub enum WorkerGlobalScopeId {
|
||||
|
@ -15,6 +15,14 @@ pub struct WorkerGlobalScope {
|
|||
pub eventtarget: EventTarget,
|
||||
}
|
||||
|
||||
impl WorkerGlobalScope {
|
||||
pub fn new_inherited(type_id: WorkerGlobalScopeId) -> WorkerGlobalScope {
|
||||
WorkerGlobalScope {
|
||||
eventtarget: EventTarget::new_inherited(WorkerGlobalScopeTypeId(type_id)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait WorkerGlobalScopeMethods {
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue